nfs_open_context doesn't need struct path either
[pandora-kernel.git] / fs / nfs / dir.c
index 424e477..a0693f3 100644 (file)
@@ -512,12 +512,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en
                                struct page **xdr_pages, struct page *page, unsigned int buflen)
 {
        struct xdr_stream stream;
-       struct xdr_buf buf = {
-               .pages = xdr_pages,
-               .page_len = buflen,
-               .buflen = buflen,
-               .len = buflen,
-       };
+       struct xdr_buf buf;
        struct page *scratch;
        struct nfs_cache_array *array;
        unsigned int count = 0;
@@ -527,7 +522,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en
        if (scratch == NULL)
                return -ENOMEM;
 
-       xdr_init_decode(&stream, &buf, NULL);
+       xdr_init_decode_pages(&stream, &buf, xdr_pages, buflen);
        xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE);
 
        do {
@@ -1350,10 +1345,6 @@ static int is_atomic_open(struct nameidata *nd)
 
 static struct nfs_open_context *nameidata_to_nfs_open_context(struct dentry *dentry, struct nameidata *nd)
 {
-       struct path path = {
-               .mnt = nd->path.mnt,
-               .dentry = dentry,
-       };
        struct nfs_open_context *ctx;
        struct rpc_cred *cred;
        fmode_t fmode = nd->intent.open.flags & (FMODE_READ | FMODE_WRITE | FMODE_EXEC);
@@ -1361,7 +1352,7 @@ static struct nfs_open_context *nameidata_to_nfs_open_context(struct dentry *den
        cred = rpc_lookup_cred();
        if (IS_ERR(cred))
                return ERR_CAST(cred);
-       ctx = alloc_nfs_open_context(&path, cred, fmode);
+       ctx = alloc_nfs_open_context(dentry, cred, fmode);
        put_rpccred(cred);
        if (ctx == NULL)
                return ERR_PTR(-ENOMEM);
@@ -1381,13 +1372,13 @@ static int nfs_intent_set_file(struct nameidata *nd, struct nfs_open_context *ct
 
        /* If the open_intent is for execute, we have an extra check to make */
        if (ctx->mode & FMODE_EXEC) {
-               ret = nfs_may_open(ctx->path.dentry->d_inode,
+               ret = nfs_may_open(ctx->dentry->d_inode,
                                ctx->cred,
                                nd->intent.open.flags);
                if (ret < 0)
                        goto out;
        }
-       filp = lookup_instantiate_filp(nd, ctx->path.dentry, do_open);
+       filp = lookup_instantiate_filp(nd, ctx->dentry, do_open);
        if (IS_ERR(filp))
                ret = PTR_ERR(filp);
        else
@@ -1468,8 +1459,8 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
        res = d_add_unique(dentry, inode);
        nfs_unblock_sillyrename(dentry->d_parent);
        if (res != NULL) {
-               dput(ctx->path.dentry);
-               ctx->path.dentry = dget(res);
+               dput(ctx->dentry);
+               ctx->dentry = dget(res);
                dentry = res;
        }
        err = nfs_intent_set_file(nd, ctx);
@@ -2278,12 +2269,12 @@ int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags)
        return nfs_do_access(inode, cred, nfs_open_permission_mask(openflags));
 }
 
-int nfs_permission(struct inode *inode, int mask, unsigned int flags)
+int nfs_permission(struct inode *inode, int mask)
 {
        struct rpc_cred *cred;
        int res = 0;
 
-       if (flags & IPERM_FLAG_RCU)
+       if (mask & MAY_NOT_BLOCK)
                return -ECHILD;
 
        nfs_inc_stats(inode, NFSIOS_VFSACCESS);
@@ -2333,7 +2324,7 @@ out:
 out_notsup:
        res = nfs_revalidate_inode(NFS_SERVER(inode), inode);
        if (res == 0)
-               res = generic_permission(inode, mask, flags, NULL);
+               res = generic_permission(inode, mask);
        goto out;
 }