----- Original Message -----
| Hi,
| 
| That looks much better, but why not create & pass a file_ra_state in
| the
| NFS getname function so that you don't have to check for it being
| NULL?
| Since that function always reads everything up until the name it is
| looking for, it is an ideal place to do readahead as the access will
| always be sequential.
| 
| Otherwise, it looks good to me,
| 
| Steve.

Hi,

There isn't a file struct passed in to the nfs get_name function, but
I can do something like the following.  Is this what you mean?

diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c
index a581cd2..70ba891 100644
--- a/fs/gfs2/export.c
+++ b/fs/gfs2/export.c
@@ -99,6 +99,7 @@ static int gfs2_get_name(struct dentry *parent, char *name,
        struct gfs2_holder gh;
        u64 offset = 0;
        int error;
+       struct file_ra_state f_ra = { .start = 0 };
 
        if (!dir)
                return -EINVAL;
@@ -118,7 +119,7 @@ static int gfs2_get_name(struct dentry *parent, char *name,
        if (error)
                return error;
 
-       error = gfs2_dir_read(dir, &offset, &gnfd, get_name_filldir, NULL);
+       error = gfs2_dir_read(dir, &offset, &gnfd, get_name_filldir, &f_ra);
 
        gfs2_glock_dq_uninit(&gh);
 
Regards,

Bob Peterson
Red Hat File Systems

Reply via email to