提交 ae05327a 编写于 作者: A Al Viro

ext4: switch to ->iterate_shared()

Note that we need relax_dir() equivalent for directories
locked shared.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 9717a91b
...@@ -266,7 +266,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx) ...@@ -266,7 +266,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
ctx->pos += ext4_rec_len_from_disk(de->rec_len, ctx->pos += ext4_rec_len_from_disk(de->rec_len,
sb->s_blocksize); sb->s_blocksize);
} }
if ((ctx->pos < inode->i_size) && !dir_relax(inode)) if ((ctx->pos < inode->i_size) && !dir_relax_shared(inode))
goto done; goto done;
brelse(bh); brelse(bh);
bh = NULL; bh = NULL;
...@@ -644,7 +644,7 @@ int ext4_check_all_de(struct inode *dir, struct buffer_head *bh, void *buf, ...@@ -644,7 +644,7 @@ int ext4_check_all_de(struct inode *dir, struct buffer_head *bh, void *buf,
const struct file_operations ext4_dir_operations = { const struct file_operations ext4_dir_operations = {
.llseek = ext4_dir_llseek, .llseek = ext4_dir_llseek,
.read = generic_read_dir, .read = generic_read_dir,
.iterate = ext4_readdir, .iterate_shared = ext4_readdir,
.unlocked_ioctl = ext4_ioctl, .unlocked_ioctl = ext4_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = ext4_compat_ioctl, .compat_ioctl = ext4_compat_ioctl,
......
...@@ -3134,6 +3134,13 @@ static inline bool dir_relax(struct inode *inode) ...@@ -3134,6 +3134,13 @@ static inline bool dir_relax(struct inode *inode)
return !IS_DEADDIR(inode); return !IS_DEADDIR(inode);
} }
static inline bool dir_relax_shared(struct inode *inode)
{
inode_unlock_shared(inode);
inode_lock_shared(inode);
return !IS_DEADDIR(inode);
}
extern bool path_noexec(const struct path *path); extern bool path_noexec(const struct path *path);
extern void inode_nohighmem(struct inode *inode); extern void inode_nohighmem(struct inode *inode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册