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.h53
1 files changed, 36 insertions, 17 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 001ded4845b4..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
@@ -243,6 +234,8 @@ extern int dir_notify_enable;
243#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 234#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
244#define FIBMAP _IO(0x00,1) /* bmap access */ 235#define FIBMAP _IO(0x00,1) /* bmap access */
245#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 */
246 239
247#define FS_IOC_GETFLAGS _IOR('f', 1, long) 240#define FS_IOC_GETFLAGS _IOR('f', 1, long)
248#define FS_IOC_SETFLAGS _IOW('f', 2, long) 241#define FS_IOC_SETFLAGS _IOW('f', 2, long)
@@ -330,6 +323,15 @@ extern void __init inode_init(void);
330extern void __init inode_init_early(void); 323extern void __init inode_init_early(void);
331extern void __init files_init(unsigned long); 324extern void __init files_init(unsigned long);
332 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
333struct buffer_head; 335struct buffer_head;
334typedef int (get_block_t)(struct inode *inode, sector_t iblock, 336typedef int (get_block_t)(struct inode *inode, sector_t iblock,
335 struct buffer_head *bh_result, int create); 337 struct buffer_head *bh_result, int create);
@@ -423,6 +425,9 @@ enum positive_aop_returns {
423 425
424#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ 426#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */
425#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 */
426 431
427/* 432/*
428 * oh the beauties of C type declarations. 433 * oh the beauties of C type declarations.
@@ -562,6 +567,7 @@ struct address_space {
562struct block_device { 567struct block_device {
563 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 */
564 struct inode * bd_inode; /* will die */ 569 struct inode * bd_inode; /* will die */
570 struct super_block * bd_super;
565 int bd_openers; 571 int bd_openers;
566 struct mutex bd_mutex; /* open/close mutex */ 572 struct mutex bd_mutex; /* open/close mutex */
567 struct semaphore bd_mount_sem; 573 struct semaphore bd_mount_sem;
@@ -587,6 +593,11 @@ struct block_device {
587 * care to not mess up bd_private for that case. 593 * care to not mess up bd_private for that case.
588 */ 594 */
589 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;
590}; 601};
591 602
592/* 603/*
@@ -1130,7 +1141,6 @@ struct super_block {
1130 struct rw_semaphore s_umount; 1141 struct rw_semaphore s_umount;
1131 struct mutex s_lock; 1142 struct mutex s_lock;
1132 int s_count; 1143 int s_count;
1133 int s_syncing;
1134 int s_need_sync_fs; 1144 int s_need_sync_fs;
1135 atomic_t s_active; 1145 atomic_t s_active;
1136#ifdef CONFIG_SECURITY 1146#ifdef CONFIG_SECURITY
@@ -1182,6 +1192,11 @@ struct super_block {
1182 * generic_show_options() 1192 * generic_show_options()
1183 */ 1193 */
1184 char *s_options; 1194 char *s_options;
1195
1196 /*
1197 * storage for asynchronous operations
1198 */
1199 struct list_head s_async_list;
1185}; 1200};
1186 1201
1187extern struct timespec current_fs_time(struct super_block *sb); 1202extern struct timespec current_fs_time(struct super_block *sb);
@@ -1212,7 +1227,6 @@ extern void unlock_super(struct super_block *);
1212/* 1227/*
1213 * VFS helper functions.. 1228 * VFS helper functions..
1214 */ 1229 */
1215extern int vfs_permission(struct nameidata *, int);
1216extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1230extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
1217extern int vfs_mkdir(struct inode *, struct dentry *, int); 1231extern int vfs_mkdir(struct inode *, struct dentry *, int);
1218extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1232extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
@@ -1310,7 +1324,6 @@ struct file_operations {
1310 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);
1311 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);
1312 int (*check_flags)(int); 1326 int (*check_flags)(int);
1313 int (*dir_notify)(struct file *filp, unsigned long arg);
1314 int (*flock) (struct file *, int, struct file_lock *); 1327 int (*flock) (struct file *, int, struct file_lock *);
1315 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);
1316 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);
@@ -1371,8 +1384,8 @@ struct super_operations {
1371 void (*put_super) (struct super_block *); 1384 void (*put_super) (struct super_block *);
1372 void (*write_super) (struct super_block *); 1385 void (*write_super) (struct super_block *);
1373 int (*sync_fs)(struct super_block *sb, int wait); 1386 int (*sync_fs)(struct super_block *sb, int wait);
1374 void (*write_super_lockfs) (struct super_block *); 1387 int (*freeze_fs) (struct super_block *);
1375 void (*unlockfs) (struct super_block *); 1388 int (*unfreeze_fs) (struct super_block *);
1376 int (*statfs) (struct dentry *, struct kstatfs *); 1389 int (*statfs) (struct dentry *, struct kstatfs *);
1377 int (*remount_fs) (struct super_block *, int *, char *); 1390 int (*remount_fs) (struct super_block *, int *, char *);
1378 void (*clear_inode) (struct inode *); 1391 void (*clear_inode) (struct inode *);
@@ -1384,6 +1397,7 @@ struct super_operations {
1384 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);
1385 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);
1386#endif 1399#endif
1400 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1387}; 1401};
1388 1402
1389/* 1403/*
@@ -1829,7 +1843,7 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
1829extern int filemap_fdatawrite_range(struct address_space *mapping, 1843extern int filemap_fdatawrite_range(struct address_space *mapping,
1830 loff_t start, loff_t end); 1844 loff_t start, loff_t end);
1831 1845
1832extern long do_fsync(struct file *file, int datasync); 1846extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync);
1833extern void sync_supers(void); 1847extern void sync_supers(void);
1834extern void sync_filesystems(int wait); 1848extern void sync_filesystems(int wait);
1835extern void __fsync_super(struct super_block *sb); 1849extern void __fsync_super(struct super_block *sb);
@@ -1869,7 +1883,7 @@ extern void free_write_pipe(struct file *);
1869 1883
1870extern struct file *do_filp_open(int dfd, const char *pathname, 1884extern struct file *do_filp_open(int dfd, const char *pathname,
1871 int open_flag, int mode); 1885 int open_flag, int mode);
1872extern int may_open(struct nameidata *, int, int); 1886extern int may_open(struct path *, int, int);
1873 1887
1874extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 1888extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
1875extern struct file * open_exec(const char *); 1889extern struct file * open_exec(const char *);
@@ -1904,6 +1918,8 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
1904 1918
1905extern 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 *);
1906extern 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 *);
1907extern void unlock_new_inode(struct inode *); 1923extern void unlock_new_inode(struct inode *);
1908 1924
1909extern void __iget(struct inode * inode); 1925extern void __iget(struct inode * inode);
@@ -2035,7 +2051,7 @@ extern int page_readlink(struct dentry *, char __user *, int);
2035extern void *page_follow_link_light(struct dentry *, struct nameidata *); 2051extern void *page_follow_link_light(struct dentry *, struct nameidata *);
2036extern void page_put_link(struct dentry *, struct nameidata *, void *); 2052extern void page_put_link(struct dentry *, struct nameidata *, void *);
2037extern int __page_symlink(struct inode *inode, const char *symname, int len, 2053extern int __page_symlink(struct inode *inode, const char *symname, int len,
2038 gfp_t gfp_mask); 2054 int nofs);
2039extern int page_symlink(struct inode *inode, const char *symname, int len); 2055extern int page_symlink(struct inode *inode, const char *symname, int len);
2040extern const struct inode_operations page_symlink_inode_operations; 2056extern const struct inode_operations page_symlink_inode_operations;
2041extern int generic_readlink(struct dentry *, char __user *, int); 2057extern int generic_readlink(struct dentry *, char __user *, int);
@@ -2056,6 +2072,9 @@ extern int vfs_fstat(unsigned int, struct kstat *);
2056 2072
2057extern 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,
2058 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);
2059extern int generic_block_fiemap(struct inode *inode, 2078extern int generic_block_fiemap(struct inode *inode,
2060 struct fiemap_extent_info *fieinfo, u64 start, 2079 struct fiemap_extent_info *fieinfo, u64 start,
2061 u64 len, get_block_t *get_block); 2080 u64 len, get_block_t *get_block);