[4/4] NFS: Switch readdir to using iterate_shared()
diff mbox series

Message ID 20200202225356.995080-5-trond.myklebust@hammerspace.com
State New
Headers show
Series
  • Readdir fixes
Related show

Commit Message

Trond Myklebust Feb. 2, 2020, 10:53 p.m. UTC
Now that the page cache locking is repaired, we should be able to
switch to using iterate_shared() for improved concurrency when
doing readdir().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Benjamin Coddington Feb. 3, 2020, 2:41 p.m. UTC | #1
On 2 Feb 2020, at 17:53, Trond Myklebust wrote:

> Now that the page cache locking is repaired, we should be able to
> switch to using iterate_shared() for improved concurrency when
> doing readdir().
>
> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> ---
>  fs/nfs/dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> index 60387dec9032..803e6fec0266 100644
> --- a/fs/nfs/dir.c
> +++ b/fs/nfs/dir.c
> @@ -58,7 +58,7 @@ static void nfs_readdir_clear_array(struct page*);
>  const struct file_operations nfs_dir_operations = {
>  	.llseek		= nfs_llseek_dir,
>  	.read		= generic_read_dir,
> -	.iterate	= nfs_readdir,
> +	.iterate_shared	= nfs_readdir,
>  	.open		= nfs_opendir,
>  	.release	= nfs_closedir,
>  	.fsync		= nfs_fsync_dir,

Jeez, it makes a lot of sense just to use the page lock.  Wish I could have
thought of that a long time ago.  Thanks for this, we'll send it through
some testing, but it looks good to me.

Reviewed-by: Benjamin Coddington <bcodding@redhat.com>

Ben

Patch
diff mbox series

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 60387dec9032..803e6fec0266 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -58,7 +58,7 @@  static void nfs_readdir_clear_array(struct page*);
 const struct file_operations nfs_dir_operations = {
 	.llseek		= nfs_llseek_dir,
 	.read		= generic_read_dir,
-	.iterate	= nfs_readdir,
+	.iterate_shared	= nfs_readdir,
 	.open		= nfs_opendir,
 	.release	= nfs_closedir,
 	.fsync		= nfs_fsync_dir,