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.h42
1 files changed, 27 insertions, 15 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4a853ef6fd35..e2170ee21e18 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
@@ -316,11 +315,21 @@ struct poll_table_struct;
316struct kstatfs; 315struct kstatfs;
317struct vm_area_struct; 316struct vm_area_struct;
318struct vfsmount; 317struct vfsmount;
318struct cred;
319 319
320extern void __init inode_init(void); 320extern void __init inode_init(void);
321extern void __init inode_init_early(void); 321extern void __init inode_init_early(void);
322extern void __init files_init(unsigned long); 322extern void __init files_init(unsigned long);
323 323
324extern struct files_stat_struct files_stat;
325extern int get_max_files(void);
326extern int sysctl_nr_open;
327extern struct inodes_stat_t inodes_stat;
328extern int leases_enable, lease_break_time;
329#ifdef CONFIG_DNOTIFY
330extern int dir_notify_enable;
331#endif
332
324struct buffer_head; 333struct buffer_head;
325typedef int (get_block_t)(struct inode *inode, sector_t iblock, 334typedef int (get_block_t)(struct inode *inode, sector_t iblock,
326 struct buffer_head *bh_result, int create); 335 struct buffer_head *bh_result, int create);
@@ -827,7 +836,7 @@ struct file {
827 fmode_t f_mode; 836 fmode_t f_mode;
828 loff_t f_pos; 837 loff_t f_pos;
829 struct fown_struct f_owner; 838 struct fown_struct f_owner;
830 unsigned int f_uid, f_gid; 839 const struct cred *f_cred;
831 struct file_ra_state f_ra; 840 struct file_ra_state f_ra;
832 841
833 u64 f_version; 842 u64 f_version;
@@ -1194,7 +1203,7 @@ enum {
1194#define has_fs_excl() atomic_read(&current->fs_excl) 1203#define has_fs_excl() atomic_read(&current->fs_excl)
1195 1204
1196#define is_owner_or_cap(inode) \ 1205#define is_owner_or_cap(inode) \
1197 ((current->fsuid == (inode)->i_uid) || capable(CAP_FOWNER)) 1206 ((current_fsuid() == (inode)->i_uid) || capable(CAP_FOWNER))
1198 1207
1199/* not quite ready to be deprecated, but... */ 1208/* not quite ready to be deprecated, but... */
1200extern void lock_super(struct super_block *); 1209extern void lock_super(struct super_block *);
@@ -1203,7 +1212,6 @@ extern void unlock_super(struct super_block *);
1203/* 1212/*
1204 * VFS helper functions.. 1213 * VFS helper functions..
1205 */ 1214 */
1206extern int vfs_permission(struct nameidata *, int);
1207extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1215extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
1208extern int vfs_mkdir(struct inode *, struct dentry *, int); 1216extern int vfs_mkdir(struct inode *, struct dentry *, int);
1209extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1217extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
@@ -1301,7 +1309,6 @@ struct file_operations {
1301 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1309 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1302 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1310 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1303 int (*check_flags)(int); 1311 int (*check_flags)(int);
1304 int (*dir_notify)(struct file *filp, unsigned long arg);
1305 int (*flock) (struct file *, int, struct file_lock *); 1312 int (*flock) (struct file *, int, struct file_lock *);
1306 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1313 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1307 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1314 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
@@ -1674,7 +1681,8 @@ extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
1674extern long do_sys_open(int dfd, const char __user *filename, int flags, 1681extern long do_sys_open(int dfd, const char __user *filename, int flags,
1675 int mode); 1682 int mode);
1676extern struct file *filp_open(const char *, int, int); 1683extern struct file *filp_open(const char *, int, int);
1677extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); 1684extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
1685 const struct cred *);
1678extern int filp_close(struct file *, fl_owner_t id); 1686extern int filp_close(struct file *, fl_owner_t id);
1679extern char * getname(const char __user *); 1687extern char * getname(const char __user *);
1680 1688
@@ -1859,7 +1867,7 @@ extern void free_write_pipe(struct file *);
1859 1867
1860extern struct file *do_filp_open(int dfd, const char *pathname, 1868extern struct file *do_filp_open(int dfd, const char *pathname,
1861 int open_flag, int mode); 1869 int open_flag, int mode);
1862extern int may_open(struct nameidata *, int, int); 1870extern int may_open(struct path *, int, int);
1863 1871
1864extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 1872extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
1865extern struct file * open_exec(const char *); 1873extern struct file * open_exec(const char *);
@@ -1875,7 +1883,9 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
1875 1883
1876extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); 1884extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
1877 1885
1886extern struct inode * inode_init_always(struct super_block *, struct inode *);
1878extern void inode_init_once(struct inode *); 1887extern void inode_init_once(struct inode *);
1888extern void inode_add_to_lists(struct super_block *, struct inode *);
1879extern void iput(struct inode *); 1889extern void iput(struct inode *);
1880extern struct inode * igrab(struct inode *); 1890extern struct inode * igrab(struct inode *);
1881extern ino_t iunique(struct super_block *, ino_t); 1891extern ino_t iunique(struct super_block *, ino_t);
@@ -1892,6 +1902,8 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
1892 1902
1893extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); 1903extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
1894extern struct inode * iget_locked(struct super_block *, unsigned long); 1904extern struct inode * iget_locked(struct super_block *, unsigned long);
1905extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
1906extern int insert_inode_locked(struct inode *);
1895extern void unlock_new_inode(struct inode *); 1907extern void unlock_new_inode(struct inode *);
1896 1908
1897extern void __iget(struct inode * inode); 1909extern void __iget(struct inode * inode);