aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h63
1 files changed, 46 insertions, 17 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 195a8cb2a749..6022f44043f2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -21,7 +21,6 @@
21 21
22/* Fixed constants first: */ 22/* Fixed constants first: */
23#undef NR_OPEN 23#undef NR_OPEN
24extern int sysctl_nr_open;
25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */ 24#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
26 25
27#define BLOCK_SIZE_BITS 10 26#define BLOCK_SIZE_BITS 10
@@ -38,21 +37,13 @@ struct files_stat_struct {
38 int nr_free_files; /* read only */ 37 int nr_free_files; /* read only */
39 int max_files; /* tunable */ 38 int max_files; /* tunable */
40}; 39};
41extern struct files_stat_struct files_stat;
42extern int get_max_files(void);
43 40
44struct inodes_stat_t { 41struct inodes_stat_t {
45 int nr_inodes; 42 int nr_inodes;
46 int nr_unused; 43 int nr_unused;
47 int dummy[5]; /* padding for sysctl ABI compatibility */ 44 int dummy[5]; /* padding for sysctl ABI compatibility */
48}; 45};
49extern struct inodes_stat_t inodes_stat;
50 46
51extern int leases_enable, lease_break_time;
52
53#ifdef CONFIG_DNOTIFY
54extern int dir_notify_enable;
55#endif
56 47
57#define NR_FILE 8192 /* this can well be larger on a larger system */ 48#define NR_FILE 8192 /* this can well be larger on a larger system */
58 49
@@ -82,6 +73,14 @@ extern int dir_notify_enable;
82 (specialy hack for floppy.c) */ 73 (specialy hack for floppy.c) */
83#define FMODE_WRITE_IOCTL ((__force fmode_t)128) 74#define FMODE_WRITE_IOCTL ((__force fmode_t)128)
84 75
76/*
77 * Don't update ctime and mtime.
78 *
79 * Currently a special hack for the XFS open_by_handle ioctl, but we'll
80 * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
81 */
82#define FMODE_NOCMTIME ((__force fmode_t)2048)
83
85#define RW_MASK 1 84#define RW_MASK 1
86#define RWA_MASK 2 85#define RWA_MASK 2
87#define READ 0 86#define READ 0
@@ -235,6 +234,8 @@ extern int dir_notify_enable;
235#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 234#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
236#define FIBMAP _IO(0x00,1) /* bmap access */ 235#define FIBMAP _IO(0x00,1) /* bmap access */
237#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 236#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
237#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
238#define FITHAW _IOWR('X', 120, int) /* Thaw */
238 239
239#define FS_IOC_GETFLAGS _IOR('f', 1, long) 240#define FS_IOC_GETFLAGS _IOR('f', 1, long)
240#define FS_IOC_SETFLAGS _IOW('f', 2, long) 241#define FS_IOC_SETFLAGS _IOW('f', 2, long)
@@ -322,6 +323,15 @@ extern void __init inode_init(void);
322extern void __init inode_init_early(void); 323extern void __init inode_init_early(void);
323extern void __init files_init(unsigned long); 324extern void __init files_init(unsigned long);
324 325
326extern struct files_stat_struct files_stat;
327extern int get_max_files(void);
328extern int sysctl_nr_open;
329extern struct inodes_stat_t inodes_stat;
330extern int leases_enable, lease_break_time;
331#ifdef CONFIG_DNOTIFY
332extern int dir_notify_enable;
333#endif
334
325struct buffer_head; 335struct buffer_head;
326typedef int (get_block_t)(struct inode *inode, sector_t iblock, 336typedef int (get_block_t)(struct inode *inode, sector_t iblock,
327 struct buffer_head *bh_result, int create); 337 struct buffer_head *bh_result, int create);
@@ -415,6 +425,9 @@ enum positive_aop_returns {
415 425
416#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ 426#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */
417#define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ 427#define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */
428#define AOP_FLAG_NOFS 0x0004 /* used by filesystem to direct
429 * helper code (eg buffer layer)
430 * to clear GFP_FS from alloc */
418 431
419/* 432/*
420 * oh the beauties of C type declarations. 433 * oh the beauties of C type declarations.
@@ -554,6 +567,7 @@ struct address_space {
554struct block_device { 567struct block_device {
555 dev_t bd_dev; /* not a kdev_t - it's a search key */ 568 dev_t bd_dev; /* not a kdev_t - it's a search key */
556 struct inode * bd_inode; /* will die */ 569 struct inode * bd_inode; /* will die */
570 struct super_block * bd_super;
557 int bd_openers; 571 int bd_openers;
558 struct mutex bd_mutex; /* open/close mutex */ 572 struct mutex bd_mutex; /* open/close mutex */
559 struct semaphore bd_mount_sem; 573 struct semaphore bd_mount_sem;
@@ -579,6 +593,11 @@ struct block_device {
579 * care to not mess up bd_private for that case. 593 * care to not mess up bd_private for that case.
580 */ 594 */
581 unsigned long bd_private; 595 unsigned long bd_private;
596
597 /* The counter of freeze processes */
598 int bd_fsfreeze_count;
599 /* Mutex for freeze */
600 struct mutex bd_fsfreeze_mutex;
582}; 601};
583 602
584/* 603/*
@@ -1122,7 +1141,6 @@ struct super_block {
1122 struct rw_semaphore s_umount; 1141 struct rw_semaphore s_umount;
1123 struct mutex s_lock; 1142 struct mutex s_lock;
1124 int s_count; 1143 int s_count;
1125 int s_syncing;
1126 int s_need_sync_fs; 1144 int s_need_sync_fs;
1127 atomic_t s_active; 1145 atomic_t s_active;
1128#ifdef CONFIG_SECURITY 1146#ifdef CONFIG_SECURITY
@@ -1174,6 +1192,11 @@ struct super_block {
1174 * generic_show_options() 1192 * generic_show_options()
1175 */ 1193 */
1176 char *s_options; 1194 char *s_options;
1195
1196 /*
1197 * storage for asynchronous operations
1198 */
1199 struct list_head s_async_list;
1177}; 1200};
1178 1201
1179extern struct timespec current_fs_time(struct super_block *sb); 1202extern struct timespec current_fs_time(struct super_block *sb);
@@ -1204,7 +1227,6 @@ extern void unlock_super(struct super_block *);
1204/* 1227/*
1205 * VFS helper functions.. 1228 * VFS helper functions..
1206 */ 1229 */
1207extern int vfs_permission(struct nameidata *, int);
1208extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1230extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
1209extern int vfs_mkdir(struct inode *, struct dentry *, int); 1231extern int vfs_mkdir(struct inode *, struct dentry *, int);
1210extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1232extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
@@ -1302,7 +1324,6 @@ struct file_operations {
1302 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1324 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1303 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1325 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1304 int (*check_flags)(int); 1326 int (*check_flags)(int);
1305 int (*dir_notify)(struct file *filp, unsigned long arg);
1306 int (*flock) (struct file *, int, struct file_lock *); 1327 int (*flock) (struct file *, int, struct file_lock *);
1307 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1328 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1308 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1329 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
@@ -1363,8 +1384,8 @@ struct super_operations {
1363 void (*put_super) (struct super_block *); 1384 void (*put_super) (struct super_block *);
1364 void (*write_super) (struct super_block *); 1385 void (*write_super) (struct super_block *);
1365 int (*sync_fs)(struct super_block *sb, int wait); 1386 int (*sync_fs)(struct super_block *sb, int wait);
1366 void (*write_super_lockfs) (struct super_block *); 1387 int (*freeze_fs) (struct super_block *);
1367 void (*unlockfs) (struct super_block *); 1388 int (*unfreeze_fs) (struct super_block *);
1368 int (*statfs) (struct dentry *, struct kstatfs *); 1389 int (*statfs) (struct dentry *, struct kstatfs *);
1369 int (*remount_fs) (struct super_block *, int *, char *); 1390 int (*remount_fs) (struct super_block *, int *, char *);
1370 void (*clear_inode) (struct inode *); 1391 void (*clear_inode) (struct inode *);
@@ -1376,6 +1397,7 @@ struct super_operations {
1376 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 1397 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
1377 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1398 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1378#endif 1399#endif
1400 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1379}; 1401};
1380 1402
1381/* 1403/*
@@ -1821,7 +1843,7 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
1821extern int filemap_fdatawrite_range(struct address_space *mapping, 1843extern int filemap_fdatawrite_range(struct address_space *mapping,
1822 loff_t start, loff_t end); 1844 loff_t start, loff_t end);
1823 1845
1824extern long do_fsync(struct file *file, int datasync); 1846extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync);
1825extern void sync_supers(void); 1847extern void sync_supers(void);
1826extern void sync_filesystems(int wait); 1848extern void sync_filesystems(int wait);
1827extern void __fsync_super(struct super_block *sb); 1849extern void __fsync_super(struct super_block *sb);
@@ -1861,7 +1883,7 @@ extern void free_write_pipe(struct file *);
1861 1883
1862extern struct file *do_filp_open(int dfd, const char *pathname, 1884extern struct file *do_filp_open(int dfd, const char *pathname,
1863 int open_flag, int mode); 1885 int open_flag, int mode);
1864extern int may_open(struct nameidata *, int, int); 1886extern int may_open(struct path *, int, int);
1865 1887
1866extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 1888extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
1867extern struct file * open_exec(const char *); 1889extern struct file * open_exec(const char *);
@@ -1877,7 +1899,9 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
1877 1899
1878extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); 1900extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
1879 1901
1902extern struct inode * inode_init_always(struct super_block *, struct inode *);
1880extern void inode_init_once(struct inode *); 1903extern void inode_init_once(struct inode *);
1904extern void inode_add_to_lists(struct super_block *, struct inode *);
1881extern void iput(struct inode *); 1905extern void iput(struct inode *);
1882extern struct inode * igrab(struct inode *); 1906extern struct inode * igrab(struct inode *);
1883extern ino_t iunique(struct super_block *, ino_t); 1907extern ino_t iunique(struct super_block *, ino_t);
@@ -1894,6 +1918,8 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
1894 1918
1895extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); 1919extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
1896extern struct inode * iget_locked(struct super_block *, unsigned long); 1920extern struct inode * iget_locked(struct super_block *, unsigned long);
1921extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
1922extern int insert_inode_locked(struct inode *);
1897extern void unlock_new_inode(struct inode *); 1923extern void unlock_new_inode(struct inode *);
1898 1924
1899extern void __iget(struct inode * inode); 1925extern void __iget(struct inode * inode);
@@ -2025,7 +2051,7 @@ extern int page_readlink(struct dentry *, char __user *, int);
2025extern void *page_follow_link_light(struct dentry *, struct nameidata *); 2051extern void *page_follow_link_light(struct dentry *, struct nameidata *);
2026extern void page_put_link(struct dentry *, struct nameidata *, void *); 2052extern void page_put_link(struct dentry *, struct nameidata *, void *);
2027extern int __page_symlink(struct inode *inode, const char *symname, int len, 2053extern int __page_symlink(struct inode *inode, const char *symname, int len,
2028 gfp_t gfp_mask); 2054 int nofs);
2029extern int page_symlink(struct inode *inode, const char *symname, int len); 2055extern int page_symlink(struct inode *inode, const char *symname, int len);
2030extern const struct inode_operations page_symlink_inode_operations; 2056extern const struct inode_operations page_symlink_inode_operations;
2031extern int generic_readlink(struct dentry *, char __user *, int); 2057extern int generic_readlink(struct dentry *, char __user *, int);
@@ -2046,6 +2072,9 @@ extern int vfs_fstat(unsigned int, struct kstat *);
2046 2072
2047extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, 2073extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
2048 unsigned long arg); 2074 unsigned long arg);
2075extern int __generic_block_fiemap(struct inode *inode,
2076 struct fiemap_extent_info *fieinfo, u64 start,
2077 u64 len, get_block_t *get_block);
2049extern int generic_block_fiemap(struct inode *inode, 2078extern int generic_block_fiemap(struct inode *inode,
2050 struct fiemap_extent_info *fieinfo, u64 start, 2079 struct fiemap_extent_info *fieinfo, u64 start,
2051 u64 len, get_block_t *get_block); 2080 u64 len, get_block_t *get_block);