aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-03-19 14:54:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-21 09:31:46 -0400
commit34e137cc7e3b63c254875e59cd48dcbe6757fe6c (patch)
treeea509e7f715bcbf2fd3541062063348f547e6c6c
parentea7c330362257c072791aeaf03bae2cebf9fb984 (diff)
NFS: Remove nfs4_setup_sequence from generic unlink code
This is an NFS v4 specific operation, so it belongs in the NFS v4 code and not the generic client. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs3proc.c6
-rw-r--r--fs/nfs/nfs4proc.c11
-rw-r--r--fs/nfs/proc.c6
-rw-r--r--fs/nfs/unlink.c20
-rw-r--r--include/linux/nfs_xdr.h10
5 files changed, 34 insertions, 19 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 9d9b239329dc..7f3f957f677c 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -428,6 +428,11 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
428 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE]; 428 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
429} 429}
430 430
431static void nfs3_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
432{
433 rpc_call_start(task);
434}
435
431static int 436static int
432nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir) 437nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
433{ 438{
@@ -874,6 +879,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
874 .create = nfs3_proc_create, 879 .create = nfs3_proc_create,
875 .remove = nfs3_proc_remove, 880 .remove = nfs3_proc_remove,
876 .unlink_setup = nfs3_proc_unlink_setup, 881 .unlink_setup = nfs3_proc_unlink_setup,
882 .unlink_rpc_prepare = nfs3_proc_unlink_rpc_prepare,
877 .unlink_done = nfs3_proc_unlink_done, 883 .unlink_done = nfs3_proc_unlink_done,
878 .rename = nfs3_proc_rename, 884 .rename = nfs3_proc_rename,
879 .rename_setup = nfs3_proc_rename_setup, 885 .rename_setup = nfs3_proc_rename_setup,
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 915385fcf532..9c247fa7915a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2779,6 +2779,16 @@ static void nfs4_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
2779 nfs41_init_sequence(&args->seq_args, &res->seq_res, 1); 2779 nfs41_init_sequence(&args->seq_args, &res->seq_res, 1);
2780} 2780}
2781 2781
2782static void nfs4_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
2783{
2784 if (nfs4_setup_sequence(NFS_SERVER(data->dir),
2785 &data->args.seq_args,
2786 &data->res.seq_res,
2787 task))
2788 return;
2789 rpc_call_start(task);
2790}
2791
2782static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir) 2792static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
2783{ 2793{
2784 struct nfs_removeres *res = task->tk_msg.rpc_resp; 2794 struct nfs_removeres *res = task->tk_msg.rpc_resp;
@@ -6451,6 +6461,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
6451 .create = nfs4_proc_create, 6461 .create = nfs4_proc_create,
6452 .remove = nfs4_proc_remove, 6462 .remove = nfs4_proc_remove,
6453 .unlink_setup = nfs4_proc_unlink_setup, 6463 .unlink_setup = nfs4_proc_unlink_setup,
6464 .unlink_rpc_prepare = nfs4_proc_unlink_rpc_prepare,
6454 .unlink_done = nfs4_proc_unlink_done, 6465 .unlink_done = nfs4_proc_unlink_done,
6455 .rename = nfs4_proc_rename, 6466 .rename = nfs4_proc_rename,
6456 .rename_setup = nfs4_proc_rename_setup, 6467 .rename_setup = nfs4_proc_rename_setup,
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index a8df70742d00..528b9a2fae05 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -358,6 +358,11 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
358 msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE]; 358 msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE];
359} 359}
360 360
361static void nfs_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
362{
363 rpc_call_start(task);
364}
365
361static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir) 366static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir)
362{ 367{
363 if (nfs_async_handle_expired_key(task)) 368 if (nfs_async_handle_expired_key(task))
@@ -731,6 +736,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
731 .create = nfs_proc_create, 736 .create = nfs_proc_create,
732 .remove = nfs_proc_remove, 737 .remove = nfs_proc_remove,
733 .unlink_setup = nfs_proc_unlink_setup, 738 .unlink_setup = nfs_proc_unlink_setup,
739 .unlink_rpc_prepare = nfs_proc_unlink_rpc_prepare,
734 .unlink_done = nfs_proc_unlink_done, 740 .unlink_done = nfs_proc_unlink_done,
735 .rename = nfs_proc_rename, 741 .rename = nfs_proc_rename,
736 .rename_setup = nfs_proc_rename_setup, 742 .rename_setup = nfs_proc_rename_setup,
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index fae71c9f5050..9c5a7980e244 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -20,15 +20,6 @@
20#include "iostat.h" 20#include "iostat.h"
21#include "delegation.h" 21#include "delegation.h"
22 22
23struct nfs_unlinkdata {
24 struct hlist_node list;
25 struct nfs_removeargs args;
26 struct nfs_removeres res;
27 struct inode *dir;
28 struct rpc_cred *cred;
29 struct nfs_fattr dir_attr;
30};
31
32/** 23/**
33 * nfs_free_unlinkdata - release data from a sillydelete operation. 24 * nfs_free_unlinkdata - release data from a sillydelete operation.
34 * @data: pointer to unlink structure. 25 * @data: pointer to unlink structure.
@@ -107,25 +98,16 @@ static void nfs_async_unlink_release(void *calldata)
107 nfs_sb_deactive(sb); 98 nfs_sb_deactive(sb);
108} 99}
109 100
110#if defined(CONFIG_NFS_V4_1)
111static void nfs_unlink_prepare(struct rpc_task *task, void *calldata) 101static void nfs_unlink_prepare(struct rpc_task *task, void *calldata)
112{ 102{
113 struct nfs_unlinkdata *data = calldata; 103 struct nfs_unlinkdata *data = calldata;
114 struct nfs_server *server = NFS_SERVER(data->dir); 104 NFS_PROTO(data->dir)->unlink_rpc_prepare(task, data);
115
116 if (nfs4_setup_sequence(server, &data->args.seq_args,
117 &data->res.seq_res, task))
118 return;
119 rpc_call_start(task);
120} 105}
121#endif /* CONFIG_NFS_V4_1 */
122 106
123static const struct rpc_call_ops nfs_unlink_ops = { 107static const struct rpc_call_ops nfs_unlink_ops = {
124 .rpc_call_done = nfs_async_unlink_done, 108 .rpc_call_done = nfs_async_unlink_done,
125 .rpc_release = nfs_async_unlink_release, 109 .rpc_release = nfs_async_unlink_release,
126#if defined(CONFIG_NFS_V4_1)
127 .rpc_call_prepare = nfs_unlink_prepare, 110 .rpc_call_prepare = nfs_unlink_prepare,
128#endif /* CONFIG_NFS_V4_1 */
129}; 111};
130 112
131static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data) 113static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 286d74dde053..8d93e688188d 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1192,6 +1192,15 @@ struct nfs_write_data {
1192 struct page *page_array[NFS_PAGEVEC_SIZE]; 1192 struct page *page_array[NFS_PAGEVEC_SIZE];
1193}; 1193};
1194 1194
1195struct nfs_unlinkdata {
1196 struct hlist_node list;
1197 struct nfs_removeargs args;
1198 struct nfs_removeres res;
1199 struct inode *dir;
1200 struct rpc_cred *cred;
1201 struct nfs_fattr dir_attr;
1202};
1203
1195struct nfs_access_entry; 1204struct nfs_access_entry;
1196struct nfs_client; 1205struct nfs_client;
1197struct rpc_timeout; 1206struct rpc_timeout;
@@ -1221,6 +1230,7 @@ struct nfs_rpc_ops {
1221 struct iattr *, int, struct nfs_open_context *); 1230 struct iattr *, int, struct nfs_open_context *);
1222 int (*remove) (struct inode *, struct qstr *); 1231 int (*remove) (struct inode *, struct qstr *);
1223 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1232 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1233 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
1224 int (*unlink_done) (struct rpc_task *, struct inode *); 1234 int (*unlink_done) (struct rpc_task *, struct inode *);
1225 int (*rename) (struct inode *, struct qstr *, 1235 int (*rename) (struct inode *, struct qstr *,
1226 struct inode *, struct qstr *); 1236 struct inode *, struct qstr *);