Merge branch 'linux-linaro-lsk-v3.10' into linux-linaro-lsk-v3.10-android
[firefly-linux-kernel-4.4.55.git] / fs / nfsd / vfs.c
index d9b298cbfe5c25551c08ff99c1150fa00f9ad946..11224fa5ff25a3e349efe257c2ae36fce88e84b3 100644 (file)
@@ -508,6 +508,9 @@ set_nfsv4_acl_one(struct dentry *dentry, struct posix_acl *pacl, char *key)
        char *buf = NULL;
        int error = 0;
 
+       if (!pacl)
+               return vfs_setxattr(dentry, key, NULL, 0, 0);
+
        buflen = posix_acl_xattr_size(pacl->a_count);
        buf = kmalloc(buflen, GFP_KERNEL);
        error = -ENOMEM;
@@ -1947,6 +1950,7 @@ struct buffered_dirent {
 };
 
 struct readdir_data {
+       struct dir_context ctx;
        char            *dirent;
        size_t          used;
        int             full;
@@ -1978,13 +1982,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);
 
@@ -1998,7 +2004,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;