diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 511fbaabf624..2a815560fda0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -639,7 +639,7 @@ struct inode { | |||
639 | struct hlist_head i_dentry; | 639 | struct hlist_head i_dentry; |
640 | struct rcu_head i_rcu; | 640 | struct rcu_head i_rcu; |
641 | }; | 641 | }; |
642 | u64 i_version; | 642 | atomic64_t i_version; |
643 | atomic_t i_count; | 643 | atomic_t i_count; |
644 | atomic_t i_dio_count; | 644 | atomic_t i_dio_count; |
645 | atomic_t i_writecount; | 645 | atomic_t i_writecount; |
@@ -748,6 +748,11 @@ static inline void inode_lock_nested(struct inode *inode, unsigned subclass) | |||
748 | down_write_nested(&inode->i_rwsem, subclass); | 748 | down_write_nested(&inode->i_rwsem, subclass); |
749 | } | 749 | } |
750 | 750 | ||
751 | static inline void inode_lock_shared_nested(struct inode *inode, unsigned subclass) | ||
752 | { | ||
753 | down_read_nested(&inode->i_rwsem, subclass); | ||
754 | } | ||
755 | |||
751 | void lock_two_nondirectories(struct inode *, struct inode*); | 756 | void lock_two_nondirectories(struct inode *, struct inode*); |
752 | void unlock_two_nondirectories(struct inode *, struct inode*); | 757 | void unlock_two_nondirectories(struct inode *, struct inode*); |
753 | 758 | ||
@@ -1359,7 +1364,7 @@ struct super_block { | |||
1359 | 1364 | ||
1360 | const struct fscrypt_operations *s_cop; | 1365 | const struct fscrypt_operations *s_cop; |
1361 | 1366 | ||
1362 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1367 | struct hlist_bl_head s_roots; /* alternate root dentries for NFS */ |
1363 | struct list_head s_mounts; /* list of mounts; _not_ for fs use */ | 1368 | struct list_head s_mounts; /* list of mounts; _not_ for fs use */ |
1364 | struct block_device *s_bdev; | 1369 | struct block_device *s_bdev; |
1365 | struct backing_dev_info *s_bdi; | 1370 | struct backing_dev_info *s_bdi; |
@@ -1608,6 +1613,10 @@ extern int vfs_whiteout(struct inode *, struct dentry *); | |||
1608 | extern struct dentry *vfs_tmpfile(struct dentry *dentry, umode_t mode, | 1613 | extern struct dentry *vfs_tmpfile(struct dentry *dentry, umode_t mode, |
1609 | int open_flag); | 1614 | int open_flag); |
1610 | 1615 | ||
1616 | int vfs_mkobj(struct dentry *, umode_t, | ||
1617 | int (*f)(struct dentry *, umode_t, void *), | ||
1618 | void *); | ||
1619 | |||
1611 | /* | 1620 | /* |
1612 | * VFS file helper functions. | 1621 | * VFS file helper functions. |
1613 | */ | 1622 | */ |
@@ -1698,7 +1707,7 @@ struct file_operations { | |||
1698 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); | 1707 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); |
1699 | int (*iterate) (struct file *, struct dir_context *); | 1708 | int (*iterate) (struct file *, struct dir_context *); |
1700 | int (*iterate_shared) (struct file *, struct dir_context *); | 1709 | int (*iterate_shared) (struct file *, struct dir_context *); |
1701 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 1710 | __poll_t (*poll) (struct file *, struct poll_table_struct *); |
1702 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 1711 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
1703 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 1712 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
1704 | int (*mmap) (struct file *, struct vm_area_struct *); | 1713 | int (*mmap) (struct file *, struct vm_area_struct *); |
@@ -2036,21 +2045,6 @@ static inline void inode_dec_link_count(struct inode *inode) | |||
2036 | mark_inode_dirty(inode); | 2045 | mark_inode_dirty(inode); |
2037 | } | 2046 | } |
2038 | 2047 | ||
2039 | /** | ||
2040 | * inode_inc_iversion - increments i_version | ||
2041 | * @inode: inode that need to be updated | ||
2042 | * | ||
2043 | * Every time the inode is modified, the i_version field will be incremented. | ||
2044 | * The filesystem has to be mounted with i_version flag | ||
2045 | */ | ||
2046 | |||
2047 | static inline void inode_inc_iversion(struct inode *inode) | ||
2048 | { | ||
2049 | spin_lock(&inode->i_lock); | ||
2050 | inode->i_version++; | ||
2051 | spin_unlock(&inode->i_lock); | ||
2052 | } | ||
2053 | |||
2054 | enum file_time_flags { | 2048 | enum file_time_flags { |
2055 | S_ATIME = 1, | 2049 | S_ATIME = 1, |
2056 | S_MTIME = 2, | 2050 | S_MTIME = 2, |
@@ -2699,7 +2693,6 @@ extern sector_t bmap(struct inode *, sector_t); | |||
2699 | #endif | 2693 | #endif |
2700 | extern int notify_change(struct dentry *, struct iattr *, struct inode **); | 2694 | extern int notify_change(struct dentry *, struct iattr *, struct inode **); |
2701 | extern int inode_permission(struct inode *, int); | 2695 | extern int inode_permission(struct inode *, int); |
2702 | extern int __inode_permission(struct inode *, int); | ||
2703 | extern int generic_permission(struct inode *, int); | 2696 | extern int generic_permission(struct inode *, int); |
2704 | extern int __check_sticky(struct inode *dir, struct inode *inode); | 2697 | extern int __check_sticky(struct inode *dir, struct inode *inode); |
2705 | 2698 | ||
@@ -2992,6 +2985,7 @@ enum { | |||
2992 | }; | 2985 | }; |
2993 | 2986 | ||
2994 | void dio_end_io(struct bio *bio); | 2987 | void dio_end_io(struct bio *bio); |
2988 | void dio_warn_stale_pagecache(struct file *filp); | ||
2995 | 2989 | ||
2996 | ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, | 2990 | ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, |
2997 | struct block_device *bdev, struct iov_iter *iter, | 2991 | struct block_device *bdev, struct iov_iter *iter, |
@@ -3239,6 +3233,8 @@ static inline int kiocb_set_rw_flags(struct kiocb *ki, rwf_t flags) | |||
3239 | ki->ki_flags |= IOCB_DSYNC; | 3233 | ki->ki_flags |= IOCB_DSYNC; |
3240 | if (flags & RWF_SYNC) | 3234 | if (flags & RWF_SYNC) |
3241 | ki->ki_flags |= (IOCB_DSYNC | IOCB_SYNC); | 3235 | ki->ki_flags |= (IOCB_DSYNC | IOCB_SYNC); |
3236 | if (flags & RWF_APPEND) | ||
3237 | ki->ki_flags |= IOCB_APPEND; | ||
3242 | return 0; | 3238 | return 0; |
3243 | } | 3239 | } |
3244 | 3240 | ||