Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
fs.h File Reference
#include <linux/linkage.h>
#include <linux/wait.h>
#include <linux/kdev_t.h>
#include <linux/dcache.h>
#include <linux/path.h>
#include <linux/stat.h>
#include <linux/cache.h>
#include <linux/list.h>
#include <linux/radix-tree.h>
#include <linux/rbtree.h>
#include <linux/init.h>
#include <linux/pid.h>
#include <linux/bug.h>
#include <linux/mutex.h>
#include <linux/capability.h>
#include <linux/semaphore.h>
#include <linux/fiemap.h>
#include <linux/rculist_bl.h>
#include <linux/atomic.h>
#include <linux/shrinker.h>
#include <linux/migrate_mode.h>
#include <linux/uidgid.h>
#include <linux/lockdep.h>
#include <linux/percpu-rwsem.h>
#include <linux/blk_types.h>
#include <asm/byteorder.h>
#include <uapi/linux/fs.h>
#include <linux/quota.h>
#include <linux/nfs_fs_i.h>
#include <linux/fcntl.h>
#include <linux/err.h>

Go to the source code of this file.

Data Structures

struct  iattr
 
struct  iov_iter
 
struct  read_descriptor_t
 
struct  address_space_operations
 
struct  address_space
 
struct  block_device
 
struct  inode
 
struct  fown_struct
 
struct  file_ra_state
 
struct  file
 
struct  file_handle
 
struct  file_lock_operations
 
struct  lock_manager_operations
 
struct  lock_manager
 
struct  file_lock
 
struct  fasync_struct
 
struct  sb_writers
 
struct  super_block
 
struct  fiemap_extent_info
 
struct  file_operations
 
struct  inode_operations
 
struct  super_operations
 
struct  file_system_type
 
struct  filename
 
struct  tree_descr
 
struct  simple_transaction_argresp
 

Macros

#define MAY_EXEC   0x00000001
 
#define MAY_WRITE   0x00000002
 
#define MAY_READ   0x00000004
 
#define MAY_APPEND   0x00000008
 
#define MAY_ACCESS   0x00000010
 
#define MAY_OPEN   0x00000020
 
#define MAY_CHDIR   0x00000040
 
#define MAY_NOT_BLOCK   0x00000080
 
#define FMODE_READ   ((__force fmode_t)0x1)
 
#define FMODE_WRITE   ((__force fmode_t)0x2)
 
#define FMODE_LSEEK   ((__force fmode_t)0x4)
 
#define FMODE_PREAD   ((__force fmode_t)0x8)
 
#define FMODE_PWRITE   ((__force fmode_t)0x10)
 
#define FMODE_EXEC   ((__force fmode_t)0x20)
 
#define FMODE_NDELAY   ((__force fmode_t)0x40)
 
#define FMODE_EXCL   ((__force fmode_t)0x80)
 
#define FMODE_WRITE_IOCTL   ((__force fmode_t)0x100)
 
#define FMODE_32BITHASH   ((__force fmode_t)0x200)
 
#define FMODE_64BITHASH   ((__force fmode_t)0x400)
 
#define FMODE_NOCMTIME   ((__force fmode_t)0x800)
 
#define FMODE_RANDOM   ((__force fmode_t)0x1000)
 
#define FMODE_UNSIGNED_OFFSET   ((__force fmode_t)0x2000)
 
#define FMODE_PATH   ((__force fmode_t)0x4000)
 
#define FMODE_NONOTIFY   ((__force fmode_t)0x1000000)
 
#define CHECK_IOVEC_ONLY   -1
 
#define RW_MASK   REQ_WRITE
 
#define RWA_MASK   REQ_RAHEAD
 
#define READ   0
 
#define WRITE   RW_MASK
 
#define READA   RWA_MASK
 
#define KERNEL_READ   (READ|REQ_KERNEL)
 
#define KERNEL_WRITE   (WRITE|REQ_KERNEL)
 
#define READ_SYNC   (READ | REQ_SYNC)
 
#define WRITE_SYNC   (WRITE | REQ_SYNC | REQ_NOIDLE)
 
#define WRITE_ODIRECT   (WRITE | REQ_SYNC)
 
#define WRITE_FLUSH   (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH)
 
#define WRITE_FUA   (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)
 
#define WRITE_FLUSH_FUA   (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
 
#define ATTR_MODE   (1 << 0)
 
#define ATTR_UID   (1 << 1)
 
#define ATTR_GID   (1 << 2)
 
#define ATTR_SIZE   (1 << 3)
 
#define ATTR_ATIME   (1 << 4)
 
#define ATTR_MTIME   (1 << 5)
 
#define ATTR_CTIME   (1 << 6)
 
#define ATTR_ATIME_SET   (1 << 7)
 
#define ATTR_MTIME_SET   (1 << 8)
 
#define ATTR_FORCE   (1 << 9) /* Not a change, but a change it */
 
#define ATTR_ATTR_FLAG   (1 << 10)
 
#define ATTR_KILL_SUID   (1 << 11)
 
#define ATTR_KILL_SGID   (1 << 12)
 
#define ATTR_FILE   (1 << 13)
 
#define ATTR_KILL_PRIV   (1 << 14)
 
#define ATTR_OPEN   (1 << 15) /* Truncating from open(O_TRUNC) */
 
#define ATTR_TIMES_SET   (1 << 16)
 
#define AOP_FLAG_UNINTERRUPTIBLE   0x0001 /* will not do a short write */
 
#define AOP_FLAG_CONT_EXPAND   0x0002 /* called from cont_expand */
 
#define AOP_FLAG_NOFS
 
#define PAGECACHE_TAG_DIRTY   0
 
#define PAGECACHE_TAG_WRITEBACK   1
 
#define PAGECACHE_TAG_TOWRITE   2
 
#define i_size_ordered_init(inode)   do { } while (0)
 
#define ACL_NOT_CACHED   ((void *)(-1))
 
#define IOP_FASTPERM   0x0001
 
#define IOP_LOOKUP   0x0002
 
#define IOP_NOFOLLOW   0x0004
 
#define FILE_MNT_WRITE_TAKEN   1
 
#define FILE_MNT_WRITE_RELEASED   2
 
#define f_dentry   f_path.dentry
 
#define f_vfsmnt   f_path.mnt
 
#define fput_atomic(x)   atomic_long_add_unless(&(x)->f_count, -1, 1)
 
#define file_count(x)   atomic_long_read(&(x)->f_count)
 
#define MAX_NON_LFS   ((1UL<<31) - 1)
 
#define FL_POSIX   1
 
#define FL_FLOCK   2
 
#define FL_ACCESS   8 /* not trying to lock, just looking */
 
#define FL_EXISTS   16 /* when unlocking, test for existence */
 
#define FL_LEASE   32 /* lease held on this file */
 
#define FL_CLOSE   64 /* unlock on close */
 
#define FL_SLEEP   128 /* A blocking lock */
 
#define FL_DOWNGRADE_PENDING   256 /* Lease is being downgraded */
 
#define FL_UNLOCK_PENDING   512 /* Lease is being broken */
 
#define FILE_LOCK_DEFERRED   1
 
#define INT_LIMIT(x)   (~((x)1 << (sizeof(x)*8 - 1)))
 
#define OFFSET_MAX   INT_LIMIT(loff_t)
 
#define OFFT_OFFSET_MAX   INT_LIMIT(off_t)
 
#define FASYNC_MAGIC   0x4601
 
#define MNT_FORCE   0x00000001 /* Attempt to forcibily umount */
 
#define MNT_DETACH   0x00000002 /* Just detach from the tree */
 
#define MNT_EXPIRE   0x00000004 /* Mark for expiry */
 
#define UMOUNT_NOFOLLOW   0x00000008 /* Don't follow symlink on umount */
 
#define UMOUNT_UNUSED   0x80000000 /* Flag guaranteed to be unused */
 
#define SB_FREEZE_LEVELS   (SB_FREEZE_COMPLETE - 1)
 
#define DT_UNKNOWN   0
 
#define DT_FIFO   1
 
#define DT_CHR   2
 
#define DT_DIR   4
 
#define DT_BLK   6
 
#define DT_REG   8
 
#define DT_LNK   10
 
#define DT_SOCK   12
 
#define DT_WHT   14
 
#define HAVE_COMPAT_IOCTL   1
 
#define HAVE_UNLOCKED_IOCTL   1
 
#define S_SYNC   1 /* Writes are synced at once */
 
#define S_NOATIME   2 /* Do not update access times */
 
#define S_APPEND   4 /* Append-only file */
 
#define S_IMMUTABLE   8 /* Immutable file */
 
#define S_DEAD   16 /* removed, but still open directory */
 
#define S_NOQUOTA   32 /* Inode is not counted to quota */
 
#define S_DIRSYNC   64 /* Directory modifications are synchronous */
 
#define S_NOCMTIME   128 /* Do not update file c/mtime */
 
#define S_SWAPFILE   256 /* Do not truncate: swapon got its bmaps */
 
#define S_PRIVATE   512 /* Inode is fs-internal */
 
#define S_IMA   1024 /* Inode has an associated IMA struct */
 
#define S_AUTOMOUNT   2048 /* Automount/referral quasi-directory */
 
#define S_NOSEC   4096 /* no suid or xattr security attributes */
 
#define __IS_FLG(inode, flg)   ((inode)->i_sb->s_flags & (flg))
 
#define IS_RDONLY(inode)   ((inode)->i_sb->s_flags & MS_RDONLY)
 
#define IS_SYNC(inode)
 
#define IS_DIRSYNC(inode)
 
#define IS_MANDLOCK(inode)   __IS_FLG(inode, MS_MANDLOCK)
 
#define IS_NOATIME(inode)   __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
 
#define IS_I_VERSION(inode)   __IS_FLG(inode, MS_I_VERSION)
 
#define IS_NOQUOTA(inode)   ((inode)->i_flags & S_NOQUOTA)
 
#define IS_APPEND(inode)   ((inode)->i_flags & S_APPEND)
 
#define IS_IMMUTABLE(inode)   ((inode)->i_flags & S_IMMUTABLE)
 
#define IS_POSIXACL(inode)   __IS_FLG(inode, MS_POSIXACL)
 
#define IS_DEADDIR(inode)   ((inode)->i_flags & S_DEAD)
 
#define IS_NOCMTIME(inode)   ((inode)->i_flags & S_NOCMTIME)
 
#define IS_SWAPFILE(inode)   ((inode)->i_flags & S_SWAPFILE)
 
#define IS_PRIVATE(inode)   ((inode)->i_flags & S_PRIVATE)
 
#define IS_IMA(inode)   ((inode)->i_flags & S_IMA)
 
#define IS_AUTOMOUNT(inode)   ((inode)->i_flags & S_AUTOMOUNT)
 
#define IS_NOSEC(inode)   ((inode)->i_flags & S_NOSEC)
 
#define I_DIRTY_SYNC   (1 << 0)
 
#define I_DIRTY_DATASYNC   (1 << 1)
 
#define I_DIRTY_PAGES   (1 << 2)
 
#define __I_NEW   3
 
#define I_NEW   (1 << __I_NEW)
 
#define I_WILL_FREE   (1 << 4)
 
#define I_FREEING   (1 << 5)
 
#define I_CLEAR   (1 << 6)
 
#define __I_SYNC   7
 
#define I_SYNC   (1 << __I_SYNC)
 
#define I_REFERENCED   (1 << 8)
 
#define __I_DIO_WAKEUP   9
 
#define I_DIO_WAKEUP   (1 << I_DIO_WAKEUP)
 
#define I_DIRTY   (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
 
#define FS_REQUIRES_DEV   1
 
#define FS_BINARY_MOUNTDATA   2
 
#define FS_HAS_SUBTYPE   4
 
#define FS_REVAL_DOT   16384 /* Check the paths ".", ".." for staleness */
 
#define FS_RENAME_DOES_D_MOVE   32768 /* FS will handle d_move() during rename() internally. */
 
#define fops_get(fops)   (((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
 
#define fops_put(fops)   do { if (fops) module_put((fops)->owner); } while(0)
 
#define kern_mount(type)   kern_mount_data(type, NULL)
 
#define MAX_RW_COUNT   (INT_MAX & PAGE_CACHE_MASK)
 
#define FLOCK_VERIFY_READ   1
 
#define FLOCK_VERIFY_WRITE   2
 
#define __getname()   kmem_cache_alloc(names_cachep, GFP_KERNEL)
 
#define __putname(name)   kmem_cache_free(names_cachep, (void *)(name))
 
#define putname(name)   final_putname(name)
 
#define CHRDEV_MAJOR_HASH_SIZE   255
 
#define BDEVNAME_SIZE   32 /* Largest string for a blockdev identifier */
 
#define BDEVT_SIZE   10 /* Largest string for MAJ:MIN for blkdev */
 
#define BLKDEV_MAJOR_HASH_SIZE   0
 
#define special_file(m)   (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
 
#define buffer_migrate_page   NULL
 
#define SIMPLE_TRANSACTION_LIMIT   (PAGE_SIZE - sizeof(struct simple_transaction_argresp))
 
#define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt)
 
#define __FMODE_EXEC   ((__force int) FMODE_EXEC)
 
#define __FMODE_NONOTIFY   ((__force int) FMODE_NONOTIFY)
 
#define ACC_MODE(x)   ("\004\002\006\006"[(x)&O_ACCMODE])
 
#define OPEN_FMODE(flag)
 

Typedefs

typedef intget_block_t )(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create)
 
typedef voiddio_iodone_t )(struct kiocb *iocb, loff_t offset, ssize_t bytes, void *private, int ret, bool is_async)
 
typedef int(* read_actor_t )(read_descriptor_t *, struct page *, unsigned long, unsigned long)
 
typedef struct files_structfl_owner_t
 
typedef int(* filldir_t )(void *, const char *, int, loff_t, u64, unsigned)
 

Enumerations

enum  positive_aop_returns { AOP_WRITEPAGE_ACTIVATE = 0x80000, AOP_TRUNCATED_PAGE = 0x80001 }
 
enum  inode_i_mutex_lock_class {
  I_MUTEX_NORMAL, I_MUTEX_PARENT, I_MUTEX_CHILD, I_MUTEX_XATTR,
  I_MUTEX_QUOTA
}
 
enum  {
  SB_UNFROZEN = 0, SB_FREEZE_WRITE = 1, SB_FREEZE_PAGEFAULT = 2, SB_FREEZE_FS = 3,
  SB_FREEZE_COMPLETE = 4
}
 
enum  file_time_flags { S_ATIME = 1, S_MTIME = 2, S_CTIME = 4, S_VERSION = 8 }
 
enum  { FILE_CREATED = 1, FILE_OPENED = 2 }
 

Functions

void __init inode_init (void)
 
void __init inode_init_early (void)
 
void __init files_init (unsigned long)
 
unsigned long get_max_files (void)
 
size_t iov_iter_copy_from_user_atomic (struct page *page, struct iov_iter *i, unsigned long offset, size_t bytes)
 
size_t iov_iter_copy_from_user (struct page *page, struct iov_iter *i, unsigned long offset, size_t bytes)
 
void iov_iter_advance (struct iov_iter *i, size_t bytes)
 
int iov_iter_fault_in_readable (struct iov_iter *i, size_t bytes)
 
size_t iov_iter_single_seg_count (struct iov_iter *i)
 
int pagecache_write_begin (struct file *, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata)
 
int pagecache_write_end (struct file *, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata)
 
struct address_space __attribute__ ((aligned(sizeof(long))))
 
int mapping_tagged (struct address_space *mapping, int tag)
 
struct block_deviceI_BDEV (struct inode *inode)
 
void locks_start_grace (struct net *, struct lock_manager *)
 
void locks_end_grace (struct lock_manager *)
 
int locks_in_grace (struct net *)
 
void send_sigio (struct fown_struct *fown, int fd, int band)
 
int fasync_helper (int, struct file *, int, struct fasync_struct **)
 
struct fasync_structfasync_insert_entry (int, struct file *, struct fasync_struct **, struct fasync_struct *)
 
int fasync_remove_entry (struct file *, struct fasync_struct **)
 
struct fasync_structfasync_alloc (void)
 
void fasync_free (struct fasync_struct *)
 
void kill_fasync (struct fasync_struct **, int, int)
 
int __f_setown (struct file *filp, struct pid *, enum pid_type, int force)
 
int f_setown (struct file *filp, unsigned long arg, int force)
 
void f_delown (struct file *filp)
 
pid_t f_getown (struct file *filp)
 
int send_sigurg (struct fown_struct *fown)
 
void prune_icache_sb (struct super_block *sb, int nr_to_scan)
 
void prune_dcache_sb (struct super_block *sb, int nr_to_scan)
 
struct timespec current_fs_time (struct super_block *sb)
 
void __sb_end_write (struct super_block *sb, int level)
 
int __sb_start_write (struct super_block *sb, int level, bool wait)
 
bool inode_owner_or_capable (const struct inode *inode)
 
void lock_super (struct super_block *)
 
void unlock_super (struct super_block *)
 
int vfs_create (struct inode *, struct dentry *, umode_t, bool)
 
int vfs_mkdir (struct inode *, struct dentry *, umode_t)
 
int vfs_mknod (struct inode *, struct dentry *, umode_t, dev_t)
 
int vfs_symlink (struct inode *, struct dentry *, const char *)
 
int vfs_link (struct dentry *, struct inode *, struct dentry *)
 
int vfs_rmdir (struct inode *, struct dentry *)
 
int vfs_unlink (struct inode *, struct dentry *)
 
int vfs_rename (struct inode *, struct dentry *, struct inode *, struct dentry *)
 
void dentry_unhash (struct dentry *dentry)
 
void inode_init_owner (struct inode *inode, const struct inode *dir, umode_t mode)
 
int fiemap_fill_next_extent (struct fiemap_extent_info *info, u64 logical, u64 phys, u64 len, u32 flags)
 
int fiemap_check_flags (struct fiemap_extent_info *fieinfo, u32 fs_flags)
 
ssize_t rw_copy_check_uvector (int type, const struct iovec __user *uvector, unsigned long nr_segs, unsigned long fast_segs, struct iovec *fast_pointer, struct iovec **ret_pointer)
 
ssize_t vfs_read (struct file *, char __user *, size_t, loff_t *)
 
ssize_t vfs_write (struct file *, const char __user *, size_t, loff_t *)
 
ssize_t vfs_readv (struct file *, const struct iovec __user *, unsigned long, loff_t *)
 
ssize_t vfs_writev (struct file *, const struct iovec __user *, unsigned long, loff_t *)
 
void __mark_inode_dirty (struct inode *, int)
 
void inc_nlink (struct inode *inode)
 
void drop_nlink (struct inode *inode)
 
void clear_nlink (struct inode *inode)
 
void set_nlink (struct inode *inode, unsigned int nlink)
 
void touch_atime (struct path *)
 
int sync_inode (struct inode *inode, struct writeback_control *wbc)
 
int sync_inode_metadata (struct inode *inode, int wait)
 
struct dentrymount_ns (struct file_system_type *fs_type, int flags, void *data, int(*fill_super)(struct super_block *, void *, int))
 
struct dentrymount_bdev (struct file_system_type *fs_type, int flags, const char *dev_name, void *data, int(*fill_super)(struct super_block *, void *, int))
 
struct dentrymount_single (struct file_system_type *fs_type, int flags, void *data, int(*fill_super)(struct super_block *, void *, int))
 
struct dentrymount_nodev (struct file_system_type *fs_type, int flags, void *data, int(*fill_super)(struct super_block *, void *, int))
 
struct dentrymount_subtree (struct vfsmount *mnt, const char *path)
 
void generic_shutdown_super (struct super_block *sb)
 
void kill_block_super (struct super_block *sb)
 
void kill_anon_super (struct super_block *sb)
 
void kill_litter_super (struct super_block *sb)
 
void deactivate_super (struct super_block *sb)
 
void deactivate_locked_super (struct super_block *sb)
 
int set_anon_super (struct super_block *s, void *data)
 
int get_anon_bdev (dev_t *)
 
void free_anon_bdev (dev_t)
 
struct super_blocksget (struct file_system_type *type, int(*test)(struct super_block *, void *), int(*set)(struct super_block *, void *), int flags, void *data)
 
struct dentrymount_pseudo (struct file_system_type *, char *, const struct super_operations *ops, const struct dentry_operations *dops, unsigned long)
 
int register_filesystem (struct file_system_type *)
 
int unregister_filesystem (struct file_system_type *)
 
struct vfsmountkern_mount_data (struct file_system_type *, void *data)
 
void kern_unmount (struct vfsmount *mnt)
 
int may_umount_tree (struct vfsmount *)
 
int may_umount (struct vfsmount *)
 
long do_mount (const char *, const char *, const char *, unsigned long, void *)
 
struct vfsmountcollect_mounts (struct path *)
 
void drop_collected_mounts (struct vfsmount *)
 
int iterate_mounts (int(*)(struct vfsmount *, void *), void *, struct vfsmount *)
 
int vfs_statfs (struct path *, struct kstatfs *)
 
int user_statfs (const char __user *, struct kstatfs *)
 
int fd_statfs (int, struct kstatfs *)
 
int vfs_ustat (dev_t, struct kstatfs *)
 
int freeze_super (struct super_block *super)
 
int thaw_super (struct super_block *super)
 
bool our_mnt (struct vfsmount *mnt)
 
int current_umask (void)
 
int rw_verify_area (int, struct file *, loff_t *, size_t)
 
int do_truncate (struct dentry *, loff_t start, unsigned int time_attrs, struct file *filp)
 
int do_fallocate (struct file *file, int mode, loff_t offset, loff_t len)
 
long do_sys_open (int dfd, const char __user *filename, int flags, umode_t mode)
 
struct filefile_open_name (struct filename *, int, umode_t)
 
struct filefilp_open (const char *, int, umode_t)
 
struct filefile_open_root (struct dentry *, struct vfsmount *, const char *, int)
 
struct filedentry_open (const struct path *, int, const struct cred *)
 
int filp_close (struct file *, fl_owner_t id)
 
struct filenamegetname (const char __user *)
 
int finish_open (struct file *file, struct dentry *dentry, int(*open)(struct inode *, struct file *), int *opened)
 
int finish_no_open (struct file *file, struct dentry *dentry)
 
int ioctl_preallocate (struct file *filp, void __user *argp)
 
void __init vfs_caches_init_early (void)
 
void __init vfs_caches_init (unsigned long)
 
void final_putname (struct filename *name)
 
int sync_filesystem (struct super_block *)
 
int alloc_chrdev_region (dev_t *, unsigned, unsigned, const char *)
 
int register_chrdev_region (dev_t, unsigned, const char *)
 
int __register_chrdev (unsigned int major, unsigned int baseminor, unsigned int count, const char *name, const struct file_operations *fops)
 
void __unregister_chrdev (unsigned int major, unsigned int baseminor, unsigned int count, const char *name)
 
void unregister_chrdev_region (dev_t, unsigned)
 
void chrdev_show (struct seq_file *, off_t)
 
void init_special_inode (struct inode *, umode_t, dev_t)
 
void make_bad_inode (struct inode *)
 
int is_bad_inode (struct inode *)
 
unsigned long invalidate_mapping_pages (struct address_space *mapping, pgoff_t start, pgoff_t end)
 
int invalidate_inode_pages2 (struct address_space *mapping)
 
int invalidate_inode_pages2_range (struct address_space *mapping, pgoff_t start, pgoff_t end)
 
int write_inode_now (struct inode *, int)
 
int filemap_fdatawrite (struct address_space *)
 
int filemap_flush (struct address_space *)
 
int filemap_fdatawait (struct address_space *)
 
int filemap_fdatawait_range (struct address_space *, loff_t lstart, loff_t lend)
 
int filemap_write_and_wait (struct address_space *mapping)
 
int filemap_write_and_wait_range (struct address_space *mapping, loff_t lstart, loff_t lend)
 
int __filemap_fdatawrite_range (struct address_space *mapping, loff_t start, loff_t end, int sync_mode)
 
int filemap_fdatawrite_range (struct address_space *mapping, loff_t start, loff_t end)
 
int vfs_fsync_range (struct file *file, loff_t start, loff_t end, int datasync)
 
int vfs_fsync (struct file *file, int datasync)
 
int generic_write_sync (struct file *file, loff_t pos, loff_t count)
 
void emergency_sync (void)
 
void emergency_remount (void)
 
int notify_change (struct dentry *, struct iattr *)
 
int inode_permission (struct inode *, int)
 
int generic_permission (struct inode *, int)
 
int do_pipe_flags (int *, int)
 
int kernel_read (struct file *, loff_t, char *, unsigned long)
 
struct fileopen_exec (const char *)
 
int is_subdir (struct dentry *, struct dentry *)
 
int path_is_under (struct path *, struct path *)
 
ino_t find_inode_number (struct dentry *, struct qstr *)
 
loff_t default_llseek (struct file *file, loff_t offset, int origin)
 
loff_t vfs_llseek (struct file *file, loff_t offset, int origin)
 
int inode_init_always (struct super_block *, struct inode *)
 
void inode_init_once (struct inode *)
 
void address_space_init_once (struct address_space *mapping)
 
void ihold (struct inode *inode)
 
void iput (struct inode *)
 
struct inodeigrab (struct inode *)
 
ino_t iunique (struct super_block *, ino_t)
 
int inode_needs_sync (struct inode *inode)
 
int generic_delete_inode (struct inode *inode)
 
struct inodeilookup5_nowait (struct super_block *sb, unsigned long hashval, int(*test)(struct inode *, void *), void *data)
 
struct inodeilookup5 (struct super_block *sb, unsigned long hashval, int(*test)(struct inode *, void *), void *data)
 
struct inodeilookup (struct super_block *sb, unsigned long ino)
 
struct inodeiget5_locked (struct super_block *, unsigned long, int(*test)(struct inode *, void *), int(*set)(struct inode *, void *), void *)
 
struct inodeiget_locked (struct super_block *, unsigned long)
 
int insert_inode_locked4 (struct inode *, unsigned long, int(*test)(struct inode *, void *), void *)
 
int insert_inode_locked (struct inode *)
 
void unlock_new_inode (struct inode *)
 
unsigned int get_next_ino (void)
 
void __iget (struct inode *inode)
 
void iget_failed (struct inode *)
 
void clear_inode (struct inode *)
 
void __destroy_inode (struct inode *)
 
struct inodenew_inode_pseudo (struct super_block *sb)
 
struct inodenew_inode (struct super_block *sb)
 
void free_inode_nonrcu (struct inode *inode)
 
int should_remove_suid (struct dentry *)
 
int file_remove_suid (struct file *)
 
void __insert_inode_hash (struct inode *, unsigned long hashval)
 
void __remove_inode_hash (struct inode *)
 
void inode_sb_list_add (struct inode *inode)
 
int set_blocksize (struct block_device *, int)
 
int sb_set_blocksize (struct super_block *, int)
 
int sb_min_blocksize (struct super_block *, int)
 
int generic_file_mmap (struct file *, struct vm_area_struct *)
 
int generic_file_readonly_mmap (struct file *, struct vm_area_struct *)
 
int generic_file_remap_pages (struct vm_area_struct *, unsigned long addr, unsigned long size, pgoff_t pgoff)
 
int file_read_actor (read_descriptor_t *desc, struct page *page, unsigned long offset, unsigned long size)
 
int generic_write_checks (struct file *file, loff_t *pos, size_t *count, int isblk)
 
ssize_t generic_file_aio_read (struct kiocb *, const struct iovec *, unsigned long, loff_t)
 
ssize_t __generic_file_aio_write (struct kiocb *, const struct iovec *, unsigned long, loff_t *)
 
ssize_t generic_file_aio_write (struct kiocb *, const struct iovec *, unsigned long, loff_t)
 
ssize_t generic_file_direct_write (struct kiocb *, const struct iovec *, unsigned long *, loff_t, loff_t *, size_t, size_t)
 
ssize_t generic_file_buffered_write (struct kiocb *, const struct iovec *, unsigned long, loff_t, loff_t *, size_t, ssize_t)
 
ssize_t do_sync_read (struct file *filp, char __user *buf, size_t len, loff_t *ppos)
 
ssize_t do_sync_write (struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
 
int generic_segment_checks (const struct iovec *iov, unsigned long *nr_segs, size_t *count, int access_flags)
 
ssize_t blkdev_aio_write (struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos)
 
int blkdev_fsync (struct file *filp, loff_t start, loff_t end, int datasync)
 
void block_sync_page (struct page *page)
 
ssize_t generic_file_splice_read (struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int)
 
ssize_t default_file_splice_read (struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int)
 
ssize_t generic_file_splice_write (struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int)
 
ssize_t generic_splice_sendpage (struct pipe_inode_info *pipe, struct file *out, loff_t *, size_t len, unsigned int flags)
 
long do_splice_direct (struct file *in, loff_t *ppos, struct file *out, size_t len, unsigned int flags)
 
void file_ra_state_init (struct file_ra_state *ra, struct address_space *mapping)
 
loff_t noop_llseek (struct file *file, loff_t offset, int origin)
 
loff_t no_llseek (struct file *file, loff_t offset, int origin)
 
loff_t generic_file_llseek (struct file *file, loff_t offset, int origin)
 
loff_t generic_file_llseek_size (struct file *file, loff_t offset, int origin, loff_t maxsize, loff_t eof)
 
int generic_file_open (struct inode *inode, struct file *filp)
 
int nonseekable_open (struct inode *inode, struct file *filp)
 
void inode_dio_wait (struct inode *inode)
 
void inode_dio_done (struct inode *inode)
 
int vfs_readlink (struct dentry *, char __user *, int, const char *)
 
int vfs_follow_link (struct nameidata *, const char *)
 
int page_readlink (struct dentry *, char __user *, int)
 
voidpage_follow_link_light (struct dentry *, struct nameidata *)
 
void page_put_link (struct dentry *, struct nameidata *, void *)
 
int __page_symlink (struct inode *inode, const char *symname, int len, int nofs)
 
int page_symlink (struct inode *inode, const char *symname, int len)
 
int generic_readlink (struct dentry *, char __user *, int)
 
void generic_fillattr (struct inode *, struct kstat *)
 
int vfs_getattr (struct vfsmount *, struct dentry *, struct kstat *)
 
void __inode_add_bytes (struct inode *inode, loff_t bytes)
 
void inode_add_bytes (struct inode *inode, loff_t bytes)
 
void inode_sub_bytes (struct inode *inode, loff_t bytes)
 
loff_t inode_get_bytes (struct inode *inode)
 
void inode_set_bytes (struct inode *inode, loff_t bytes)
 
int vfs_readdir (struct file *, filldir_t, void *)
 
int vfs_stat (const char __user *, struct kstat *)
 
int vfs_lstat (const char __user *, struct kstat *)
 
int vfs_fstat (unsigned int, struct kstat *)
 
int vfs_fstatat (int, const char __user *, struct kstat *, int)
 
int do_vfs_ioctl (struct file *filp, unsigned int fd, unsigned int cmd, unsigned long arg)
 
int __generic_block_fiemap (struct inode *inode, struct fiemap_extent_info *fieinfo, loff_t start, loff_t len, get_block_t *get_block)
 
int generic_block_fiemap (struct inode *inode, struct fiemap_extent_info *fieinfo, u64 start, u64 len, get_block_t *get_block)
 
void get_filesystem (struct file_system_type *fs)
 
void put_filesystem (struct file_system_type *fs)
 
struct file_system_typeget_fs_type (const char *name)
 
struct super_blockget_super (struct block_device *)
 
struct super_blockget_super_thawed (struct block_device *)
 
struct super_blockget_active_super (struct block_device *bdev)
 
void drop_super (struct super_block *sb)
 
void iterate_supers (void(*)(struct super_block *, void *), void *)
 
void iterate_supers_type (struct file_system_type *, void(*)(struct super_block *, void *), void *)
 
int dcache_dir_open (struct inode *, struct file *)
 
int dcache_dir_close (struct inode *, struct file *)
 
loff_t dcache_dir_lseek (struct file *, loff_t, int)
 
int dcache_readdir (struct file *, void *, filldir_t)
 
int simple_setattr (struct dentry *, struct iattr *)
 
int simple_getattr (struct vfsmount *, struct dentry *, struct kstat *)
 
int simple_statfs (struct dentry *, struct kstatfs *)
 
int simple_open (struct inode *inode, struct file *file)
 
int simple_link (struct dentry *, struct inode *, struct dentry *)
 
int simple_unlink (struct inode *, struct dentry *)
 
int simple_rmdir (struct inode *, struct dentry *)
 
int simple_rename (struct inode *, struct dentry *, struct inode *, struct dentry *)
 
int noop_fsync (struct file *, loff_t, loff_t, int)
 
int simple_empty (struct dentry *)
 
int simple_readpage (struct file *file, struct page *page)
 
int simple_write_begin (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata)
 
int simple_write_end (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata)
 
struct dentrysimple_lookup (struct inode *, struct dentry *, unsigned int flags)
 
ssize_t generic_read_dir (struct file *, char __user *, size_t, loff_t *)
 
struct dentryd_alloc_name (struct dentry *, const char *)
 
int simple_fill_super (struct super_block *, unsigned long, struct tree_descr *)
 
int simple_pin_fs (struct file_system_type *, struct vfsmount **mount, int *count)
 
void simple_release_fs (struct vfsmount **mount, int *count)
 
ssize_t simple_read_from_buffer (void __user *to, size_t count, loff_t *ppos, const void *from, size_t available)
 
ssize_t simple_write_to_buffer (void *to, size_t available, loff_t *ppos, const void __user *from, size_t count)
 
int generic_file_fsync (struct file *, loff_t, loff_t, int)
 
int generic_check_addressable (unsigned, u64)
 
int inode_change_ok (const struct inode *, struct iattr *)
 
int inode_newsize_ok (const struct inode *, loff_t offset)
 
void setattr_copy (struct inode *inode, const struct iattr *attr)
 
int file_update_time (struct file *file)
 
int generic_show_options (struct seq_file *m, struct dentry *root)
 
void save_mount_options (struct super_block *sb, char *options)
 
void replace_mount_options (struct super_block *sb, char *options)
 
charsimple_transaction_get (struct file *file, const char __user *buf, size_t size)
 
ssize_t simple_transaction_read (struct file *file, char __user *buf, size_t size, loff_t *pos)
 
int simple_transaction_release (struct inode *inode, struct file *file)
 
void simple_transaction_set (struct file *file, size_t n)
 
static int simple_attr_release (struct inode *inode, struct file *file)
 
ssize_t simple_attr_read (struct file *file, char __user *buf, size_t len, loff_t *ppos)
 
ssize_t simple_attr_write (struct file *file, const char __user *buf, size_t len, loff_t *ppos)
 
int proc_nr_files (struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
 
int proc_nr_dentry (struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
 
int proc_nr_inodes (struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
 
int __init get_filesystem_list (char *buf)
 

Variables

struct files_stat_struct files_stat
 
int sysctl_nr_open
 
struct inodes_stat_t inodes_stat
 
int leases_enable
 
int lease_break_time
 
int sysctl_protected_symlinks
 
int sysctl_protected_hardlinks
 
struct address_space_operations empty_aops
 
struct inodehost
 
struct radix_tree_root page_tree
 
spinlock_t tree_lock
 
unsigned int i_mmap_writable
 
struct rb_root i_mmap
 
struct list_head i_mmap_nonlinear
 
struct mutex i_mmap_mutex
 
unsigned long nrpages
 
pgoff_t writeback_index
 
struct address_space_operationsa_ops
 
unsigned long flags
 
struct backing_dev_infobacking_dev_info
 
spinlock_t private_lock
 
struct list_head private_list
 
struct address_spaceassoc_mapping
 
struct block_device __attribute__
 
struct list_head super_blocks
 
spinlock_t sb_lock
 
struct inode_operations ____cacheline_aligned
 
struct kobjectfs_kobj
 
struct kmem_cachenames_cachep
 
struct file_operations def_blk_fops
 
struct file_operations def_chr_fops
 
struct file_operations bad_sock_fops
 
struct file_operations def_fifo_fops
 
struct file_operations read_pipefifo_fops
 
struct file_operations write_pipefifo_fops
 
struct file_operations rdwr_pipefifo_fops
 
struct file_operations generic_ro_fops
 
struct inode_operations page_symlink_inode_operations
 
struct file_operations simple_dir_operations
 
struct inode_operations simple_dir_inode_operations
 

Macro Definition Documentation

#define __FMODE_EXEC   ((__force int) FMODE_EXEC)

Definition at line 2650 of file fs.h.

#define __FMODE_NONOTIFY   ((__force int) FMODE_NONOTIFY)

Definition at line 2651 of file fs.h.

#define __getname ( )    kmem_cache_alloc(names_cachep, GFP_KERNEL)

Definition at line 2034 of file fs.h.

#define __I_DIO_WAKEUP   9

Definition at line 1740 of file fs.h.

#define __I_NEW   3

Definition at line 1732 of file fs.h.

#define __I_SYNC   7

Definition at line 1737 of file fs.h.

#define __IS_FLG (   inode,
  flg 
)    ((inode)->i_sb->s_flags & (flg))

Definition at line 1652 of file fs.h.

#define __putname (   name)    kmem_cache_free(names_cachep, (void *)(name))

Definition at line 2035 of file fs.h.

#define ACC_MODE (   x)    ("\004\002\006\006"[(x)&O_ACCMODE])

Definition at line 2653 of file fs.h.

#define ACL_NOT_CACHED   ((void *)(-1))

Definition at line 507 of file fs.h.

#define AOP_FLAG_CONT_EXPAND   0x0002 /* called from cont_expand */

Definition at line 278 of file fs.h.

#define AOP_FLAG_NOFS
Value:
0x0004 /* used by filesystem to direct
* helper code (eg buffer layer)
* to clear GFP_FS from alloc */

Definition at line 279 of file fs.h.

#define AOP_FLAG_UNINTERRUPTIBLE   0x0001 /* will not do a short write */

Definition at line 277 of file fs.h.

#define ATTR_ATIME   (1 << 4)

Definition at line 200 of file fs.h.

#define ATTR_ATIME_SET   (1 << 7)

Definition at line 203 of file fs.h.

#define ATTR_ATTR_FLAG   (1 << 10)

Definition at line 206 of file fs.h.

#define ATTR_CTIME   (1 << 6)

Definition at line 202 of file fs.h.

#define ATTR_FILE   (1 << 13)

Definition at line 209 of file fs.h.

#define ATTR_FORCE   (1 << 9) /* Not a change, but a change it */

Definition at line 205 of file fs.h.

#define ATTR_GID   (1 << 2)

Definition at line 198 of file fs.h.

#define ATTR_KILL_PRIV   (1 << 14)

Definition at line 210 of file fs.h.

#define ATTR_KILL_SGID   (1 << 12)

Definition at line 208 of file fs.h.

#define ATTR_KILL_SUID   (1 << 11)

Definition at line 207 of file fs.h.

#define ATTR_MODE   (1 << 0)

Definition at line 196 of file fs.h.

#define ATTR_MTIME   (1 << 5)

Definition at line 201 of file fs.h.

#define ATTR_MTIME_SET   (1 << 8)

Definition at line 204 of file fs.h.

#define ATTR_OPEN   (1 << 15) /* Truncating from open(O_TRUNC) */

Definition at line 211 of file fs.h.

#define ATTR_SIZE   (1 << 3)

Definition at line 199 of file fs.h.

#define ATTR_TIMES_SET   (1 << 16)

Definition at line 212 of file fs.h.

#define ATTR_UID   (1 << 1)

Definition at line 197 of file fs.h.

#define BDEVNAME_SIZE   32 /* Largest string for a blockdev identifier */

Definition at line 2134 of file fs.h.

#define BDEVT_SIZE   10 /* Largest string for MAJ:MIN for blkdev */

Definition at line 2135 of file fs.h.

#define BLKDEV_MAJOR_HASH_SIZE   0

Definition at line 2145 of file fs.h.

#define buffer_migrate_page   NULL

Definition at line 2547 of file fs.h.

#define CHECK_IOVEC_ONLY   -1

Definition at line 132 of file fs.h.

#define CHRDEV_MAJOR_HASH_SIZE   255

Definition at line 2111 of file fs.h.

#define DEFINE_SIMPLE_ATTRIBUTE (   __fops,
  __get,
  __set,
  __fmt 
)
Value:
static int __fops ## _open(struct inode *inode, struct file *file) \
{ \
__simple_attr_check_format(__fmt, 0ull); \
return simple_attr_open(inode, file, __get, __set, __fmt); \
} \
static const struct file_operations __fops = { \
.open = __fops ## _open, \
.read = simple_attr_read, \
.write = simple_attr_write, \
.llseek = generic_file_llseek, \
};

Definition at line 2611 of file fs.h.

#define DT_BLK   6

Definition at line 1495 of file fs.h.

#define DT_CHR   2

Definition at line 1493 of file fs.h.

#define DT_DIR   4

Definition at line 1494 of file fs.h.

#define DT_FIFO   1

Definition at line 1492 of file fs.h.

#define DT_LNK   10

Definition at line 1497 of file fs.h.

#define DT_REG   8

Definition at line 1496 of file fs.h.

#define DT_SOCK   12

Definition at line 1498 of file fs.h.

#define DT_UNKNOWN   0

Definition at line 1491 of file fs.h.

#define DT_WHT   14

Definition at line 1499 of file fs.h.

#define f_dentry   f_path.dentry

Definition at line 768 of file fs.h.

#define f_vfsmnt   f_path.mnt

Definition at line 769 of file fs.h.

#define FASYNC_MAGIC   0x4601

Definition at line 1173 of file fs.h.

#define file_count (   x)    atomic_long_read(&(x)->f_count)

Definition at line 819 of file fs.h.

#define FILE_LOCK_DEFERRED   1

Definition at line 888 of file fs.h.

#define FILE_MNT_WRITE_RELEASED   2

Definition at line 756 of file fs.h.

#define FILE_MNT_WRITE_TAKEN   1

Definition at line 755 of file fs.h.

#define FL_ACCESS   8 /* not trying to lock, just looking */

Definition at line 876 of file fs.h.

#define FL_CLOSE   64 /* unlock on close */

Definition at line 879 of file fs.h.

#define FL_DOWNGRADE_PENDING   256 /* Lease is being downgraded */

Definition at line 881 of file fs.h.

#define FL_EXISTS   16 /* when unlocking, test for existence */

Definition at line 877 of file fs.h.

#define FL_FLOCK   2

Definition at line 875 of file fs.h.

#define FL_LEASE   32 /* lease held on this file */

Definition at line 878 of file fs.h.

#define FL_POSIX   1

Definition at line 874 of file fs.h.

#define FL_SLEEP   128 /* A blocking lock */

Definition at line 880 of file fs.h.

#define FL_UNLOCK_PENDING   512 /* Lease is being broken */

Definition at line 882 of file fs.h.

#define FLOCK_VERIFY_READ   1

Definition at line 1894 of file fs.h.

#define FLOCK_VERIFY_WRITE   2

Definition at line 1895 of file fs.h.

#define FMODE_32BITHASH   ((__force fmode_t)0x200)

Definition at line 102 of file fs.h.

#define FMODE_64BITHASH   ((__force fmode_t)0x400)

Definition at line 104 of file fs.h.

#define FMODE_EXCL   ((__force fmode_t)0x80)

Definition at line 97 of file fs.h.

#define FMODE_EXEC   ((__force fmode_t)0x20)

Definition at line 93 of file fs.h.

#define FMODE_LSEEK   ((__force fmode_t)0x4)

Definition at line 87 of file fs.h.

#define FMODE_NDELAY   ((__force fmode_t)0x40)

Definition at line 95 of file fs.h.

#define FMODE_NOCMTIME   ((__force fmode_t)0x800)

Definition at line 112 of file fs.h.

#define FMODE_NONOTIFY   ((__force fmode_t)0x1000000)

Definition at line 124 of file fs.h.

#define FMODE_PATH   ((__force fmode_t)0x4000)

Definition at line 121 of file fs.h.

#define FMODE_PREAD   ((__force fmode_t)0x8)

Definition at line 89 of file fs.h.

#define FMODE_PWRITE   ((__force fmode_t)0x10)

Definition at line 91 of file fs.h.

#define FMODE_RANDOM   ((__force fmode_t)0x1000)

Definition at line 115 of file fs.h.

#define FMODE_READ   ((__force fmode_t)0x1)

Definition at line 83 of file fs.h.

#define FMODE_UNSIGNED_OFFSET   ((__force fmode_t)0x2000)

Definition at line 118 of file fs.h.

#define FMODE_WRITE   ((__force fmode_t)0x2)

Definition at line 85 of file fs.h.

#define FMODE_WRITE_IOCTL   ((__force fmode_t)0x100)

Definition at line 100 of file fs.h.

#define fops_get (   fops)    (((fops) && try_module_get((fops)->owner) ? (fops) : NULL))

Definition at line 1861 of file fs.h.

#define fops_put (   fops)    do { if (fops) module_put((fops)->owner); } while(0)

Definition at line 1863 of file fs.h.

#define fput_atomic (   x)    atomic_long_add_unless(&(x)->f_count, -1, 1)

Definition at line 818 of file fs.h.

#define FS_BINARY_MOUNTDATA   2

Definition at line 1809 of file fs.h.

#define FS_HAS_SUBTYPE   4

Definition at line 1810 of file fs.h.

#define FS_RENAME_DOES_D_MOVE   32768 /* FS will handle d_move() during rename() internally. */

Definition at line 1812 of file fs.h.

#define FS_REQUIRES_DEV   1

Definition at line 1808 of file fs.h.

#define FS_REVAL_DOT   16384 /* Check the paths ".", ".." for staleness */

Definition at line 1811 of file fs.h.

#define HAVE_COMPAT_IOCTL   1

Definition at line 1513 of file fs.h.

#define HAVE_UNLOCKED_IOCTL   1

Definition at line 1514 of file fs.h.

#define I_CLEAR   (1 << 6)

Definition at line 1736 of file fs.h.

#define I_DIO_WAKEUP   (1 << I_DIO_WAKEUP)

Definition at line 1741 of file fs.h.

#define I_DIRTY   (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)

Definition at line 1743 of file fs.h.

#define I_DIRTY_DATASYNC   (1 << 1)

Definition at line 1730 of file fs.h.

#define I_DIRTY_PAGES   (1 << 2)

Definition at line 1731 of file fs.h.

#define I_DIRTY_SYNC   (1 << 0)

Definition at line 1729 of file fs.h.

#define I_FREEING   (1 << 5)

Definition at line 1735 of file fs.h.

#define I_NEW   (1 << __I_NEW)

Definition at line 1733 of file fs.h.

#define I_REFERENCED   (1 << 8)

Definition at line 1739 of file fs.h.

#define i_size_ordered_init (   inode)    do { } while (0)

Definition at line 503 of file fs.h.

#define I_SYNC   (1 << __I_SYNC)

Definition at line 1738 of file fs.h.

#define I_WILL_FREE   (1 << 4)

Definition at line 1734 of file fs.h.

#define INT_LIMIT (   x)    (~((x)1 << (sizeof(x)*8 - 1)))

Definition at line 957 of file fs.h.

#define IOP_FASTPERM   0x0001

Definition at line 509 of file fs.h.

#define IOP_LOOKUP   0x0002

Definition at line 510 of file fs.h.

#define IOP_NOFOLLOW   0x0004

Definition at line 511 of file fs.h.

#define IS_APPEND (   inode)    ((inode)->i_flags & S_APPEND)

Definition at line 1664 of file fs.h.

#define IS_AUTOMOUNT (   inode)    ((inode)->i_flags & S_AUTOMOUNT)

Definition at line 1673 of file fs.h.

#define IS_DEADDIR (   inode)    ((inode)->i_flags & S_DEAD)

Definition at line 1668 of file fs.h.

#define IS_DIRSYNC (   inode)
Value:

Definition at line 1657 of file fs.h.

#define IS_I_VERSION (   inode)    __IS_FLG(inode, MS_I_VERSION)

Definition at line 1661 of file fs.h.

#define IS_IMA (   inode)    ((inode)->i_flags & S_IMA)

Definition at line 1672 of file fs.h.

#define IS_IMMUTABLE (   inode)    ((inode)->i_flags & S_IMMUTABLE)

Definition at line 1665 of file fs.h.

#define IS_MANDLOCK (   inode)    __IS_FLG(inode, MS_MANDLOCK)

Definition at line 1659 of file fs.h.

#define IS_NOATIME (   inode)    __IS_FLG(inode, MS_RDONLY|MS_NOATIME)

Definition at line 1660 of file fs.h.

#define IS_NOCMTIME (   inode)    ((inode)->i_flags & S_NOCMTIME)

Definition at line 1669 of file fs.h.

#define IS_NOQUOTA (   inode)    ((inode)->i_flags & S_NOQUOTA)

Definition at line 1663 of file fs.h.

#define IS_NOSEC (   inode)    ((inode)->i_flags & S_NOSEC)

Definition at line 1674 of file fs.h.

#define IS_POSIXACL (   inode)    __IS_FLG(inode, MS_POSIXACL)

Definition at line 1666 of file fs.h.

#define IS_PRIVATE (   inode)    ((inode)->i_flags & S_PRIVATE)

Definition at line 1671 of file fs.h.

#define IS_RDONLY (   inode)    ((inode)->i_sb->s_flags & MS_RDONLY)

Definition at line 1654 of file fs.h.

#define IS_SWAPFILE (   inode)    ((inode)->i_flags & S_SWAPFILE)

Definition at line 1670 of file fs.h.

#define IS_SYNC (   inode)
Value:
((inode)->i_flags & S_SYNC))

Definition at line 1655 of file fs.h.

#define kern_mount (   type)    kern_mount_data(type, NULL)

Definition at line 1869 of file fs.h.

#define KERNEL_READ   (READ|REQ_KERNEL)

Definition at line 182 of file fs.h.

#define KERNEL_WRITE   (WRITE|REQ_KERNEL)

Definition at line 183 of file fs.h.

#define MAX_NON_LFS   ((1UL<<31) - 1)

Definition at line 864 of file fs.h.

#define MAX_RW_COUNT   (INT_MAX & PAGE_CACHE_MASK)

Definition at line 1891 of file fs.h.

#define MAY_ACCESS   0x00000010

Definition at line 71 of file fs.h.

#define MAY_APPEND   0x00000008

Definition at line 70 of file fs.h.

#define MAY_CHDIR   0x00000040

Definition at line 73 of file fs.h.

#define MAY_EXEC   0x00000001

Definition at line 67 of file fs.h.

#define MAY_NOT_BLOCK   0x00000080

Definition at line 75 of file fs.h.

#define MAY_OPEN   0x00000020

Definition at line 72 of file fs.h.

#define MAY_READ   0x00000004

Definition at line 69 of file fs.h.

#define MAY_WRITE   0x00000002

Definition at line 68 of file fs.h.

#define MNT_DETACH   0x00000002 /* Just detach from the tree */

Definition at line 1198 of file fs.h.

#define MNT_EXPIRE   0x00000004 /* Mark for expiry */

Definition at line 1199 of file fs.h.

#define MNT_FORCE   0x00000001 /* Attempt to forcibily umount */

Definition at line 1197 of file fs.h.

#define OFFSET_MAX   INT_LIMIT(loff_t)

Definition at line 958 of file fs.h.

#define OFFT_OFFSET_MAX   INT_LIMIT(off_t)

Definition at line 959 of file fs.h.

#define OPEN_FMODE (   flag)
Value:

Definition at line 2654 of file fs.h.

#define PAGECACHE_TAG_DIRTY   0

Definition at line 469 of file fs.h.

#define PAGECACHE_TAG_TOWRITE   2

Definition at line 471 of file fs.h.

#define PAGECACHE_TAG_WRITEBACK   1

Definition at line 470 of file fs.h.

#define putname (   name)    final_putname(name)

Definition at line 2037 of file fs.h.

#define READ   0

Definition at line 179 of file fs.h.

#define READ_SYNC   (READ | REQ_SYNC)

Definition at line 185 of file fs.h.

#define READA   RWA_MASK

Definition at line 181 of file fs.h.

#define RW_MASK   REQ_WRITE

Definition at line 176 of file fs.h.

#define RWA_MASK   REQ_RAHEAD

Definition at line 177 of file fs.h.

#define S_APPEND   4 /* Append-only file */

Definition at line 1627 of file fs.h.

#define S_AUTOMOUNT   2048 /* Automount/referral quasi-directory */

Definition at line 1636 of file fs.h.

#define S_DEAD   16 /* removed, but still open directory */

Definition at line 1629 of file fs.h.

#define S_DIRSYNC   64 /* Directory modifications are synchronous */

Definition at line 1631 of file fs.h.

#define S_IMA   1024 /* Inode has an associated IMA struct */

Definition at line 1635 of file fs.h.

#define S_IMMUTABLE   8 /* Immutable file */

Definition at line 1628 of file fs.h.

#define S_NOATIME   2 /* Do not update access times */

Definition at line 1626 of file fs.h.

#define S_NOCMTIME   128 /* Do not update file c/mtime */

Definition at line 1632 of file fs.h.

#define S_NOQUOTA   32 /* Inode is not counted to quota */

Definition at line 1630 of file fs.h.

#define S_NOSEC   4096 /* no suid or xattr security attributes */

Definition at line 1637 of file fs.h.

#define S_PRIVATE   512 /* Inode is fs-internal */

Definition at line 1634 of file fs.h.

#define S_SWAPFILE   256 /* Do not truncate: swapon got its bmaps */

Definition at line 1633 of file fs.h.

#define S_SYNC   1 /* Writes are synced at once */

Definition at line 1625 of file fs.h.

#define SB_FREEZE_LEVELS   (SB_FREEZE_COMPLETE - 1)

Definition at line 1216 of file fs.h.

#define SIMPLE_TRANSACTION_LIMIT   (PAGE_SIZE - sizeof(struct simple_transaction_argresp))

Definition at line 2585 of file fs.h.

#define special_file (   m)    (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))

Definition at line 2453 of file fs.h.

#define UMOUNT_NOFOLLOW   0x00000008 /* Don't follow symlink on umount */

Definition at line 1200 of file fs.h.

#define UMOUNT_UNUSED   0x80000000 /* Flag guaranteed to be unused */

Definition at line 1201 of file fs.h.

#define WRITE   RW_MASK

Definition at line 180 of file fs.h.

#define WRITE_FLUSH   (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH)

Definition at line 188 of file fs.h.

#define WRITE_FLUSH_FUA   (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)

Definition at line 190 of file fs.h.

#define WRITE_FUA   (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)

Definition at line 189 of file fs.h.

#define WRITE_ODIRECT   (WRITE | REQ_SYNC)

Definition at line 187 of file fs.h.

#define WRITE_SYNC   (WRITE | REQ_SYNC | REQ_NOIDLE)

Definition at line 186 of file fs.h.

Typedef Documentation

typedef void( dio_iodone_t)(struct kiocb *iocb, loff_t offset, ssize_t bytes, void *private, int ret, bool is_async)

Definition at line 63 of file fs.h.

typedef int(* filldir_t)(void *, const char *, int, loff_t, u64, unsigned)

Definition at line 1507 of file fs.h.

Definition at line 897 of file fs.h.

typedef int( get_block_t)(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create)

Definition at line 61 of file fs.h.

typedef int(* read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long)

Definition at line 339 of file fs.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
SB_UNFROZEN 
SB_FREEZE_WRITE 
SB_FREEZE_PAGEFAULT 
SB_FREEZE_FS 
SB_FREEZE_COMPLETE 

Definition at line 1207 of file fs.h.

anonymous enum
Enumerator:
FILE_CREATED 
FILE_OPENED 

Definition at line 2013 of file fs.h.

Enumerator:
S_ATIME 
S_MTIME 
S_CTIME 
S_VERSION 

Definition at line 1788 of file fs.h.

Enumerator:
I_MUTEX_NORMAL 
I_MUTEX_PARENT 
I_MUTEX_CHILD 
I_MUTEX_XATTR 
I_MUTEX_QUOTA 

Definition at line 625 of file fs.h.

enum positive_aop_returns - aop return codes with specific semantics

: Informs the caller that page writeback has completed, that the page is still locked, and should be considered active. The VM uses this hint to return the page to the active list – it won't be a candidate for writeback again in the near future. Other callers must be careful to unlock the page if they get this return. Returned by writepage();

: The AOP method that was handed a locked page has unlocked it and the page might have been truncated. The caller should back up to acquiring a new page and trying again. The aop will be taking reasonable precautions not to livelock. If the caller held a page reference, it should drop it before retrying. Returned by readpage().

address_space_operation functions return these large constants to indicate special semantics to the caller. These are much larger than the bytes in a page to allow for functions that return the number of bytes operated on in a given page.

Enumerator:
AOP_WRITEPAGE_ACTIVATE 
AOP_TRUNCATED_PAGE 

Definition at line 272 of file fs.h.

Function Documentation

void __destroy_inode ( struct inode )

Definition at line 231 of file inode.c.

int __f_setown ( struct file filp,
struct pid ,
enum  pid_type,
int  force 
)

Definition at line 101 of file fcntl.c.

int __filemap_fdatawrite_range ( struct address_space mapping,
loff_t  start,
loff_t  end,
int  sync_mode 
)

__filemap_fdatawrite_range - start writeback on mapping dirty pages in range : address space structure to write : offset in bytes where the range starts : offset in bytes where the range ends (inclusive) : enable synchronous operation

Start writeback against all of a mapping's dirty pages that lie within the byte offsets <start, end> inclusive.

If sync_mode is WB_SYNC_ALL then this is a "data integrity" operation, as opposed to a regular memory cleansing writeback. The difference between these two operations is that if a dirty page/buffer is encountered, it must be waited upon, and not just skipped over.

Definition at line 202 of file filemap.c.

int __generic_block_fiemap ( struct inode inode,
struct fiemap_extent_info fieinfo,
loff_t  start,
loff_t  len,
get_block_t get_block 
)
ssize_t __generic_file_aio_write ( struct kiocb iocb,
const struct iovec iov,
unsigned long  nr_segs,
loff_t *  ppos 
)

__generic_file_aio_write - write data to a file : IO state structure (file, offset, etc.) : vector with data to write : number of segments in the vector : position where to write

This function does all the work needed for actually writing data to a file. It does all basic checks, removes SUID from the file, updates modification times and calls proper subroutines depending on whether we do direct IO or a standard buffered write.

It expects i_mutex to be grabbed unless we work on a block device or similar object which does not need locking at all.

This function does not take care of syncing data in case of O_SYNC write. A caller has to handle it. This is mainly due to the fact that we want to avoid syncing under i_mutex.

Definition at line 2413 of file filemap.c.

void __iget ( struct inode inode)

Definition at line 386 of file inode.c.

void __inode_add_bytes ( struct inode inode,
loff_t  bytes 
)

Definition at line 421 of file stat.c.

void __insert_inode_hash ( struct inode inode,
unsigned long  hashval 
)

__insert_inode_hash - hash an inode : unhashed inode : unsigned long value used to locate this object in the inode_hashtable.

Add an inode to the inode hash for this superblock.

Definition at line 474 of file inode.c.

void __mark_inode_dirty ( struct inode inode,
int  flags 
)

__mark_inode_dirty - internal function : inode to mark : what kind of dirty (i.e. I_DIRTY_SYNC) Mark an inode as dirty. Callers should use mark_inode_dirty or mark_inode_dirty_sync.

Put the inode on the super block's dirty list.

CAREFUL! We mark it dirty unconditionally, but move it onto the dirty list only if it is hashed or if it refers to a blockdev. If it was not hashed, it will never be added to the dirty list even if it is later hashed, as it will have been marked dirty already.

In short, make sure you hash any inodes before you start marking them dirty.

Note that for blockdevs, inode->dirtied_when represents the dirtying time of the block-special inode (/dev/hda1) itself. And the ->dirtied_when field of the kernel-internal blockdev inode represents the dirtying time of the blockdev's pages. This is why for I_DIRTY_PAGES we always use page->mapping->host, so the page-dirtying time is recorded in the internal blockdev inode.

Definition at line 1143 of file fs-writeback.c.

int __page_symlink ( struct inode inode,
const char symname,
int  len,
int  nofs 
)

Definition at line 3995 of file namei.c.

int __register_chrdev ( unsigned int  major,
unsigned int  baseminor,
unsigned int  count,
const char name,
const struct file_operations fops 
)

Definition at line 264 of file char_dev.c.

void __remove_inode_hash ( struct inode inode)

__remove_inode_hash - remove an inode from the hash : inode to unhash

Remove an inode from the superblock.

Definition at line 492 of file inode.c.

void __sb_end_write ( struct super_block sb,
int  level 
)

Definition at line 1151 of file super.c.

int __sb_start_write ( struct super_block sb,
int  level,
bool  wait 
)

Definition at line 1195 of file super.c.

void __unregister_chrdev ( unsigned int  major,
unsigned int  baseminor,
unsigned int  count,
const char name 
)

Definition at line 331 of file char_dev.c.

void address_space_init_once ( struct address_space mapping)

Definition at line 343 of file inode.c.

int alloc_chrdev_region ( dev_t ,
unsigned  ,
unsigned  ,
const char  
)

Definition at line 232 of file char_dev.c.

ssize_t blkdev_aio_write ( struct kiocb iocb,
const struct iovec iov,
unsigned long  nr_segs,
loff_t  pos 
)

Definition at line 1524 of file block_dev.c.

int blkdev_fsync ( struct file filp,
loff_t  start,
loff_t  end,
int  datasync 
)

Definition at line 356 of file block_dev.c.

void block_sync_page ( struct page page)
void chrdev_show ( struct seq_file ,
off_t   
)
void clear_inode ( struct inode )

Definition at line 502 of file inode.c.

void clear_nlink ( struct inode inode)

clear_nlink - directly zero an inode's link count : inode

This is a low-level filesystem helper to replace any direct filesystem manipulation of i_nlink. See drop_nlink() for why we care about i_nlink hitting zero.

Definition at line 295 of file inode.c.

struct vfsmount* collect_mounts ( struct path )
read

Definition at line 1367 of file namespace.c.

struct timespec current_fs_time ( struct super_block sb)
read

current_fs_time - Return FS time : Superblock.

Return the current time truncated to the time granularity supported by the fs.

Definition at line 222 of file time.c.

int current_umask ( void  )

Definition at line 154 of file fs_struct.c.

struct dentry* d_alloc_name ( struct dentry ,
const char  
)
read

Definition at line 1368 of file dcache.c.

int dcache_dir_close ( struct inode ,
struct file  
)

Definition at line 78 of file libfs.c.

loff_t dcache_dir_lseek ( struct file ,
loff_t  ,
int   
)

Definition at line 84 of file libfs.c.

int dcache_dir_open ( struct inode ,
struct file  
)

Definition at line 69 of file libfs.c.

int dcache_readdir ( struct file ,
void ,
filldir_t   
)

Definition at line 138 of file libfs.c.

void deactivate_locked_super ( struct super_block s)

deactivate_locked_super - drop an active reference to superblock : superblock to deactivate

Drops an active reference to superblock, converting it into a temprory one if there is no other active references left. In that case we tell fs driver to shut it down and drop the temporary reference we had just acquired.

Caller holds exclusive lock on superblock; that lock is released.

Definition at line 294 of file super.c.

void deactivate_super ( struct super_block s)

deactivate_super - drop an active reference to superblock : superblock to deactivate

Variant of deactivate_locked_super(), except that superblock is not locked by caller. If we are going to drop the final active reference, lock will be acquired prior to that.

Definition at line 320 of file super.c.

ssize_t default_file_splice_read ( struct file ,
loff_t *  ,
struct pipe_inode_info ,
size_t  ,
unsigned  int 
)

Definition at line 587 of file splice.c.

loff_t default_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 164 of file read_write.c.

struct file* dentry_open ( const struct path ,
int  ,
const struct cred  
)
read

Definition at line 767 of file open.c.

void dentry_unhash ( struct dentry dentry)

Definition at line 3278 of file namei.c.

int do_fallocate ( struct file file,
int  mode,
loff_t  offset,
loff_t  len 
)

Definition at line 219 of file open.c.

long do_mount ( const char ,
const char ,
const char ,
unsigned  long,
void  
)

Definition at line 2194 of file namespace.c.

int do_pipe_flags ( int ,
int   
)

Definition at line 1102 of file pipe.c.

long do_splice_direct ( struct file in,
loff_t *  ppos,
struct file out,
size_t  len,
unsigned int  flags 
)

do_splice_direct - splices data directly between two files : file to splice from : input file offset : file to splice to : number of bytes to splice : splice modifier flags

Description: For use by do_sendfile(). splice can easily emulate sendfile, but doing it in the application would incur an extra system call (splice in + splice out, as compared to just sendfile()). So this helper can splice directly through a process-private pipe.

Definition at line 1293 of file splice.c.

ssize_t do_sync_read ( struct file filp,
char __user buf,
size_t  len,
loff_t *  ppos 
)

Definition at line 331 of file read_write.c.

ssize_t do_sync_write ( struct file filp,
const char __user buf,
size_t  len,
loff_t *  ppos 
)

Definition at line 387 of file read_write.c.

long do_sys_open ( int  dfd,
const char __user filename,
int  flags,
umode_t  mode 
)

Definition at line 911 of file open.c.

int do_truncate ( struct dentry ,
loff_t  start,
unsigned int  time_attrs,
struct file filp 
)

Definition at line 36 of file open.c.

int do_vfs_ioctl ( struct file filp,
unsigned int  fd,
unsigned int  cmd,
unsigned long  arg 
)

Definition at line 546 of file ioctl.c.

void drop_collected_mounts ( struct vfsmount )

Definition at line 1379 of file namespace.c.

void drop_nlink ( struct inode inode)

drop_nlink - directly drop an inode's link count : inode

This is a low-level filesystem helper to replace any direct filesystem manipulation of i_nlink. In cases where we are attempting to track writes to the filesystem, a decrement to zero means an imminent write when the file is truncated and actually unlinked on the filesystem.

Definition at line 278 of file inode.c.

void drop_super ( struct super_block sb)

Definition at line 502 of file super.c.

void emergency_remount ( void  )

Definition at line 806 of file super.c.

void emergency_sync ( void  )

Definition at line 135 of file sync.c.

void f_delown ( struct file filp)

Definition at line 134 of file fcntl.c.

pid_t f_getown ( struct file filp)

Definition at line 139 of file fcntl.c.

int f_setown ( struct file filp,
unsigned long  arg,
int  force 
)

Definition at line 115 of file fcntl.c.

struct fasync_struct* fasync_alloc ( void  )
read

Definition at line 591 of file fcntl.c.

void fasync_free ( struct fasync_struct )

Definition at line 601 of file fcntl.c.

int fasync_helper ( int  ,
struct file ,
int  ,
struct fasync_struct **   
)

Definition at line 676 of file fcntl.c.

struct fasync_struct* fasync_insert_entry ( int  ,
struct file ,
struct fasync_struct **  ,
struct fasync_struct  
)
read

Definition at line 613 of file fcntl.c.

int fasync_remove_entry ( struct file ,
struct fasync_struct **   
)

Definition at line 565 of file fcntl.c.

int fd_statfs ( int  ,
struct kstatfs  
)

Definition at line 88 of file statfs.c.

int fiemap_check_flags ( struct fiemap_extent_info fieinfo,
u32  fs_flags 
)

fiemap_check_flags - check validity of requested flags for fiemap : Fiemap context passed into ->fiemap : Set of fiemap flags that the file system understands

Called from file system ->fiemap callback. This will compute the intersection of valid fiemap flags and those that the fs supports. That value is then compared against the user supplied flags. In case of bad user flags, the invalid values will be written into the fieinfo structure, and -EBADR is returned, which tells ioctl_fiemap() to return those values to userspace. For this reason, a return code of -EBADR should be preserved.

Returns 0 on success, -EBADR on bad flags.

Definition at line 138 of file ioctl.c.

int fiemap_fill_next_extent ( struct fiemap_extent_info info,
u64  logical,
u64  phys,
u64  len,
u32  flags 
)

Definition at line 85 of file ioctl.c.

struct file* file_open_name ( struct filename ,
int  ,
umode_t   
)
read

Definition at line 872 of file open.c.

struct file* file_open_root ( struct dentry ,
struct vfsmount ,
const char ,
int   
)
read

Definition at line 897 of file open.c.

void file_ra_state_init ( struct file_ra_state ra,
struct address_space mapping 
)

Definition at line 28 of file readahead.c.

int file_read_actor ( read_descriptor_t desc,
struct page page,
unsigned long  offset,
unsigned long  size 
)

Definition at line 1298 of file filemap.c.

int file_remove_suid ( struct file )

Definition at line 1615 of file inode.c.

int file_update_time ( struct file file)

Definition at line 1656 of file inode.c.

int filemap_fdatawait ( struct address_space mapping)

filemap_fdatawait - wait for all under-writeback pages to complete : address space structure to wait for

Walk the list of under-writeback pages of the given address space and wait for all of them.

Definition at line 312 of file filemap.c.

int filemap_fdatawait_range ( struct address_space mapping,
loff_t  start_byte,
loff_t  end_byte 
)

filemap_fdatawait_range - wait for writeback to complete : address space structure to wait for : offset in bytes where the range starts : offset in bytes where the range ends (inclusive)

Walk the list of under-writeback pages of the given address space in the given range and wait for all of them.

Definition at line 261 of file filemap.c.

int filemap_fdatawrite ( struct address_space )

Definition at line 226 of file filemap.c.

int filemap_fdatawrite_range ( struct address_space mapping,
loff_t  start,
loff_t  end 
)

Definition at line 232 of file filemap.c.

int filemap_flush ( struct address_space mapping)

filemap_flush - mostly a non-blocking flush : target address_space

This is a mostly non-blocking flush. Not suitable for data-integrity purposes - I/O may not be started against all dirty pages.

Definition at line 246 of file filemap.c.

int filemap_write_and_wait ( struct address_space mapping)

Definition at line 323 of file filemap.c.

int filemap_write_and_wait_range ( struct address_space mapping,
loff_t  lstart,
loff_t  lend 
)

filemap_write_and_wait_range - write out & wait on a file range : the address_space for the pages : offset in bytes where the range starts : offset in bytes where the range ends (inclusive)

Write out and wait upon file offsets lstart->lend, inclusive.

Note that `lend' is inclusive (describes the last byte to be written) so that this function can be used to write to the very end-of-file (end = -1).

Definition at line 356 of file filemap.c.

void __init files_init ( unsigned  long)

Definition at line 467 of file file_table.c.

int filp_close ( struct file ,
fl_owner_t  id 
)

Definition at line 979 of file open.c.

struct file* filp_open ( const char filename,
int  flags,
umode_t  mode 
)
read

filp_open - open file and return file pointer

: path to open : open flags as per the open(2) second argument : mode for the new file if O_CREAT is set, else ignored

This is the helper to open a file from kernelspace if you really have to. But in generally you should not do this, so please move along, nothing to see here..

Definition at line 890 of file open.c.

void final_putname ( struct filename name)

Definition at line 120 of file namei.c.

ino_t find_inode_number ( struct dentry ,
struct qstr  
)

Definition at line 3063 of file dcache.c.

int finish_no_open ( struct file file,
struct dentry dentry 
)

finish_no_open - finish ->atomic_open() without opening the file

: opaque open data : dentry or NULL (as returned from ->lookup())

This can be used to set the result of a successful lookup in ->atomic_open(). The filesystem's atomic_open() method shall return NULL after calling this.

Definition at line 760 of file open.c.

int finish_open ( struct file file,
struct dentry dentry,
int(*)(struct inode *, struct file *)  open,
int opened 
)

finish_open - finish opening a file : opaque open data : pointer to dentry : open callback

This can be used to finish opening a file passed to i_op->atomic_open().

If the open callback is set to NULL, then the standard f_op->open() filesystem callback is substituted.

Definition at line 735 of file open.c.

void free_anon_bdev ( dev_t  )

Definition at line 858 of file super.c.

void free_inode_nonrcu ( struct inode inode)

Definition at line 225 of file inode.c.

int freeze_super ( struct super_block sb)

freeze_super - lock the filesystem and force it into a consistent state : the super to lock

Syncs the super to make sure the filesystem is consistent and calls the fs's freeze_fs. Subsequent calls to this without first thawing the fs will return -EBUSY.

During this function, sb->s_writers.frozen goes through these values:

SB_UNFROZEN: File system is normal, all writes progress as usual.

SB_FREEZE_WRITE: The file system is in the process of being frozen. New writes should be blocked, though page faults are still allowed. We wait for all writes to complete and then proceed to the next stage.

SB_FREEZE_PAGEFAULT: Freezing continues. Now also page faults are blocked but internal fs threads can still modify the filesystem (although they should not dirty new pages or inodes), writeback can run etc. After waiting for all running page faults we sync the filesystem which will clean all dirty pages and inodes (no new dirty pages or inodes can be created when sync is running).

SB_FREEZE_FS: The file system is frozen. Now all internal sources of fs modification are blocked (e.g. XFS preallocation truncation on inode reclaim). This is usually implemented by blocking new transactions for filesystems that have them and need this additional guard. After all internal writers are finished we call ->freeze_fs() to finish filesystem freezing. Then we transition to SB_FREEZE_COMPLETE state. This state is mostly auxiliary for filesystems to verify they do not modify frozen fs.

sb->s_writers.frozen is protected by sb->s_umount.

Definition at line 1294 of file super.c.

int generic_block_fiemap ( struct inode inode,
struct fiemap_extent_info fieinfo,
u64  start,
u64  len,
get_block_t get_block 
)
int generic_check_addressable ( unsigned  blocksize_bits,
u64  num_blocks 
)

generic_check_addressable - Check addressability of file system : log of file system block size : number of blocks in file system

Determine whether a file system with blocks (and a block size of 2**) is addressable by the sector_t and page cache of the system. Return 0 if so and -EFBIG otherwise.

Definition at line 954 of file libfs.c.

int generic_delete_inode ( struct inode inode)

Definition at line 1375 of file inode.c.

ssize_t generic_file_aio_read ( struct kiocb iocb,
const struct iovec iov,
unsigned long  nr_segs,
loff_t  pos 
)

generic_file_aio_read - generic filesystem read routine : kernel I/O control block : io vector request : number of segments in the iovec : current file position

This is the "read()" routine for all filesystems that can use the page cache directly.

Definition at line 1386 of file filemap.c.

ssize_t generic_file_aio_write ( struct kiocb iocb,
const struct iovec iov,
unsigned long  nr_segs,
loff_t  pos 
)

generic_file_aio_write - write data to a file : IO state structure : vector with data to write : number of segments in the vector : position in file where to write

This is a wrapper around __generic_file_aio_write() to be used by most filesystems. It takes care of syncing the file in case of O_SYNC file and acquires i_mutex as needed.

Definition at line 2521 of file filemap.c.

ssize_t generic_file_buffered_write ( struct kiocb ,
const struct iovec ,
unsigned  long,
loff_t  ,
loff_t *  ,
size_t  ,
ssize_t   
)

Definition at line 2374 of file filemap.c.

ssize_t generic_file_direct_write ( struct kiocb ,
const struct iovec ,
unsigned long ,
loff_t  ,
loff_t *  ,
size_t  ,
size_t   
)

Definition at line 2174 of file filemap.c.

int generic_file_fsync ( struct file ,
loff_t  ,
loff_t  ,
int   
)

Definition at line 918 of file libfs.c.

loff_t generic_file_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 131 of file read_write.c.

loff_t generic_file_llseek_size ( struct file file,
loff_t  offset,
int  origin,
loff_t  maxsize,
loff_t  eof 
)

Definition at line 70 of file read_write.c.

int generic_file_mmap ( struct file ,
struct vm_area_struct  
)

Definition at line 1766 of file filemap.c.

int generic_file_open ( struct inode inode,
struct file filp 
)

Definition at line 1040 of file open.c.

int generic_file_readonly_mmap ( struct file ,
struct vm_area_struct  
)

Definition at line 1770 of file filemap.c.

int generic_file_remap_pages ( struct vm_area_struct ,
unsigned long  addr,
unsigned long  size,
pgoff_t  pgoff 
)

Definition at line 84 of file fremap.c.

ssize_t generic_file_splice_read ( struct file in,
loff_t *  ppos,
struct pipe_inode_info pipe,
size_t  len,
unsigned int  flags 
)

generic_file_splice_read - splice data from file to a pipe : file to splice from : position in : pipe to splice to : number of bytes to splice : splice modifier flags

Description: Will read pages from given file and fill them into a pipe. Can be used as long as the address_space operations for the source implements a readpage() hook.

Definition at line 521 of file splice.c.

ssize_t generic_file_splice_write ( struct pipe_inode_info pipe,
struct file out,
loff_t *  ppos,
size_t  len,
unsigned int  flags 
)

generic_file_splice_write - splice data from a pipe to a file : pipe info : file to write to : position in : number of bytes to splice : splice modifier flags

Description: Will either move or copy pages (determined by options) from the given pipe inode to the given file.

Definition at line 986 of file splice.c.

void generic_fillattr ( struct inode ,
struct kstat  
)

Definition at line 21 of file stat.c.

int generic_permission ( struct inode inode,
int  mask 
)

generic_permission - check for access rights on a Posix-like filesystem : inode to check access rights for : right to check for (MAY_READ, MAY_WRITE, MAY_EXEC, ...)

Used to check for read/write/execute permissions on a file. We use "fsuid" for this, letting us set arbitrary permissions for filesystem access without changing the "normal" uids which are used for other things.

generic_permission is rcu-walk aware. It returns -ECHILD in case an rcu-walk request cannot be satisfied (eg. requires blocking or too much complexity). It would then be called again in ref-walk mode.

Definition at line 311 of file namei.c.

ssize_t generic_read_dir ( struct file ,
char __user ,
size_t  ,
loff_t *   
)

Definition at line 195 of file libfs.c.

int generic_readlink ( struct dentry ,
char __user ,
int   
)

Definition at line 3926 of file namei.c.

int generic_segment_checks ( const struct iovec iov,
unsigned long nr_segs,
size_t count,
int  access_flags 
)

Definition at line 1347 of file filemap.c.

int generic_show_options ( struct seq_file m,
struct dentry root 
)

Definition at line 947 of file namespace.c.

void generic_shutdown_super ( struct super_block sb)

generic_shutdown_super - common helper for ->kill_sb() : superblock to kill

generic_shutdown_super() does all fs-independent work on superblock shutdown. Typical ->kill_sb() should pick all fs-specific objects that need destruction out of superblock, call generic_shutdown_super() and release aforementioned objects. Note: dentries and inodes are taken care of and do not need specific handling.

Upon calling this function, the filesystem may no longer alter or rearrange the set of dentries belonging to this super_block, nor may it change the attachments of dentries to inodes.

Definition at line 404 of file super.c.

ssize_t generic_splice_sendpage ( struct pipe_inode_info pipe,
struct file out,
loff_t *  ppos,
size_t  len,
unsigned int  flags 
)

generic_splice_sendpage - splice data from a pipe to a socket : pipe to splice from : socket to write to : position in : number of bytes to splice : splice modifier flags

Description: Will send bytes from the pipe to a network socket. No data copying is involved.

Definition at line 1085 of file splice.c.

int generic_write_checks ( struct file file,
loff_t *  pos,
size_t count,
int  isblk 
)
inline

Definition at line 2076 of file filemap.c.

int generic_write_sync ( struct file file,
loff_t  pos,
loff_t  count 
)

Definition at line 230 of file sync.c.

struct super_block* get_active_super ( struct block_device bdev)
read

get_active_super - get an active reference to the superblock of a device : device to get the superblock for

Scans the superblock list and finds the superblock of the file system mounted on the device given. Returns the superblock with an active reference or NULL if none was found.

Definition at line 652 of file super.c.

int get_anon_bdev ( dev_t )

Definition at line 826 of file super.c.

void get_filesystem ( struct file_system_type fs)

Definition at line 36 of file filesystems.c.

int __init get_filesystem_list ( char buf)

Definition at line 203 of file filesystems.c.

struct file_system_type* get_fs_type ( const char name)
read

Definition at line 269 of file filesystems.c.

unsigned long get_max_files ( void  )

Definition at line 72 of file file_table.c.

unsigned int get_next_ino ( void  )

Definition at line 876 of file inode.c.

struct super_block* get_super ( struct block_device bdev)
read

get_super - get the superblock of a device : device to get the superblock for

Scans the superblock list and finds the superblock of the file system mounted on the device given. NULL is returned if no match is found.

Definition at line 589 of file super.c.

struct super_block* get_super_thawed ( struct block_device bdev)
read

get_super_thawed - get thawed superblock of a device : device to get the superblock for

Scans the superblock list and finds the superblock of the file system mounted on the device. The superblock is returned once it is thawed (or immediately if it was not frozen). NULL is returned if no match is found.

Definition at line 630 of file super.c.

struct filename* getname ( const char __user )
read

Definition at line 208 of file namei.c.

struct block_device* I_BDEV ( struct inode inode)
read

Definition at line 45 of file block_dev.c.

struct inode* iget5_locked ( struct super_block sb,
unsigned long  hashval,
int(*)(struct inode *, void *)  test,
int(*)(struct inode *, void *)  set,
void data 
)
read

iget5_locked - obtain an inode from a mounted file system : super block of file system : hash value (usually inode number) to get

Test:

: callback used for comparisons between inodes : callback used to initialize a new struct inode : opaque data pointer to pass to

and

Search for the inode specified by and in the inode cache, and if present it is return it with an increased reference count. This is a generalized version of iget_locked() for file systems where the inode number is not sufficient for unique identification of an inode.

If the inode is not in cache, allocate a new inode and return it locked, hashed, and with the I_NEW flag set. The file system gets to fill it in before unlocking it via unlock_new_inode().

Note both

Test:
and are called with the inode_hash_lock held, so can't sleep.

Definition at line 1004 of file inode.c.

void iget_failed ( struct inode inode)

iget_failed - Mark an under-construction inode as dead and release it : The inode to discard

Mark an under-construction inode as dead and release it.

Definition at line 354 of file bad_inode.c.

struct inode* iget_locked ( struct super_block sb,
unsigned long  ino 
)
read

iget_locked - obtain an inode from a mounted file system : super block of file system : inode number to get

Search for the inode specified by in the inode cache and if present return it with an increased reference count. This is for file systems where the inode number is sufficient for unique identification of an inode.

If the inode is not in cache, allocate a new inode and return it locked, hashed, and with the I_NEW flag set. The file system gets to fill it in before unlocking it via unlock_new_inode().

Definition at line 1076 of file inode.c.

struct inode* igrab ( struct inode )
read

Definition at line 1187 of file inode.c.

void ihold ( struct inode inode)

Definition at line 394 of file inode.c.

struct inode* ilookup ( struct super_block sb,
unsigned long  ino 
)
read

ilookup - search for an inode in the inode cache : super block of file system to search : inode number to search for

Search for the inode in the inode cache, and if the inode is in the cache, the inode is returned with an incremented reference count.

Definition at line 1272 of file inode.c.

struct inode* ilookup5 ( struct super_block sb,
unsigned long  hashval,
int(*)(struct inode *, void *)  test,
void data 
)
read

ilookup5 - search for an inode in the inode cache : super block of file system to search : hash value (usually inode number) to search for

Test:
: callback used for comparisons between inodes : opaque data pointer to pass to

Search for the inode specified by and in the inode cache, and if the inode is in the cache, return the inode with an incremented reference count. Waits on I_NEW before returning the inode. returned with an incremented reference count.

This is a generalized version of ilookup() for file systems where the inode number is not sufficient for unique identification of an inode.

Note:

Test:
is called with the inode_hash_lock held, so can't sleep.

Definition at line 1253 of file inode.c.

struct inode* ilookup5_nowait ( struct super_block sb,
unsigned long  hashval,
int(*)(struct inode *, void *)  test,
void data 
)
read

ilookup5_nowait - search for an inode in the inode cache : super block of file system to search : hash value (usually inode number) to search for

Test:
: callback used for comparisons between inodes : opaque data pointer to pass to

Search for the inode specified by and in the inode cache. If the inode is in the cache, the inode is returned with an incremented reference count.

Note: I_NEW is not waited upon so you have to be very careful what you do with the returned inode. You probably should be using ilookup5() instead.

Note2:

Test:
is called with the inode_hash_lock held, so can't sleep.

Definition at line 1222 of file inode.c.

void inc_nlink ( struct inode inode)

inc_nlink - directly increment an inode's link count : inode

This is a low-level filesystem helper to replace any direct filesystem manipulation of i_nlink. Currently, it is only here for parity with dec_nlink().

Definition at line 334 of file inode.c.

void init_special_inode ( struct inode ,
umode_t  ,
dev_t   
)

Definition at line 1801 of file inode.c.

void inode_add_bytes ( struct inode inode,
loff_t  bytes 
)

Definition at line 432 of file stat.c.

int inode_change_ok ( const struct inode inode,
struct iattr attr 
)

inode_change_ok - check if attribute changes to an inode are allowed : inode to check : attributes to change

Check if we are allowed to change the attributes contained in in the given inode. This includes the normal unix access permission checks, as well as checks for rlimits and others.

Should be called as the first thing in ->setattr implementations, possibly after taking additional locks.

Definition at line 31 of file attr.c.

void inode_dio_done ( struct inode inode)

Definition at line 1898 of file inode.c.

void inode_dio_wait ( struct inode inode)

inode_dio_wait - wait for outstanding DIO requests to finish : inode to wait for

Waits for all pending direct I/O requests to finish so that we can proceed with a truncate or equivalent operation.

Must be called under a lock that serializes taking new references to i_dio_count, usually by inode->i_mutex.

Definition at line 1884 of file inode.c.

loff_t inode_get_bytes ( struct inode inode)

Definition at line 456 of file stat.c.

void __init inode_init ( void  )

Definition at line 1770 of file inode.c.

int inode_init_always ( struct super_block sb,
struct inode inode 
)

inode_init_always - perform inode structure intialisation : superblock inode belongs to : inode to initialise

These are initializations that need to be done on every inode allocation as the fields are not initialised by slab allocation.

Definition at line 124 of file inode.c.

void __init inode_init_early ( void  )

Definition at line 1745 of file inode.c.

void inode_init_once ( struct inode )

Definition at line 361 of file inode.c.

void inode_init_owner ( struct inode inode,
const struct inode dir,
umode_t  mode 
)

Definition at line 1827 of file inode.c.

int inode_needs_sync ( struct inode inode)

Definition at line 1691 of file inode.c.

int inode_newsize_ok ( const struct inode inode,
loff_t  offset 
)

inode_newsize_ok - may this inode be truncated to a given size : the inode to be truncated : the new size to assign to the inode : 0 on success, -ve errno on failure

inode_newsize_ok must be called with i_mutex held.

inode_newsize_ok will check filesystem limits and ulimits to check that the new inode size is within limits. inode_newsize_ok will also send SIGXFSZ when necessary. Caller must not proceed with inode size change if failure is returned. must be a file (not directory), with appropriate permissions to allow truncate (inode_newsize_ok does NOT check these conditions).

Definition at line 97 of file attr.c.

bool inode_owner_or_capable ( const struct inode inode)

inode_owner_or_capable - check current task permissions to inode : inode being checked

Return true if current either has CAP_FOWNER to the inode, or owns the file.

Definition at line 1848 of file inode.c.

int inode_permission ( struct inode inode,
int  mask 
)

inode_permission - Check for access rights to a given inode : Inode to check permission on : Right to check for (MAY_READ, MAY_WRITE, MAY_EXEC)

Check for read/write/execute permissions on an inode. We use fs[ug]id for this, letting us set arbitrary permissions for filesystem access without changing the "normal" UIDs which are used for other things.

When checking for MAY_APPEND, MAY_WRITE must also be set in .

Definition at line 438 of file namei.c.

void inode_sb_list_add ( struct inode inode)

inode_sb_list_add - add inode to the superblock list of inodes : inode to add

Definition at line 439 of file inode.c.

void inode_set_bytes ( struct inode inode,
loff_t  bytes 
)

Definition at line 468 of file stat.c.

void inode_sub_bytes ( struct inode inode,
loff_t  bytes 
)

Definition at line 441 of file stat.c.

int insert_inode_locked ( struct inode )

Definition at line 1287 of file inode.c.

int insert_inode_locked4 ( struct inode ,
unsigned  long,
int(*)(struct inode *, void *)  test,
void  
)

Definition at line 1330 of file inode.c.

int invalidate_inode_pages2 ( struct address_space mapping)

invalidate_inode_pages2 - remove all pages from an address_space : the address_space

Any pages which are found to be mapped into pagetables are unmapped prior to invalidation.

Returns -EBUSY if any pages could not be invalidated.

Definition at line 514 of file truncate.c.

int invalidate_inode_pages2_range ( struct address_space mapping,
pgoff_t  start,
pgoff_t  end 
)

invalidate_inode_pages2_range - remove range of pages from an address_space : the address_space : the page offset 'from' which to invalidate : the page offset 'to' which to invalidate (inclusive)

Any pages which are found to be mapped into pagetables are unmapped prior to invalidation.

Returns -EBUSY if any pages could not be invalidated.

Definition at line 434 of file truncate.c.

unsigned long invalidate_mapping_pages ( struct address_space mapping,
pgoff_t  start,
pgoff_t  end 
)

invalidate_mapping_pages - Invalidate all the unlocked pages of one inode : the address_space which holds the pages to invalidate : the offset 'from' which to invalidate : the offset 'to' which to invalidate (inclusive)

This function only removes the unlocked pages, if you want to remove all the pages of one inode, you must call truncate_inode_pages.

invalidate_mapping_pages() will not block on IO activity. It will not invalidate pages which are dirty, locked, under writeback or mapped into pagetables.

Definition at line 328 of file truncate.c.

int ioctl_preallocate ( struct file filp,
void __user argp 
)

Definition at line 425 of file ioctl.c.

void iov_iter_advance ( struct iov_iter i,
size_t  bytes 
)

Definition at line 2002 of file filemap.c.

size_t iov_iter_copy_from_user ( struct page page,
struct iov_iter i,
unsigned long  offset,
size_t  bytes 
)

Definition at line 1981 of file filemap.c.

size_t iov_iter_copy_from_user_atomic ( struct page page,
struct iov_iter i,
unsigned long  offset,
size_t  bytes 
)

Definition at line 1952 of file filemap.c.

int iov_iter_fault_in_readable ( struct iov_iter i,
size_t  bytes 
)

Definition at line 2048 of file filemap.c.

size_t iov_iter_single_seg_count ( struct iov_iter i)

Definition at line 2059 of file filemap.c.

void iput ( struct inode inode)

iput - put an inode : inode to put

Puts an inode, dropping its usage count. If the inode use count hits zero, the inode is then freed and may also be destroyed.

Consequently, iput() can sleep.

Definition at line 1437 of file inode.c.

int is_bad_inode ( struct inode inode)

is_bad_inode - is an inode errored : inode to test

Returns true if the inode in question has been marked as bad.

Definition at line 341 of file bad_inode.c.

int is_subdir ( struct dentry new_dentry,
struct dentry old_dentry 
)

is_subdir - is new dentry a subdirectory of old_dentry : new dentry : old dentry

Returns 1 if new_dentry is a subdirectory of the parent (at any depth). Returns 0 otherwise. Caller must ensure that "new_dentry" is pinned before calling is_subdir()

Definition at line 2959 of file dcache.c.

int iterate_mounts ( int(*)(struct vfsmount *, void *)  ,
void ,
struct vfsmount  
)

Definition at line 1390 of file namespace.c.

void iterate_supers ( void(*)(struct super_block *, void *)  f,
void arg 
)

iterate_supers - call function for all active superblocks : function to call

  • : argument to pass to it

Scans the superblock list and calls given function, passing it locked superblock and given argument.

Definition at line 518 of file super.c.

void iterate_supers_type ( struct file_system_type type,
void(*)(struct super_block *, void *)  f,
void arg 
)

iterate_supers_type - call function for superblocks of given type : fs type : function to call

  • : argument to pass to it

Scans the superblock list and calls given function, passing it locked superblock and given argument.

Definition at line 553 of file super.c.

ino_t iunique ( struct super_block sb,
ino_t  max_reserved 
)

iunique - get a unique inode number : superblock : highest reserved inode number

Obtain an inode number that is unique on the system for a given superblock. This is used by file systems that have no natural permanent inode numbering system. An inode number is returned that is higher than the reserved limit but unique.

BUGS: With a large number of inodes live on the file system this function currently becomes quite slow.

Definition at line 1164 of file inode.c.

struct vfsmount* kern_mount_data ( struct file_system_type ,
void data 
)
read

Definition at line 2653 of file namespace.c.

void kern_unmount ( struct vfsmount mnt)

Definition at line 2668 of file namespace.c.

int kernel_read ( struct file ,
loff_t  ,
char ,
unsigned  long 
)

Definition at line 787 of file exec.c.

void kill_anon_super ( struct super_block sb)

Definition at line 879 of file super.c.

void kill_block_super ( struct super_block sb)
void kill_fasync ( struct fasync_struct **  ,
int  ,
int   
)

Definition at line 713 of file fcntl.c.

void kill_litter_super ( struct super_block sb)

Definition at line 888 of file super.c.

void lock_super ( struct super_block )
void locks_end_grace ( struct lock_manager lm)

locks_end_grace : who this grace period is for

Call this function to state that the given lock manager is ready to resume regular locking. The grace period will not end until all lock managers that called locks_start_grace() also call locks_end_grace(). Note that callers count on it being safe to call this more than once, and the second call should be a no-op.

Definition at line 44 of file grace.c.

int locks_in_grace ( struct net net)

locks_in_grace

Lock managers call this function to determine when it is OK for them to answer ordinary lock requests, and when they should accept only lock reclaims.

Definition at line 59 of file grace.c.

void locks_start_grace ( struct net net,
struct lock_manager lm 
)

locks_start_grace : who this grace period is for

A grace period is a period during which locks should not be given out. Currently grace periods are only enforced by the two lock managers (lockd and nfsd), using the locks_in_grace() function to check when they are in a grace period.

This function is called to start a grace period.

Definition at line 24 of file grace.c.

void make_bad_inode ( struct inode inode)

make_bad_inode - mark an inode bad due to an I/O error : Inode to mark bad

When an inode cannot be read due to a media or remote network failure this function makes the inode "bad" and causes I/O operations on it to fail from this point on.

Definition at line 316 of file bad_inode.c.

int mapping_tagged ( struct address_space mapping,
int  tag 
)

Definition at line 2273 of file page-writeback.c.

int may_umount ( struct vfsmount mnt)

may_umount - check if a mount point is busy : root of mount

This is called to check if a mount point has any open files, pwds, chroots or sub mounts. If the mount has sub mounts this will return busy regardless of whether the sub mounts are busy.

Doesn't take quota and stuff into account. IOW, in some cases it will give false negatives. The main reason why it's here is that we need a non-destructive way to look for easily umountable filesystems.

Definition at line 1077 of file namespace.c.

int may_umount_tree ( struct vfsmount m)

may_umount_tree - check if a mount tree is busy : root of mount tree

This is called to check if a tree of mounts has any open files, pwds, chroots or sub mounts that are busy.

Definition at line 1040 of file namespace.c.

struct dentry* mount_bdev ( struct file_system_type fs_type,
int  flags,
const char dev_name,
void data,
int(*)(struct super_block *, void *, int fill_super 
)
read
struct dentry* mount_nodev ( struct file_system_type fs_type,
int  flags,
void data,
int(*)(struct super_block *, void *, int fill_super 
)
read

Definition at line 1044 of file super.c.

struct dentry* mount_ns ( struct file_system_type fs_type,
int  flags,
void data,
int(*)(struct super_block *, void *, int fill_super 
)
read

Definition at line 908 of file super.c.

struct dentry* mount_pseudo ( struct file_system_type ,
char ,
const struct super_operations ops,
const struct dentry_operations dops,
unsigned  long 
)
read

Definition at line 221 of file libfs.c.

struct dentry* mount_single ( struct file_system_type fs_type,
int  flags,
void data,
int(*)(struct super_block *, void *, int fill_super 
)
read

Definition at line 1069 of file super.c.

struct dentry* mount_subtree ( struct vfsmount mnt,
const char path 
)
read

Definition at line 2376 of file namespace.c.

struct inode* new_inode ( struct super_block sb)
read

new_inode - obtain an inode : superblock

Allocates a new inode for given superblock. The default gfp_mask for allocations related to inode->i_mapping is GFP_HIGHUSER_MOVABLE. If HIGHMEM pages are unsuitable or it is known that pages allocated for the page cache are not reclaimable or migratable, mapping_set_gfp_mask() must be called with suitable flags on the newly created inode's mapping

Definition at line 931 of file inode.c.

struct inode* new_inode_pseudo ( struct super_block sb)
read

new_inode_pseudo - obtain an inode : superblock

Allocates a new inode for given superblock. Inode wont be chained in superblock s_inodes list This means :

  • fs can't be unmount
  • quotas, fsnotify, writeback can't work

Definition at line 906 of file inode.c.

loff_t no_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 158 of file read_write.c.

int nonseekable_open ( struct inode inode,
struct file filp 
)

Definition at line 1055 of file open.c.

int noop_fsync ( struct file ,
loff_t  ,
loff_t  ,
int   
)

Definition at line 977 of file libfs.c.

loff_t noop_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 152 of file read_write.c.

int notify_change ( struct dentry ,
struct iattr  
)

Definition at line 167 of file attr.c.

struct file* open_exec ( const char )
read

Definition at line 750 of file exec.c.

bool our_mnt ( struct vfsmount mnt)

Definition at line 2680 of file namespace.c.

void* page_follow_link_light ( struct dentry ,
struct nameidata  
)

Definition at line 3975 of file namei.c.

void page_put_link ( struct dentry ,
struct nameidata ,
void  
)

Definition at line 3982 of file namei.c.

int page_readlink ( struct dentry ,
char __user ,
int   
)

Definition at line 3963 of file namei.c.

int page_symlink ( struct inode inode,
const char symname,
int  len 
)

Definition at line 4029 of file namei.c.

int pagecache_write_begin ( struct file ,
struct address_space mapping,
loff_t  pos,
unsigned  len,
unsigned  flags,
struct page **  pagep,
void **  fsdata 
)

Definition at line 2151 of file filemap.c.

int pagecache_write_end ( struct file ,
struct address_space mapping,
loff_t  pos,
unsigned  len,
unsigned  copied,
struct page page,
void fsdata 
)

Definition at line 2162 of file filemap.c.

int path_is_under ( struct path ,
struct path  
)

Definition at line 2462 of file namespace.c.

int proc_nr_dentry ( struct ctl_table table,
int  write,
void __user buffer,
size_t lenp,
loff_t *  ppos 
)
int proc_nr_files ( struct ctl_table table,
int  write,
void __user buffer,
size_t lenp,
loff_t *  ppos 
)

Definition at line 89 of file file_table.c.

int proc_nr_inodes ( struct ctl_table table,
int  write,
void __user buffer,
size_t lenp,
loff_t *  ppos 
)
void prune_dcache_sb ( struct super_block sb,
int  count 
)

prune_dcache_sb - shrink the dcache : superblock : number of entries to try to free

Attempt to shrink the superblock dcache LRU by entries. This is done when we need more memory an called from the superblock shrinker function.

This function may fail to free any resources if all the dentries are in use.

Definition at line 864 of file dcache.c.

void prune_icache_sb ( struct super_block sb,
int  nr_to_scan 
)

Definition at line 707 of file inode.c.

void put_filesystem ( struct file_system_type fs)

Definition at line 41 of file filesystems.c.

int register_chrdev_region ( dev_t  ,
unsigned  ,
const char  
)

Definition at line 196 of file char_dev.c.

int register_filesystem ( struct file_system_type fs)

register_filesystem - register a new filesystem : the file system structure

Adds the file system passed to the list of file systems the kernel is aware of for mount and other syscalls. Returns 0 on success, or a negative errno code on an error.

The &struct file_system_type that is passed is linked into the kernel structures and must not be freed until the file system has been unregistered.

Definition at line 69 of file filesystems.c.

void replace_mount_options ( struct super_block sb,
char options 
)

Definition at line 984 of file namespace.c.

ssize_t rw_copy_check_uvector ( int  type,
const struct iovec __user uvector,
unsigned long  nr_segs,
unsigned long  fast_segs,
struct iovec fast_pointer,
struct iovec **  ret_pointer 
)

Definition at line 619 of file read_write.c.

int rw_verify_area ( int  ,
struct file ,
loff_t *  ,
size_t   
)

Definition at line 287 of file read_write.c.

void save_mount_options ( struct super_block sb,
char options 
)

Definition at line 977 of file namespace.c.

int sb_min_blocksize ( struct super_block ,
int   
)

Definition at line 139 of file block_dev.c.

int sb_set_blocksize ( struct super_block ,
int   
)

Definition at line 126 of file block_dev.c.

void send_sigio ( struct fown_struct fown,
int  fd,
int  band 
)

Definition at line 480 of file fcntl.c.

int send_sigurg ( struct fown_struct fown)

Definition at line 515 of file fcntl.c.

int set_anon_super ( struct super_block s,
void data 
)

Definition at line 869 of file super.c.

int set_blocksize ( struct block_device ,
int   
)

Definition at line 104 of file block_dev.c.

void set_nlink ( struct inode inode,
unsigned int  nlink 
)

set_nlink - directly set an inode's link count : inode : new nlink (should be non-zero)

This is a low-level filesystem helper to replace any direct filesystem manipulation of i_nlink.

Definition at line 312 of file inode.c.

void setattr_copy ( struct inode inode,
const struct iattr attr 
)

setattr_copy - copy simple metadata updates into the generic inode : the inode to be updated : the new attributes

setattr_copy must be called with i_mutex held.

setattr_copy updates the inode's metadata with that specified in attr. Noticeably missing is inode size update, which is more complex as it requires pagecache updates.

The inode is not marked as dirty after this operation. The rationale is that for "simple" filesystems, the struct inode is the inode storage. The caller is free to mark the inode dirty afterwards if needed.

Definition at line 140 of file attr.c.

struct super_block* sget ( struct file_system_type type,
int(*)(struct super_block *, void *)  test,
int(*)(struct super_block *, void *)  set,
int  flags,
void data 
)
read

sget - find or create a superblock : filesystem type superblock should belong to

Test:
: comparison callback : setup callback : mount flags : argument to each of them

Definition at line 443 of file super.c.

int should_remove_suid ( struct dentry )

Definition at line 1584 of file inode.c.

ssize_t simple_attr_read ( struct file file,
char __user buf,
size_t  len,
loff_t *  ppos 
)

Definition at line 778 of file libfs.c.

static int simple_attr_release ( struct inode inode,
struct file file 
)

Definition at line 771 of file libfs.c.

ssize_t simple_attr_write ( struct file file,
const char __user buf,
size_t  len,
loff_t *  ppos 
)

Definition at line 813 of file libfs.c.

int simple_empty ( struct dentry )

Definition at line 286 of file libfs.c.

int simple_fill_super ( struct super_block ,
unsigned  long,
struct tree_descr  
)

Definition at line 474 of file libfs.c.

int simple_getattr ( struct vfsmount ,
struct dentry ,
struct kstat  
)

Definition at line 26 of file libfs.c.

int simple_link ( struct dentry ,
struct inode ,
struct dentry  
)

Definition at line 274 of file libfs.c.

struct dentry* simple_lookup ( struct inode ,
struct dentry ,
unsigned int  flags 
)
read

Definition at line 56 of file libfs.c.

int simple_open ( struct inode inode,
struct file file 
)

Definition at line 267 of file libfs.c.

int simple_pin_fs ( struct file_system_type ,
struct vfsmount **  mount,
int count 
)

Definition at line 539 of file libfs.c.

ssize_t simple_read_from_buffer ( void __user to,
size_t  count,
loff_t *  ppos,
const void from,
size_t  available 
)

simple_read_from_buffer - copy data from the buffer to user space : the user space buffer to read to : the maximum number of bytes to read : the current position in the buffer : the buffer to read from : the size of the buffer

The simple_read_from_buffer() function reads up to bytes from the buffer at offset into the user space address starting at .

On success, the number of bytes read is returned and the offset is advanced by this number, or negative value is returned on error.

Definition at line 584 of file libfs.c.

int simple_readpage ( struct file file,
struct page page 
)

Definition at line 386 of file libfs.c.

void simple_release_fs ( struct vfsmount **  mount,
int count 
)

Definition at line 559 of file libfs.c.

int simple_rename ( struct inode ,
struct dentry ,
struct inode ,
struct dentry  
)

Definition at line 327 of file libfs.c.

int simple_rmdir ( struct inode ,
struct dentry  
)

Definition at line 316 of file libfs.c.

int simple_setattr ( struct dentry dentry,
struct iattr iattr 
)

simple_setattr - setattr for simple filesystem : dentry : iattr structure

Returns 0 on success, -error on failure.

simple_setattr is a simple ->setattr implementation without a proper implementation of size changes.

It can either be used for in-memory filesystems or special files on simple regular filesystems. Anything that needs to change on-disk or wire state on size changes needs its own setattr method.

Definition at line 367 of file libfs.c.

int simple_statfs ( struct dentry ,
struct kstatfs  
)

Definition at line 35 of file libfs.c.

char* simple_transaction_get ( struct file file,
const char __user buf,
size_t  size 
)

Definition at line 690 of file libfs.c.

ssize_t simple_transaction_read ( struct file file,
char __user buf,
size_t  size,
loff_t *  pos 
)

Definition at line 721 of file libfs.c.

int simple_transaction_release ( struct inode inode,
struct file file 
)

Definition at line 730 of file libfs.c.

void simple_transaction_set ( struct file file,
size_t  n 
)

Definition at line 676 of file libfs.c.

int simple_unlink ( struct inode ,
struct dentry  
)

Definition at line 306 of file libfs.c.

int simple_write_begin ( struct file file,
struct address_space mapping,
loff_t  pos,
unsigned  len,
unsigned  flags,
struct page **  pagep,
void **  fsdata 
)

Definition at line 395 of file libfs.c.

int simple_write_end ( struct file file,
struct address_space mapping,
loff_t  pos,
unsigned  len,
unsigned  copied,
struct page page,
void fsdata 
)

Definition at line 439 of file libfs.c.

ssize_t simple_write_to_buffer ( void to,
size_t  available,
loff_t *  ppos,
const void __user from,
size_t  count 
)

simple_write_to_buffer - copy data from user space to the buffer : the buffer to write to : the size of the buffer : the current position in the buffer : the user space buffer to read from : the maximum number of bytes to read

The simple_write_to_buffer() function reads up to bytes from the user space address starting at into the buffer at offset .

On success, the number of bytes written is returned and the offset is advanced by this number, or negative value is returned on error.

Definition at line 618 of file libfs.c.

int sync_filesystem ( struct super_block )

Definition at line 47 of file sync.c.

int sync_inode ( struct inode inode,
struct writeback_control wbc 
)

sync_inode - write an inode and its pages to disk. : the inode to sync : controls the writeback mode

sync_inode() will write an inode and its pages to disk. It will also correctly update the inode on its superblock's dirty inode lists and will update inode->i_state.

The caller must have a ref on the inode.

Definition at line 1447 of file fs-writeback.c.

int sync_inode_metadata ( struct inode inode,
int  wait 
)

sync_inode_metadata - write an inode to disk : the inode to sync : wait for I/O to complete.

Write an inode to disk and adjust its dirty state after completion.

Note: only writes the actual inode, no associated data or other metadata.

Definition at line 1462 of file fs-writeback.c.

int thaw_super ( struct super_block sb)

thaw_super – unlock filesystem : the super to thaw

Unlocks the filesystem and marks it writeable again after freeze_super().

Definition at line 1369 of file super.c.

void touch_atime ( struct path path)

touch_atime - update the access time : the &struct path to update

Update the accessed time on an inode and mark it for writeback. This function automatically handles read only file systems and media, as well as the "noatime" flag and inode specific "noatime" markers.

Definition at line 1531 of file inode.c.

void unlock_new_inode ( struct inode inode)

unlock_new_inode - clear the I_NEW state and wake up any waiters : new inode to unlock

Called when the inode is fully initialised to clear the new state of the inode and wake up anyone waiting for the inode to finish initialisation.

Definition at line 972 of file inode.c.

void unlock_super ( struct super_block )
void unregister_chrdev_region ( dev_t  from,
unsigned  count 
)

unregister_chrdev_region() - return a range of device numbers : the first in the range of numbers to unregister : the number of device numbers to unregister

This function will unregister a range of device numbers, starting with . The caller should normally be the one who allocated those numbers in the first place...

Definition at line 307 of file char_dev.c.

int unregister_filesystem ( struct file_system_type fs)

unregister_filesystem - unregister a file system : filesystem to unregister

Remove a file system that was previously successfully registered with the kernel. An error is returned if the file system is not found. Zero is returned on a success.

Once this function has returned the &struct file_system_type structure may be freed or reused.

Definition at line 101 of file filesystems.c.

int user_statfs ( const char __user ,
struct kstatfs  
)

Definition at line 77 of file statfs.c.

void __init vfs_caches_init ( unsigned  long)

Definition at line 3156 of file dcache.c.

void __init vfs_caches_init_early ( void  )

Definition at line 3150 of file dcache.c.

int vfs_create ( struct inode ,
struct dentry ,
umode_t  ,
bool   
)

Definition at line 2336 of file namei.c.

int vfs_follow_link ( struct nameidata ,
const char  
)

Definition at line 3943 of file namei.c.

int vfs_fstat ( unsigned  int,
struct kstat  
)

Definition at line 58 of file stat.c.

int vfs_fstatat ( int  ,
const char __user ,
struct kstat ,
int   
)

Definition at line 72 of file stat.c.

int vfs_fsync ( struct file file,
int  datasync 
)

Definition at line 194 of file sync.c.

int vfs_fsync_range ( struct file file,
loff_t  start,
loff_t  end,
int  datasync 
)

Definition at line 178 of file sync.c.

int vfs_getattr ( struct vfsmount ,
struct dentry ,
struct kstat  
)

Definition at line 40 of file stat.c.

int vfs_link ( struct dentry ,
struct inode ,
struct dentry  
)

Definition at line 3540 of file namei.c.

loff_t vfs_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 219 of file read_write.c.

int vfs_lstat ( const char __user ,
struct kstat  
)

Definition at line 105 of file stat.c.

int vfs_mkdir ( struct inode ,
struct dentry ,
umode_t   
)

Definition at line 3214 of file namei.c.

int vfs_mknod ( struct inode ,
struct dentry ,
umode_t  ,
dev_t   
)

Definition at line 3128 of file namei.c.

ssize_t vfs_read ( struct file ,
char __user ,
size_t  ,
loff_t *   
)

Definition at line 357 of file read_write.c.

int vfs_readdir ( struct file ,
filldir_t  ,
void  
)

Definition at line 23 of file readdir.c.

int vfs_readlink ( struct dentry ,
char __user ,
int  ,
const char  
)

Definition at line 3904 of file namei.c.

ssize_t vfs_readv ( struct file ,
const struct iovec __user ,
unsigned  long,
loff_t *   
)

Definition at line 747 of file read_write.c.

int vfs_rename ( struct inode ,
struct dentry ,
struct inode ,
struct dentry  
)

Definition at line 3763 of file namei.c.

int vfs_rmdir ( struct inode ,
struct dentry  
)

Definition at line 3287 of file namei.c.

int vfs_stat ( const char __user ,
struct kstat  
)

Definition at line 99 of file stat.c.

int vfs_statfs ( struct path ,
struct kstatfs  
)

Definition at line 66 of file statfs.c.

int vfs_symlink ( struct inode ,
struct dentry ,
const char  
)

Definition at line 3489 of file namei.c.

int vfs_unlink ( struct inode ,
struct dentry  
)

Definition at line 3381 of file namei.c.

int vfs_ustat ( dev_t  ,
struct kstatfs  
)

Definition at line 209 of file statfs.c.

ssize_t vfs_write ( struct file ,
const char __user ,
size_t  ,
loff_t *   
)

Definition at line 413 of file read_write.c.

ssize_t vfs_writev ( struct file ,
const struct iovec __user ,
unsigned  long,
loff_t *   
)

Definition at line 760 of file read_write.c.

int write_inode_now ( struct inode inode,
int  sync 
)

write_inode_now - write an inode to disk : inode to write to disk : whether the write should be synchronous or not

This function commits an inode to disk immediately if it is dirty. This is primarily needed by knfsd.

The caller must either have a ref on the inode or must have set I_WILL_FREE.

Definition at line 1418 of file fs-writeback.c.

Variable Documentation

Definition at line 431 of file fs.h.

struct address_space* assoc_mapping

Definition at line 436 of file fs.h.

Definition at line 433 of file fs.h.

struct file_operations bad_sock_fops

Definition at line 22 of file nonet.c.

struct file_operations def_blk_fops

Definition at line 1587 of file block_dev.c.

struct file_operations def_chr_fops

Definition at line 445 of file char_dev.c.

struct file_operations def_fifo_fops

Definition at line 150 of file fifo.c.

Definition at line 64 of file inode.c.

Definition at line 35 of file file_table.c.

unsigned long flags

Definition at line 432 of file fs.h.

struct kobject* fs_kobj

Definition at line 41 of file namespace.c.

struct file_operations generic_ro_fops

Definition at line 23 of file read_write.c.

Definition at line 421 of file fs.h.

struct rb_root i_mmap

Definition at line 425 of file fs.h.

struct mutex i_mmap_mutex

Definition at line 427 of file fs.h.

struct list_head i_mmap_nonlinear

Definition at line 426 of file fs.h.

unsigned int i_mmap_writable

Definition at line 424 of file fs.h.

struct inodes_stat_t inodes_stat

Definition at line 71 of file inode.c.

int lease_break_time

Definition at line 151 of file locks.c.

int leases_enable

Definition at line 150 of file locks.c.

struct kmem_cache* names_cachep
unsigned long nrpages

Definition at line 429 of file fs.h.

struct inode_operations page_symlink_inode_operations

Definition at line 4035 of file namei.c.

Definition at line 422 of file fs.h.

struct list_head private_list

Definition at line 435 of file fs.h.

spinlock_t private_lock

Definition at line 434 of file fs.h.

struct file_operations rdwr_pipefifo_fops

Definition at line 911 of file pipe.c.

struct file_operations read_pipefifo_fops

Definition at line 887 of file pipe.c.

spinlock_t sb_lock
struct inode_operations simple_dir_inode_operations

Definition at line 209 of file libfs.c.

struct file_operations simple_dir_operations

Definition at line 200 of file libfs.c.

struct list_head super_blocks
int sysctl_nr_open
int sysctl_protected_hardlinks
int sysctl_protected_symlinks
spinlock_t tree_lock

Definition at line 423 of file fs.h.

struct file_operations write_pipefifo_fops

Definition at line 899 of file pipe.c.

pgoff_t writeback_index

Definition at line 430 of file fs.h.