Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
nilfs.h File Reference
#include <linux/kernel.h>
#include <linux/buffer_head.h>
#include <linux/spinlock.h>
#include <linux/blkdev.h>
#include <linux/nilfs2_fs.h>
#include "the_nilfs.h"
#include "bmap.h"

Go to the source code of this file.

Data Structures

struct  nilfs_inode_info
 
struct  nilfs_transaction_info
 

Macros

#define NILFS_MDT_INO_BITS
 
#define NILFS_SYS_INO_BITS   ((unsigned int)(1 << NILFS_ROOT_INO) | NILFS_MDT_INO_BITS)
 
#define NILFS_FIRST_INO(sb)   (((struct the_nilfs *)sb->s_fs_info)->ns_first_ino)
 
#define NILFS_MDT_INODE(sb, ino)   ((ino) < NILFS_FIRST_INO(sb) && (NILFS_MDT_INO_BITS & (1 << (ino))))
 
#define NILFS_VALID_INODE(sb, ino)   ((ino) >= NILFS_FIRST_INO(sb) || (NILFS_SYS_INO_BITS & (1 << (ino))))
 
#define NILFS_TI_MAGIC   0xd9e392fb
 
#define NILFS_TI_DYNAMIC_ALLOC   0x0001 /* Allocated from slab */
 
#define NILFS_TI_SYNC
 
#define NILFS_TI_GC   0x0004 /* GC context */
 
#define NILFS_TI_COMMIT   0x0008 /* Change happened or not */
 
#define NILFS_TI_WRITER   0x0010 /* Constructor context */
 
#define NILFS_ATIME_DISABLE
 
#define NILFS_FL_INHERITED
 

Enumerations

enum  {
  NILFS_I_NEW = 0, NILFS_I_DIRTY, NILFS_I_QUEUED, NILFS_I_BUSY,
  NILFS_I_COLLECTED, NILFS_I_UPDATED, NILFS_I_INODE_DIRTY, NILFS_I_BMAP,
  NILFS_I_GCINODE
}
 
enum  { NILFS_SB_COMMIT = 0, NILFS_SB_COMMIT_ALL }
 

Functions

int nilfs_transaction_begin (struct super_block *, struct nilfs_transaction_info *, int)
 
int nilfs_transaction_commit (struct super_block *)
 
void nilfs_transaction_abort (struct super_block *)
 
int nilfs_add_link (struct dentry *, struct inode *)
 
ino_t nilfs_inode_by_name (struct inode *, const struct qstr *)
 
int nilfs_make_empty (struct inode *, struct inode *)
 
struct nilfs_dir_entrynilfs_find_entry (struct inode *, const struct qstr *, struct page **)
 
int nilfs_delete_entry (struct nilfs_dir_entry *, struct page *)
 
int nilfs_empty_dir (struct inode *)
 
struct nilfs_dir_entrynilfs_dotdot (struct inode *, struct page **)
 
void nilfs_set_link (struct inode *, struct nilfs_dir_entry *, struct page *, struct inode *)
 
int nilfs_sync_file (struct file *, loff_t, loff_t, int)
 
long nilfs_ioctl (struct file *, unsigned int, unsigned long)
 
long nilfs_compat_ioctl (struct file *file, unsigned int cmd, unsigned long arg)
 
int nilfs_ioctl_prepare_clean_segments (struct the_nilfs *, struct nilfs_argv *, void **)
 
void nilfs_inode_add_blocks (struct inode *inode, int n)
 
void nilfs_inode_sub_blocks (struct inode *inode, int n)
 
struct inodenilfs_new_inode (struct inode *, umode_t)
 
void nilfs_free_inode (struct inode *)
 
int nilfs_get_block (struct inode *, sector_t, struct buffer_head *, int)
 
void nilfs_set_inode_flags (struct inode *)
 
int nilfs_read_inode_common (struct inode *, struct nilfs_inode *)
 
void nilfs_write_inode_common (struct inode *, struct nilfs_inode *, int)
 
struct inodenilfs_ilookup (struct super_block *sb, struct nilfs_root *root, unsigned long ino)
 
struct inodenilfs_iget_locked (struct super_block *sb, struct nilfs_root *root, unsigned long ino)
 
struct inodenilfs_iget (struct super_block *sb, struct nilfs_root *root, unsigned long ino)
 
struct inodenilfs_iget_for_gc (struct super_block *sb, unsigned long ino, __u64 cno)
 
void nilfs_update_inode (struct inode *, struct buffer_head *)
 
void nilfs_truncate (struct inode *)
 
void nilfs_evict_inode (struct inode *)
 
int nilfs_setattr (struct dentry *, struct iattr *)
 
int nilfs_permission (struct inode *inode, int mask)
 
int nilfs_load_inode_block (struct inode *inode, struct buffer_head **pbh)
 
int nilfs_inode_dirty (struct inode *)
 
int nilfs_set_file_dirty (struct inode *inode, unsigned nr_dirty)
 
int nilfs_mark_inode_dirty (struct inode *)
 
void nilfs_dirty_inode (struct inode *, int flags)
 
int nilfs_fiemap (struct inode *inode, struct fiemap_extent_info *fieinfo, __u64 start, __u64 len)
 
struct inodenilfs_alloc_inode (struct super_block *)
 
void nilfs_destroy_inode (struct inode *)
 
 __printf (3, 4) void nilfs_error(struct super_block *
 
const char const char const
char const char struct
nilfs_super_block
nilfs_read_super_block (struct super_block *, u64, int, struct buffer_head **)
 
int nilfs_store_magic_and_option (struct super_block *, struct nilfs_super_block *, char *)
 
int nilfs_check_feature_compatibility (struct super_block *, struct nilfs_super_block *)
 
void nilfs_set_log_cursor (struct nilfs_super_block *, struct the_nilfs *)
 
struct nilfs_super_block ** nilfs_prepare_super (struct super_block *sb, int flip)
 
int nilfs_commit_super (struct super_block *sb, int flag)
 
int nilfs_cleanup_super (struct super_block *sb)
 
int nilfs_resize_fs (struct super_block *sb, __u64 newsize)
 
int nilfs_attach_checkpoint (struct super_block *sb, __u64 cno, int curr_mnt, struct nilfs_root **root)
 
int nilfs_checkpoint_is_mounted (struct super_block *sb, __u64 cno)
 
int nilfs_gccache_submit_read_data (struct inode *, sector_t, sector_t, __u64, struct buffer_head **)
 
int nilfs_gccache_submit_read_node (struct inode *, sector_t, __u64, struct buffer_head **)
 
int nilfs_gccache_wait_and_mark_dirty (struct buffer_head *)
 
int nilfs_init_gcinode (struct inode *inode)
 
void nilfs_remove_all_gcinodes (struct the_nilfs *nilfs)
 

Variables

struct file_operations nilfs_dir_operations
 
struct inode_operations nilfs_file_inode_operations
 
struct file_operations nilfs_file_operations
 
struct address_space_operations nilfs_aops
 
struct inode_operations nilfs_dir_inode_operations
 
struct inode_operations nilfs_special_inode_operations
 
struct inode_operations nilfs_symlink_inode_operations
 
struct file_system_type nilfs_fs_type
 

Macro Definition Documentation

#define NILFS_ATIME_DISABLE

Definition at line 218 of file nilfs.h.

#define NILFS_FIRST_INO (   sb)    (((struct the_nilfs *)sb->s_fs_info)->ns_first_ino)

Definition at line 131 of file nilfs.h.

#define NILFS_FL_INHERITED
Value:

Definition at line 221 of file nilfs.h.

#define NILFS_MDT_INO_BITS
Value:
((unsigned int)(1 << NILFS_DAT_INO | 1 << NILFS_CPFILE_INO | \

Definition at line 123 of file nilfs.h.

#define NILFS_MDT_INODE (   sb,
  ino 
)    ((ino) < NILFS_FIRST_INO(sb) && (NILFS_MDT_INO_BITS & (1 << (ino))))

Definition at line 133 of file nilfs.h.

#define NILFS_SYS_INO_BITS   ((unsigned int)(1 << NILFS_ROOT_INO) | NILFS_MDT_INO_BITS)

Definition at line 128 of file nilfs.h.

#define NILFS_TI_COMMIT   0x0008 /* Change happened or not */

Definition at line 163 of file nilfs.h.

#define NILFS_TI_DYNAMIC_ALLOC   0x0001 /* Allocated from slab */

Definition at line 160 of file nilfs.h.

#define NILFS_TI_GC   0x0004 /* GC context */

Definition at line 162 of file nilfs.h.

#define NILFS_TI_MAGIC   0xd9e392fb

Definition at line 157 of file nilfs.h.

#define NILFS_TI_SYNC
Value:
0x0002 /* Force to construct segment at the
end of transaction. */

Definition at line 161 of file nilfs.h.

#define NILFS_TI_WRITER   0x0010 /* Constructor context */

Definition at line 164 of file nilfs.h.

#define NILFS_VALID_INODE (   sb,
  ino 
)    ((ino) >= NILFS_FIRST_INO(sb) || (NILFS_SYS_INO_BITS & (1 << (ino))))

Definition at line 135 of file nilfs.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
NILFS_I_NEW 
NILFS_I_DIRTY 
NILFS_I_QUEUED 
NILFS_I_BUSY 
NILFS_I_COLLECTED 
NILFS_I_UPDATED 
NILFS_I_INODE_DIRTY 
NILFS_I_BMAP 
NILFS_I_GCINODE 

Definition at line 99 of file nilfs.h.

anonymous enum
Enumerator:
NILFS_SB_COMMIT 
NILFS_SB_COMMIT_ALL 

Definition at line 115 of file nilfs.h.

Function Documentation

__printf ( ,
 
)
int nilfs_add_link ( struct dentry ,
struct inode  
)

Definition at line 448 of file dir.c.

struct inode* nilfs_alloc_inode ( struct super_block )
read

Definition at line 158 of file super.c.

int nilfs_attach_checkpoint ( struct super_block sb,
__u64  cno,
int  curr_mnt,
struct nilfs_root **  root 
)

Definition at line 520 of file super.c.

int nilfs_check_feature_compatibility ( struct super_block ,
struct nilfs_super_block  
)

Definition at line 865 of file super.c.

int nilfs_checkpoint_is_mounted ( struct super_block sb,
__u64  cno 
)

Definition at line 993 of file super.c.

int nilfs_cleanup_super ( struct super_block sb)

nilfs_cleanup_super() - write filesystem state for cleanup : super block instance to be unmounted or degraded to read-only

This function restores state flags in the on-disk super block. This will set "clean" flag (i.e. NILFS_VALID_FS) unless the filesystem was not clean previously.

Definition at line 324 of file super.c.

int nilfs_commit_super ( struct super_block sb,
int  flag 
)

Definition at line 291 of file super.c.

long nilfs_compat_ioctl ( struct file file,
unsigned int  cmd,
unsigned long  arg 
)
int nilfs_delete_entry ( struct nilfs_dir_entry ,
struct page  
)

Definition at line 548 of file dir.c.

void nilfs_destroy_inode ( struct inode )

Definition at line 185 of file super.c.

void nilfs_dirty_inode ( struct inode inode,
int  flags 
)

nilfs_dirty_inode - reflect changes on given inode to an inode block. : inode of the file to be registered.

nilfs_dirty_inode() loads a inode block containing the specified and copies data from a nilfs_inode to a corresponding inode entry in the inode block. This operation is excluded from the segment construction. This function can be called both as a single operation and as a part of indivisible file operations.

Definition at line 924 of file inode.c.

struct nilfs_dir_entry* nilfs_dotdot ( struct inode ,
struct page **   
)
read

Definition at line 398 of file dir.c.

int nilfs_empty_dir ( struct inode )

Definition at line 630 of file dir.c.

void nilfs_evict_inode ( struct inode )

Definition at line 734 of file inode.c.

int nilfs_fiemap ( struct inode inode,
struct fiemap_extent_info fieinfo,
__u64  start,
__u64  len 
)

Definition at line 944 of file inode.c.

struct nilfs_dir_entry* nilfs_find_entry ( struct inode ,
const struct qstr ,
struct page **   
)
read

Definition at line 336 of file dir.c.

void nilfs_free_inode ( struct inode )
int nilfs_gccache_submit_read_data ( struct inode ,
sector_t  ,
sector_t  ,
__u64  ,
struct buffer_head **   
)

Definition at line 72 of file gcinode.c.

int nilfs_gccache_submit_read_node ( struct inode ,
sector_t  ,
__u64  ,
struct buffer_head **   
)

Definition at line 140 of file gcinode.c.

int nilfs_gccache_wait_and_mark_dirty ( struct buffer_head *  )

Definition at line 152 of file gcinode.c.

int nilfs_get_block ( struct inode inode,
sector_t  blkoff,
struct buffer_head *  bh_result,
int  create 
)

nilfs_get_block() - get a file block on the filesystem (callback function) - inode struct of the target file - file block number - buffer head to be mapped on - indicate whether allocating the block or not when it has not been allocated yet.

This function does not issue actual read request of the specified data block. It is done by VFS.

Definition at line 80 of file inode.c.

struct inode* nilfs_iget ( struct super_block sb,
struct nilfs_root root,
unsigned long  ino 
)
read

Definition at line 542 of file inode.c.

struct inode* nilfs_iget_for_gc ( struct super_block sb,
unsigned long  ino,
__u64  cno 
)
read

Definition at line 563 of file inode.c.

struct inode* nilfs_iget_locked ( struct super_block sb,
struct nilfs_root root,
unsigned long  ino 
)
read

Definition at line 532 of file inode.c.

struct inode* nilfs_ilookup ( struct super_block sb,
struct nilfs_root root,
unsigned long  ino 
)
read

Definition at line 522 of file inode.c.

int nilfs_init_gcinode ( struct inode inode)

Definition at line 168 of file gcinode.c.

void nilfs_inode_add_blocks ( struct inode inode,
int  n 
)

Definition at line 51 of file inode.c.

ino_t nilfs_inode_by_name ( struct inode ,
const struct qstr  
)

Definition at line 411 of file dir.c.

int nilfs_inode_dirty ( struct inode )

Definition at line 849 of file inode.c.

void nilfs_inode_sub_blocks ( struct inode inode,
int  n 
)

Definition at line 60 of file inode.c.

long nilfs_ioctl ( struct file ,
unsigned  int,
unsigned  long 
)

Definition at line 794 of file ioctl.c.

int nilfs_ioctl_prepare_clean_segments ( struct the_nilfs ,
struct nilfs_argv ,
void **   
)

Definition at line 534 of file ioctl.c.

int nilfs_load_inode_block ( struct inode inode,
struct buffer_head **  pbh 
)

Definition at line 821 of file inode.c.

int nilfs_make_empty ( struct inode ,
struct inode  
)

Definition at line 588 of file dir.c.

int nilfs_mark_inode_dirty ( struct inode )

Definition at line 896 of file inode.c.

struct inode* nilfs_new_inode ( struct inode ,
umode_t   
)
read

Definition at line 301 of file inode.c.

int nilfs_permission ( struct inode inode,
int  mask 
)

Definition at line 811 of file inode.c.

struct nilfs_super_block** nilfs_prepare_super ( struct super_block sb,
int  flip 
)
read

Definition at line 264 of file super.c.

int nilfs_read_inode_common ( struct inode ,
struct nilfs_inode  
)

Definition at line 397 of file inode.c.

const char const char const char const char struct nilfs_super_block* nilfs_read_super_block ( struct super_block ,
u64  ,
int  ,
struct buffer_head **   
)
read

Definition at line 828 of file super.c.

void nilfs_remove_all_gcinodes ( struct the_nilfs nilfs)

nilfs_remove_all_gcinodes() - remove all unprocessed gc inodes

Definition at line 186 of file gcinode.c.

int nilfs_resize_fs ( struct super_block sb,
__u64  newsize 
)

nilfs_resize_fs - resize the filesystem : super block instance : new size of the filesystem (in bytes)

Definition at line 411 of file super.c.

int nilfs_set_file_dirty ( struct inode inode,
unsigned  nr_dirty 
)

Definition at line 864 of file inode.c.

void nilfs_set_inode_flags ( struct inode )

Definition at line 377 of file inode.c.

void nilfs_set_link ( struct inode ,
struct nilfs_dir_entry ,
struct page ,
struct inode  
)

Definition at line 427 of file dir.c.

void nilfs_set_log_cursor ( struct nilfs_super_block ,
struct the_nilfs  
)

Definition at line 248 of file super.c.

int nilfs_setattr ( struct dentry ,
struct iattr  
)

Definition at line 771 of file inode.c.

int nilfs_store_magic_and_option ( struct super_block ,
struct nilfs_super_block ,
char  
)

Definition at line 842 of file super.c.

int nilfs_sync_file ( struct file ,
loff_t  ,
loff_t  ,
int   
)

Definition at line 30 of file file.c.

void nilfs_transaction_abort ( struct super_block )

Definition at line 253 of file segment.c.

int nilfs_transaction_begin ( struct super_block sb,
struct nilfs_transaction_info ti,
int  vacancy_check 
)

nilfs_transaction_begin - start indivisible file operations. : super block : nilfs_transaction_info : flags for vacancy rate checks

nilfs_transaction_begin() acquires a reader/writer semaphore, called the segment semaphore, to make a segment construction and write tasks exclusive. The function is used with nilfs_transaction_commit() in pairs. The region enclosed by these two functions can be nested. To avoid a deadlock, the semaphore is only acquired or released in the outermost call.

This function allocates a nilfs_transaction_info struct to keep context information on it. It is initialized and hooked onto the current task in the outermost call. If a pre-allocated struct is given to , it is used instead; otherwise a new struct is assigned from a slab.

When flag is set, this function will check the amount of free space, and will wait for the GC to reclaim disk space if low capacity.

Return Value: On success, 0 is returned. On error, one of the following negative error code is returned.

%-ENOMEM - Insufficient memory available.

%-ENOSPC - No space left on device

Definition at line 179 of file segment.c.

int nilfs_transaction_commit ( struct super_block sb)

nilfs_transaction_commit - commit indivisible file operations. : super block

nilfs_transaction_commit() releases the read semaphore which is acquired by nilfs_transaction_begin(). This is only performed in outermost call of this function. If a commit flag is set, nilfs_transaction_commit() sets a timer to start the segment constructor. If a sync flag is set, it starts construction directly.

Definition at line 222 of file segment.c.

void nilfs_truncate ( struct inode )

Definition at line 678 of file inode.c.

void nilfs_update_inode ( struct inode ,
struct buffer_head *   
)

Definition at line 625 of file inode.c.

void nilfs_write_inode_common ( struct inode ,
struct nilfs_inode ,
int   
)

Definition at line 587 of file inode.c.

Variable Documentation

Definition at line 287 of file inode.c.

struct inode_operations nilfs_dir_inode_operations

Definition at line 544 of file namei.c.

struct file_operations nilfs_dir_operations

Definition at line 678 of file dir.c.

struct inode_operations nilfs_file_inode_operations

Definition at line 169 of file file.c.

struct file_operations nilfs_file_operations

Definition at line 152 of file file.c.

struct file_system_type nilfs_fs_type

Definition at line 1357 of file super.c.

struct inode_operations nilfs_special_inode_operations

Definition at line 559 of file namei.c.

struct inode_operations nilfs_symlink_inode_operations

Definition at line 564 of file namei.c.