Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux
[cascardo/linux.git] / fs / nfsd / vfs.c
index 1e757fa..8ff6a00 100644 (file)
@@ -1940,6 +1940,7 @@ struct buffered_dirent {
 };
 
 struct readdir_data {
+       struct dir_context ctx;
        char            *dirent;
        size_t          used;
        int             full;
@@ -1971,13 +1972,15 @@ static int nfsd_buffered_filldir(void *__buf, const char *name, int namlen,
 static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func,
                                    struct readdir_cd *cdp, loff_t *offsetp)
 {
-       struct readdir_data buf;
        struct buffered_dirent *de;
        int host_err;
        int size;
        loff_t offset;
+       struct readdir_data buf = {
+               .ctx.actor = nfsd_buffered_filldir,
+               .dirent = (void *)__get_free_page(GFP_KERNEL)
+       };
 
-       buf.dirent = (void *)__get_free_page(GFP_KERNEL);
        if (!buf.dirent)
                return nfserrno(-ENOMEM);
 
@@ -1991,7 +1994,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func,
                buf.used = 0;
                buf.full = 0;
 
-               host_err = vfs_readdir(file, nfsd_buffered_filldir, &buf);
+               host_err = iterate_dir(file, &buf.ctx);
                if (buf.full)
                        host_err = 0;