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.h14
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
2218static 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}
2240static inline int deny_write_access(struct file *file) 2243static 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}
2245static inline void put_write_access(struct inode * inode) 2248static inline void put_write_access(struct inode * inode)
@@ -2249,7 +2252,7 @@ static inline void put_write_access(struct inode * inode)
2249static inline void allow_write_access(struct file *file) 2252static 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
2255static inline void i_readcount_dec(struct inode *inode) 2258static inline void i_readcount_dec(struct inode *inode)
@@ -2274,6 +2277,7 @@ static inline void i_readcount_inc(struct inode *inode)
2274extern int do_pipe_flags(int *, int); 2277extern int do_pipe_flags(int *, int);
2275 2278
2276extern int kernel_read(struct file *, loff_t, char *, unsigned long); 2279extern int kernel_read(struct file *, loff_t, char *, unsigned long);
2280extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t);
2277extern struct file * open_exec(const char *); 2281extern 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);
2463extern const struct inode_operations page_symlink_inode_operations; 2467extern const struct inode_operations page_symlink_inode_operations;
2464extern int generic_readlink(struct dentry *, char __user *, int); 2468extern int generic_readlink(struct dentry *, char __user *, int);
2465extern void generic_fillattr(struct inode *, struct kstat *); 2469extern void generic_fillattr(struct inode *, struct kstat *);
2466extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 2470extern int vfs_getattr(struct path *, struct kstat *);
2467void __inode_add_bytes(struct inode *inode, loff_t bytes); 2471void __inode_add_bytes(struct inode *inode, loff_t bytes);
2468void inode_add_bytes(struct inode *inode, loff_t bytes); 2472void inode_add_bytes(struct inode *inode, loff_t bytes);
2469void inode_sub_bytes(struct inode *inode, loff_t bytes); 2473void inode_sub_bytes(struct inode *inode, loff_t bytes);