staging: erofs: no need to take page lock in readdir
PATCH 1/2 staging: erofs: no need to take page lock in readdir
VFS will take inode_lock for readdir, therefore no need to take page lock in readdir at all just as the majority of other generic filesystems.
--- drivers/staging/erofs/dir.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/erofs/dir.c +0 -2
@@ -98,7 +98,6 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)if (IS_ERR (dentry_page))continue ; -lock_page (dentry_page); de = (struct erofs_dirent *)kmap (dentry_page); nameoff =le16_to_cpu (de->nameoff);
@@ -128,7 +127,6 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx) skip_this:kunmap (dentry_page); -unlock_page (dentry_page);put_page (dentry_page); ctx->pos =blknr_to_addr (i) + ofs;
Signature · 1 line
2.14.4
PATCH 2/2 staging: erofs: switch to ->iterate_shared()
After commit 6192269444eb ("introduce a parallel variant of ->iterate()"), readdir can be done without taking exclusive inode lock of course.
--- drivers/staging/erofs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/erofs/dir.c +1 -1
@@ -142,6 +142,6 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)const struct file_operations erofs_dir_fops = { .llseek = generic_file_llseek, .read = generic_read_dir, - .iterate = erofs_readdir, + .iterate_shared = erofs_readdir, };
Signature · 1 line
2.14.4
Re: [PATCH 2/2] staging: erofs: switch to ->iterate_shared()
Quoted 4 lines · Gao Xiang
After commit
6192269444eb("introduce a parallel variant of ->iterate()"), readdir can be done without taking exclusive inode lock of course.Signed-off-by Gao Xiang <gaoxiang25 at huawei.com>
Thanks,
Re: [PATCH 2/2] staging: erofs: switch to ->iterate_shared()
Quoted 7 lines · Chao Yu
Quoted 4 lines · Gao Xiang
After commit
6192269444eb("introduce a parallel variant of ->iterate()"), readdir can be done without taking exclusive inode lock of course.Signed-off-by Gao Xiang <gaoxiang25 at huawei.com>Reviewed-by Chao Yu <yuchao0 at huawei.com>
Thanks for review :)
Quoted 3 lines
Thanks,
Quoted 5 lines · Gao Xiang
VFS will take
inode_lockfor readdir, therefore no need to take page lock in readdir at all just as the majority of other generic filesystems.Signed-off-by Gao Xiang <gaoxiang25 at huawei.com>
Thanks,