Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
the_nilfs.c File Reference
#include <linux/buffer_head.h>
#include <linux/slab.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/random.h>
#include <linux/crc32.h>
#include "nilfs.h"
#include "segment.h"
#include "alloc.h"
#include "cpfile.h"
#include "sufile.h"
#include "dat.h"
#include "segbuf.h"

Go to the source code of this file.

Functions

void nilfs_set_last_segment (struct the_nilfs *nilfs, sector_t start_blocknr, u64 seq, __u64 cno)
 
struct the_nilfsalloc_nilfs (struct block_device *bdev)
 
void destroy_nilfs (struct the_nilfs *nilfs)
 
int load_nilfs (struct the_nilfs *nilfs, struct super_block *sb)
 
unsigned long nilfs_nrsvsegs (struct the_nilfs *nilfs, unsigned long nsegs)
 
void nilfs_set_nsegments (struct the_nilfs *nilfs, unsigned long nsegs)
 
void nilfs_fall_back_super_block (struct the_nilfs *nilfs)
 
void nilfs_swap_super_block (struct the_nilfs *nilfs)
 
int init_nilfs (struct the_nilfs *nilfs, struct super_block *sb, char *data)
 
int nilfs_discard_segments (struct the_nilfs *nilfs, __u64 *segnump, size_t nsegs)
 
int nilfs_count_free_blocks (struct the_nilfs *nilfs, sector_t *nblocks)
 
int nilfs_near_disk_full (struct the_nilfs *nilfs)
 
struct nilfs_rootnilfs_lookup_root (struct the_nilfs *nilfs, __u64 cno)
 
struct nilfs_rootnilfs_find_or_create_root (struct the_nilfs *nilfs, __u64 cno)
 
void nilfs_put_root (struct nilfs_root *root)
 

Function Documentation

struct the_nilfs* alloc_nilfs ( struct block_device bdev)
read

alloc_nilfs - allocate a nilfs object : block device to which the_nilfs is related

Return Value: On success, pointer to the_nilfs is returned. On error, NULL is returned.

Definition at line 68 of file the_nilfs.c.

void destroy_nilfs ( struct the_nilfs nilfs)

destroy_nilfs - destroy nilfs object : nilfs object to be released

Definition at line 96 of file the_nilfs.c.

int init_nilfs ( struct the_nilfs nilfs,
struct super_block sb,
char data 
)

init_nilfs - initialize a NILFS instance. : the_nilfs structure : super block : mount options

init_nilfs() performs common initialization per block device (e.g. reading the super block, getting disk layout information, initializing shared fields in the_nilfs).

Return Value: On success, 0 is returned. On error, a negative error code is returned.

Definition at line 561 of file the_nilfs.c.

int load_nilfs ( struct the_nilfs nilfs,
struct super_block sb 
)

load_nilfs - load and recover the nilfs : the_nilfs structure to be released : super block isntance used to recover past segment

load_nilfs() searches and load the latest super root, attaches the last segment, and does recovery if needed. The caller must call this exclusively for simultaneous mounts.

Definition at line 211 of file the_nilfs.c.

int nilfs_count_free_blocks ( struct the_nilfs nilfs,
sector_t nblocks 
)

Definition at line 681 of file the_nilfs.c.

int nilfs_discard_segments ( struct the_nilfs nilfs,
__u64 segnump,
size_t  nsegs 
)

Definition at line 644 of file the_nilfs.c.

void nilfs_fall_back_super_block ( struct the_nilfs nilfs)

Definition at line 464 of file the_nilfs.c.

struct nilfs_root* nilfs_find_or_create_root ( struct the_nilfs nilfs,
__u64  cno 
)
read

Definition at line 729 of file the_nilfs.c.

struct nilfs_root* nilfs_lookup_root ( struct the_nilfs nilfs,
__u64  cno 
)
read

Definition at line 703 of file the_nilfs.c.

int nilfs_near_disk_full ( struct the_nilfs nilfs)

Definition at line 692 of file the_nilfs.c.

unsigned long nilfs_nrsvsegs ( struct the_nilfs nilfs,
unsigned long  nsegs 
)

nilfs_nrsvsegs - calculate the number of reserved segments : nilfs object : total number of segments

Definition at line 372 of file the_nilfs.c.

void nilfs_put_root ( struct nilfs_root root)

Definition at line 778 of file the_nilfs.c.

void nilfs_set_last_segment ( struct the_nilfs nilfs,
sector_t  start_blocknr,
u64  seq,
__u64  cno 
)

Definition at line 41 of file the_nilfs.c.

void nilfs_set_nsegments ( struct the_nilfs nilfs,
unsigned long  nsegs 
)

Definition at line 379 of file the_nilfs.c.

void nilfs_swap_super_block ( struct the_nilfs nilfs)

Definition at line 473 of file the_nilfs.c.