summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2018-03-20 16:43:16 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-04-10 16:06:22 -0400
commitf2c2c552f119db84d85a53a8bd76479f34df02b1 (patch)
treea280fb60144a23f872b3fc3ffae365c4ed6abaa3 /fs
parent912678dbc592db7ad618f383866ad23e43cd51f3 (diff)
NFS: Move delegation recall into the NFSv4 callback for rename_setup()
Move the delegation recall out of the generic code, and into the NFSv4 specific callback. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dir.c4
-rw-r--r--fs/nfs/nfs3proc.c4
-rw-r--r--fs/nfs/nfs4proc.c13
-rw-r--r--fs/nfs/proc.c4
-rw-r--r--fs/nfs/unlink.c5
5 files changed, 17 insertions, 13 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index eb9d782ed674..8001f8c7ad0e 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2020,10 +2020,6 @@ int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
2020 } 2020 }
2021 } 2021 }
2022 2022
2023 NFS_PROTO(old_inode)->return_delegation(old_inode);
2024 if (new_inode != NULL)
2025 NFS_PROTO(new_inode)->return_delegation(new_inode);
2026
2027 task = nfs_async_rename(old_dir, new_dir, old_dentry, new_dentry, NULL); 2023 task = nfs_async_rename(old_dir, new_dir, old_dentry, new_dentry, NULL);
2028 if (IS_ERR(task)) { 2024 if (IS_ERR(task)) {
2029 error = PTR_ERR(task); 2025 error = PTR_ERR(task);
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index f4ead71e4350..08875dc17b52 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -433,7 +433,9 @@ nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
433} 433}
434 434
435static void 435static void
436nfs3_proc_rename_setup(struct rpc_message *msg, struct inode *dir) 436nfs3_proc_rename_setup(struct rpc_message *msg,
437 struct dentry *old_dentry,
438 struct dentry *new_dentry)
437{ 439{
438 msg->rpc_proc = &nfs3_procedures[NFS3PROC_RENAME]; 440 msg->rpc_proc = &nfs3_procedures[NFS3PROC_RENAME];
439} 441}
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 810ebd2f5174..b06a820b570d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4267,14 +4267,21 @@ static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
4267 return 1; 4267 return 1;
4268} 4268}
4269 4269
4270static void nfs4_proc_rename_setup(struct rpc_message *msg, struct inode *dir) 4270static void nfs4_proc_rename_setup(struct rpc_message *msg,
4271 struct dentry *old_dentry,
4272 struct dentry *new_dentry)
4271{ 4273{
4272 struct nfs_server *server = NFS_SERVER(dir);
4273 struct nfs_renameargs *arg = msg->rpc_argp; 4274 struct nfs_renameargs *arg = msg->rpc_argp;
4274 struct nfs_renameres *res = msg->rpc_resp; 4275 struct nfs_renameres *res = msg->rpc_resp;
4276 struct inode *old_inode = d_inode(old_dentry);
4277 struct inode *new_inode = d_inode(new_dentry);
4275 4278
4279 if (old_inode)
4280 nfs4_inode_return_delegation(old_inode);
4281 if (new_inode)
4282 nfs4_inode_return_delegation(new_inode);
4276 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME]; 4283 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME];
4277 res->server = server; 4284 res->server = NFS_SB(old_dentry->d_sb);
4278 nfs4_init_sequence(&arg->seq_args, &res->seq_res, 1); 4285 nfs4_init_sequence(&arg->seq_args, &res->seq_res, 1);
4279} 4286}
4280 4287
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index b2e81a110133..39dc9276b1f6 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -338,7 +338,9 @@ static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir)
338} 338}
339 339
340static void 340static void
341nfs_proc_rename_setup(struct rpc_message *msg, struct inode *dir) 341nfs_proc_rename_setup(struct rpc_message *msg,
342 struct dentry *old_dentry,
343 struct dentry *new_dentry)
342{ 344{
343 msg->rpc_proc = &nfs_procedures[NFSPROC_RENAME]; 345 msg->rpc_proc = &nfs_procedures[NFSPROC_RENAME];
344} 346}
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index 630b4a3c1a93..44f101411422 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -386,7 +386,7 @@ nfs_async_rename(struct inode *old_dir, struct inode *new_dir,
386 386
387 nfs_sb_active(old_dir->i_sb); 387 nfs_sb_active(old_dir->i_sb);
388 388
389 NFS_PROTO(data->old_dir)->rename_setup(&msg, old_dir); 389 NFS_PROTO(data->old_dir)->rename_setup(&msg, old_dentry, new_dentry);
390 390
391 return rpc_run_task(&task_setup_data); 391 return rpc_run_task(&task_setup_data);
392} 392}
@@ -463,9 +463,6 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry)
463 463
464 fileid = NFS_FILEID(d_inode(dentry)); 464 fileid = NFS_FILEID(d_inode(dentry));
465 465
466 /* Return delegation in anticipation of the rename */
467 NFS_PROTO(d_inode(dentry))->return_delegation(d_inode(dentry));
468
469 sdentry = NULL; 466 sdentry = NULL;
470 do { 467 do {
471 int slen; 468 int slen;