diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7d2e893ec3d1..4e686a099465 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -769,7 +769,6 @@ struct file { | |||
769 | } f_u; | 769 | } f_u; |
770 | struct path f_path; | 770 | struct path f_path; |
771 | #define f_dentry f_path.dentry | 771 | #define f_dentry f_path.dentry |
772 | #define f_vfsmnt f_path.mnt | ||
773 | const struct file_operations *f_op; | 772 | const struct file_operations *f_op; |
774 | 773 | ||
775 | /* | 774 | /* |
@@ -1807,7 +1806,6 @@ struct file_system_type { | |||
1807 | #define FS_HAS_SUBTYPE 4 | 1806 | #define FS_HAS_SUBTYPE 4 |
1808 | #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ | 1807 | #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ |
1809 | #define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */ | 1808 | #define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */ |
1810 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ | ||
1811 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ | 1809 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ |
1812 | struct dentry *(*mount) (struct file_system_type *, int, | 1810 | struct dentry *(*mount) (struct file_system_type *, int, |
1813 | const char *, void *); | 1811 | const char *, void *); |
@@ -2217,6 +2215,11 @@ static inline bool execute_ok(struct inode *inode) | |||
2217 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); | 2215 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); |
2218 | } | 2216 | } |
2219 | 2217 | ||
2218 | static inline struct inode *file_inode(struct file *f) | ||
2219 | { | ||
2220 | return f->f_path.dentry->d_inode; | ||
2221 | } | ||
2222 | |||
2220 | /* | 2223 | /* |
2221 | * get_write_access() gets write permission for a file. | 2224 | * get_write_access() gets write permission for a file. |
2222 | * put_write_access() releases this write permission. | 2225 | * put_write_access() releases this write permission. |
@@ -2239,7 +2242,7 @@ static inline int get_write_access(struct inode *inode) | |||
2239 | } | 2242 | } |
2240 | static inline int deny_write_access(struct file *file) | 2243 | static inline int deny_write_access(struct file *file) |
2241 | { | 2244 | { |
2242 | struct inode *inode = file->f_path.dentry->d_inode; | 2245 | struct inode *inode = file_inode(file); |
2243 | return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; | 2246 | return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; |
2244 | } | 2247 | } |
2245 | static inline void put_write_access(struct inode * inode) | 2248 | static inline void put_write_access(struct inode * inode) |
@@ -2249,7 +2252,7 @@ static inline void put_write_access(struct inode * inode) | |||
2249 | static inline void allow_write_access(struct file *file) | 2252 | static inline void allow_write_access(struct file *file) |
2250 | { | 2253 | { |
2251 | if (file) | 2254 | if (file) |
2252 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | 2255 | atomic_inc(&file_inode(file)->i_writecount); |
2253 | } | 2256 | } |
2254 | #ifdef CONFIG_IMA | 2257 | #ifdef CONFIG_IMA |
2255 | static inline void i_readcount_dec(struct inode *inode) | 2258 | static inline void i_readcount_dec(struct inode *inode) |
@@ -2274,6 +2277,7 @@ static inline void i_readcount_inc(struct inode *inode) | |||
2274 | extern int do_pipe_flags(int *, int); | 2277 | extern int do_pipe_flags(int *, int); |
2275 | 2278 | ||
2276 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); | 2279 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
2280 | extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t); | ||
2277 | extern struct file * open_exec(const char *); | 2281 | extern struct file * open_exec(const char *); |
2278 | 2282 | ||
2279 | /* fs/dcache.c -- generic fs support functions */ | 2283 | /* fs/dcache.c -- generic fs support functions */ |
@@ -2463,7 +2467,7 @@ extern int page_symlink(struct inode *inode, const char *symname, int len); | |||
2463 | extern const struct inode_operations page_symlink_inode_operations; | 2467 | extern const struct inode_operations page_symlink_inode_operations; |
2464 | extern int generic_readlink(struct dentry *, char __user *, int); | 2468 | extern int generic_readlink(struct dentry *, char __user *, int); |
2465 | extern void generic_fillattr(struct inode *, struct kstat *); | 2469 | extern void generic_fillattr(struct inode *, struct kstat *); |
2466 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 2470 | extern int vfs_getattr(struct path *, struct kstat *); |
2467 | void __inode_add_bytes(struct inode *inode, loff_t bytes); | 2471 | void __inode_add_bytes(struct inode *inode, loff_t bytes); |
2468 | void inode_add_bytes(struct inode *inode, loff_t bytes); | 2472 | void inode_add_bytes(struct inode *inode, loff_t bytes); |
2469 | void inode_sub_bytes(struct inode *inode, loff_t bytes); | 2473 | void inode_sub_bytes(struct inode *inode, loff_t bytes); |