diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index e0b77c5af9..cc35b6ac77 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -104,6 +104,10 @@ extern int dir_notify_enable; | |||
104 | #define MS_MOVE 8192 | 104 | #define MS_MOVE 8192 |
105 | #define MS_REC 16384 | 105 | #define MS_REC 16384 |
106 | #define MS_VERBOSE 32768 | 106 | #define MS_VERBOSE 32768 |
107 | #define MS_UNBINDABLE (1<<17) /* change to unbindable */ | ||
108 | #define MS_PRIVATE (1<<18) /* change to private */ | ||
109 | #define MS_SLAVE (1<<19) /* change to slave */ | ||
110 | #define MS_SHARED (1<<20) /* change to shared */ | ||
107 | #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ | 111 | #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ |
108 | #define MS_ACTIVE (1<<30) | 112 | #define MS_ACTIVE (1<<30) |
109 | #define MS_NOUSER (1<<31) | 113 | #define MS_NOUSER (1<<31) |
@@ -264,6 +268,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
264 | #define ATTR_ATTR_FLAG 1024 | 268 | #define ATTR_ATTR_FLAG 1024 |
265 | #define ATTR_KILL_SUID 2048 | 269 | #define ATTR_KILL_SUID 2048 |
266 | #define ATTR_KILL_SGID 4096 | 270 | #define ATTR_KILL_SGID 4096 |
271 | #define ATTR_FILE 8192 | ||
267 | 272 | ||
268 | /* | 273 | /* |
269 | * This is the Inode Attributes structure, used for notify_change(). It | 274 | * This is the Inode Attributes structure, used for notify_change(). It |
@@ -283,6 +288,13 @@ struct iattr { | |||
283 | struct timespec ia_atime; | 288 | struct timespec ia_atime; |
284 | struct timespec ia_mtime; | 289 | struct timespec ia_mtime; |
285 | struct timespec ia_ctime; | 290 | struct timespec ia_ctime; |
291 | |||
292 | /* | ||
293 | * Not an attribute, but an auxilary info for filesystems wanting to | ||
294 | * implement an ftruncate() like method. NOTE: filesystem should | ||
295 | * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL). | ||
296 | */ | ||
297 | struct file *ia_file; | ||
286 | }; | 298 | }; |
287 | 299 | ||
288 | /* | 300 | /* |
@@ -320,7 +332,7 @@ struct address_space_operations { | |||
320 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 332 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
321 | sector_t (*bmap)(struct address_space *, sector_t); | 333 | sector_t (*bmap)(struct address_space *, sector_t); |
322 | int (*invalidatepage) (struct page *, unsigned long); | 334 | int (*invalidatepage) (struct page *, unsigned long); |
323 | int (*releasepage) (struct page *, int); | 335 | int (*releasepage) (struct page *, gfp_t); |
324 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 336 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
325 | loff_t offset, unsigned long nr_segs); | 337 | loff_t offset, unsigned long nr_segs); |
326 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 338 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
@@ -574,7 +586,14 @@ struct file_ra_state { | |||
574 | #define RA_FLAG_INCACHE 0x02 /* file is already in cache */ | 586 | #define RA_FLAG_INCACHE 0x02 /* file is already in cache */ |
575 | 587 | ||
576 | struct file { | 588 | struct file { |
577 | struct list_head f_list; | 589 | /* |
590 | * fu_list becomes invalid after file_free is called and queued via | ||
591 | * fu_rcuhead for RCU freeing | ||
592 | */ | ||
593 | union { | ||
594 | struct list_head fu_list; | ||
595 | struct rcu_head fu_rcuhead; | ||
596 | } f_u; | ||
578 | struct dentry *f_dentry; | 597 | struct dentry *f_dentry; |
579 | struct vfsmount *f_vfsmnt; | 598 | struct vfsmount *f_vfsmnt; |
580 | struct file_operations *f_op; | 599 | struct file_operations *f_op; |
@@ -598,7 +617,6 @@ struct file { | |||
598 | spinlock_t f_ep_lock; | 617 | spinlock_t f_ep_lock; |
599 | #endif /* #ifdef CONFIG_EPOLL */ | 618 | #endif /* #ifdef CONFIG_EPOLL */ |
600 | struct address_space *f_mapping; | 619 | struct address_space *f_mapping; |
601 | struct rcu_head f_rcuhead; | ||
602 | }; | 620 | }; |
603 | extern spinlock_t files_lock; | 621 | extern spinlock_t files_lock; |
604 | #define file_list_lock() spin_lock(&files_lock); | 622 | #define file_list_lock() spin_lock(&files_lock); |
@@ -856,6 +874,7 @@ static inline void unlock_super(struct super_block * sb) | |||
856 | /* | 874 | /* |
857 | * VFS helper functions.. | 875 | * VFS helper functions.. |
858 | */ | 876 | */ |
877 | extern int vfs_permission(struct nameidata *, int); | ||
859 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); | 878 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); |
860 | extern int vfs_mkdir(struct inode *, struct dentry *, int); | 879 | extern int vfs_mkdir(struct inode *, struct dentry *, int); |
861 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); | 880 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); |
@@ -871,6 +890,11 @@ extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct de | |||
871 | extern void dentry_unhash(struct dentry *dentry); | 890 | extern void dentry_unhash(struct dentry *dentry); |
872 | 891 | ||
873 | /* | 892 | /* |
893 | * VFS file helper functions. | ||
894 | */ | ||
895 | extern int file_permission(struct file *, int); | ||
896 | |||
897 | /* | ||
874 | * File types | 898 | * File types |
875 | * | 899 | * |
876 | * NOTE! These match bits 12..15 of stat.st_mode | 900 | * NOTE! These match bits 12..15 of stat.st_mode |
@@ -1082,6 +1106,8 @@ int sync_inode(struct inode *inode, struct writeback_control *wbc); | |||
1082 | * @get_name: find the name for a given inode in a given directory | 1106 | * @get_name: find the name for a given inode in a given directory |
1083 | * @get_parent: find the parent of a given directory | 1107 | * @get_parent: find the parent of a given directory |
1084 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | 1108 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment |
1109 | * @find_exported_dentry: | ||
1110 | * set by the exporting module to a standard helper function. | ||
1085 | * | 1111 | * |
1086 | * Description: | 1112 | * Description: |
1087 | * The export_operations structure provides a means for nfsd to communicate | 1113 | * The export_operations structure provides a means for nfsd to communicate |
@@ -1233,7 +1259,12 @@ extern int unregister_filesystem(struct file_system_type *); | |||
1233 | extern struct vfsmount *kern_mount(struct file_system_type *); | 1259 | extern struct vfsmount *kern_mount(struct file_system_type *); |
1234 | extern int may_umount_tree(struct vfsmount *); | 1260 | extern int may_umount_tree(struct vfsmount *); |
1235 | extern int may_umount(struct vfsmount *); | 1261 | extern int may_umount(struct vfsmount *); |
1262 | extern void umount_tree(struct vfsmount *, int, struct list_head *); | ||
1263 | extern void release_mounts(struct list_head *); | ||
1236 | extern long do_mount(char *, char *, char *, unsigned long, void *); | 1264 | extern long do_mount(char *, char *, char *, unsigned long, void *); |
1265 | extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); | ||
1266 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | ||
1267 | struct vfsmount *); | ||
1237 | 1268 | ||
1238 | extern int vfs_statfs(struct super_block *, struct kstatfs *); | 1269 | extern int vfs_statfs(struct super_block *, struct kstatfs *); |
1239 | 1270 | ||
@@ -1282,7 +1313,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1282 | 1313 | ||
1283 | /* fs/open.c */ | 1314 | /* fs/open.c */ |
1284 | 1315 | ||
1285 | extern int do_truncate(struct dentry *, loff_t start); | 1316 | extern int do_truncate(struct dentry *, loff_t start, struct file *filp); |
1286 | extern long do_sys_open(const char __user *filename, int flags, int mode); | 1317 | extern long do_sys_open(const char __user *filename, int flags, int mode); |
1287 | extern struct file *filp_open(const char *, int, int); | 1318 | extern struct file *filp_open(const char *, int, int); |
1288 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | 1319 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); |