]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - fs/nfs/nfs3proc.c
NFSv4.1: Fix exclusive create
[mirror_ubuntu-jammy-kernel.git] / fs / nfs / nfs3proc.c
index 49f848fd1f04779108d86a5eee618e21d11304e6..cc04d988db7c4585eee965fb7755a89c2746fdd4 100644 (file)
@@ -383,11 +383,11 @@ out:
 }
 
 static int
-nfs3_proc_remove(struct inode *dir, const struct qstr *name)
+nfs3_proc_remove(struct inode *dir, struct dentry *dentry)
 {
        struct nfs_removeargs arg = {
                .fh = NFS_FH(dir),
-               .name = *name,
+               .name = dentry->d_name,
        };
        struct nfs_removeres res;
        struct rpc_message msg = {
@@ -397,7 +397,7 @@ nfs3_proc_remove(struct inode *dir, const struct qstr *name)
        };
        int status = -ENOMEM;
 
-       dprintk("NFS call  remove %s\n", name->name);
+       dprintk("NFS call  remove %pd2\n", dentry);
        res.dir_attr = nfs_alloc_fattr();
        if (res.dir_attr == NULL)
                goto out;
@@ -411,7 +411,7 @@ out:
 }
 
 static void
-nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
+nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dentry)
 {
        msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
 }
@@ -433,7 +433,9 @@ nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
 }
 
 static void
-nfs3_proc_rename_setup(struct rpc_message *msg, struct inode *dir)
+nfs3_proc_rename_setup(struct rpc_message *msg,
+               struct dentry *old_dentry,
+               struct dentry *new_dentry)
 {
        msg->rpc_proc = &nfs3_procedures[NFS3PROC_RENAME];
 }
@@ -873,7 +875,7 @@ static void nfs3_nlm_release_call(void *data)
        }
 }
 
-const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = {
+static const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = {
        .nlmclnt_alloc_call = nfs3_nlm_alloc_call,
        .nlmclnt_unlock_prepare = nfs3_nlm_unlock_prepare,
        .nlmclnt_release_call = nfs3_nlm_release_call,
@@ -908,12 +910,6 @@ static int nfs3_have_delegation(struct inode *inode, fmode_t flags)
        return 0;
 }
 
-static int nfs3_return_delegation(struct inode *inode)
-{
-       nfs_wb_all(inode);
-       return 0;
-}
-
 static const struct inode_operations nfs3_dir_inode_operations = {
        .create         = nfs_create,
        .lookup         = nfs_lookup,
@@ -990,7 +986,6 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
        .clear_acl_cache = forget_all_cached_acls,
        .close_context  = nfs_close_context,
        .have_delegation = nfs3_have_delegation,
-       .return_delegation = nfs3_return_delegation,
        .alloc_client   = nfs_alloc_client,
        .init_client    = nfs_init_client,
        .free_client    = nfs_free_client,