diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-12 20:36:01 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-12 20:36:01 -0400 |
commit | ae05327a00fd47c34dfe25294b359a3f3fef96e8 (patch) | |
tree | edcaac0eda8abcfaad9e9bd2b6ea72dd7306d374 | |
parent | 9717a91b01feda644f45fd63624a641385ef8f2d (diff) |
ext4: switch to ->iterate_shared()
Note that we need relax_dir() equivalent for directories
locked shared.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/ext4/dir.c | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 561d7308b393..5d00bf060254 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -266,7 +266,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx) | |||
266 | ctx->pos += ext4_rec_len_from_disk(de->rec_len, | 266 | ctx->pos += ext4_rec_len_from_disk(de->rec_len, |
267 | sb->s_blocksize); | 267 | sb->s_blocksize); |
268 | } | 268 | } |
269 | if ((ctx->pos < inode->i_size) && !dir_relax(inode)) | 269 | if ((ctx->pos < inode->i_size) && !dir_relax_shared(inode)) |
270 | goto done; | 270 | goto done; |
271 | brelse(bh); | 271 | brelse(bh); |
272 | bh = NULL; | 272 | bh = NULL; |
@@ -644,7 +644,7 @@ int ext4_check_all_de(struct inode *dir, struct buffer_head *bh, void *buf, | |||
644 | const struct file_operations ext4_dir_operations = { | 644 | const struct file_operations ext4_dir_operations = { |
645 | .llseek = ext4_dir_llseek, | 645 | .llseek = ext4_dir_llseek, |
646 | .read = generic_read_dir, | 646 | .read = generic_read_dir, |
647 | .iterate = ext4_readdir, | 647 | .iterate_shared = ext4_readdir, |
648 | .unlocked_ioctl = ext4_ioctl, | 648 | .unlocked_ioctl = ext4_ioctl, |
649 | #ifdef CONFIG_COMPAT | 649 | #ifdef CONFIG_COMPAT |
650 | .compat_ioctl = ext4_compat_ioctl, | 650 | .compat_ioctl = ext4_compat_ioctl, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3dc0258a2b64..e87245ac6941 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -3134,6 +3134,13 @@ static inline bool dir_relax(struct inode *inode) | |||
3134 | return !IS_DEADDIR(inode); | 3134 | return !IS_DEADDIR(inode); |
3135 | } | 3135 | } |
3136 | 3136 | ||
3137 | static inline bool dir_relax_shared(struct inode *inode) | ||
3138 | { | ||
3139 | inode_unlock_shared(inode); | ||
3140 | inode_lock_shared(inode); | ||
3141 | return !IS_DEADDIR(inode); | ||
3142 | } | ||
3143 | |||
3137 | extern bool path_noexec(const struct path *path); | 3144 | extern bool path_noexec(const struct path *path); |
3138 | extern void inode_nohighmem(struct inode *inode); | 3145 | extern void inode_nohighmem(struct inode *inode); |
3139 | 3146 | ||