[pnfs] [PATCH 1/6] nfs41: save ptr to nfs4_procedures in struct nfs_client

Benny Halevy bhalevy at panasas.com
Tue Jun 24 09:51:39 EDT 2008


To support heterogenuous mount minor version, save ptr to nfs4_procedures
in struct nfs_client, use this tabel rather than a global one to get to
the actual rpc procedure from the proc level procedure.

Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfs/client.c           |    2 +-
 fs/nfs/nfs4_fs.h          |    1 -
 fs/nfs/nfs4proc.c         |   98 +++++++++++++++++++++++++--------------------
 fs/nfs/nfs4xdr.c          |    2 -
 include/linux/nfs_fs_sb.h |    9 ++++
 5 files changed, 64 insertions(+), 48 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 7d6456e..7c1cae6 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -996,7 +996,7 @@ static int nfs4_init_client(struct nfs_client *clp,
 
 	/* Check NFS protocol revision and initialize RPC op vector */
 	clp->rpc_ops = nfsv4_minorversion_clientops[clp->cl_minorversion];
-	nfs4_procedures = nfs4_minorversion_procedures[clp->cl_minorversion];
+	clp->nfs4_procedures = nfs4_minorversion_procedures[clp->cl_minorversion];
 
 	/* Setup the nfs_program based on the minorversion */
 	error = nfs4_setup_nfs4_program(clp->cl_minorversion);
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index fc8de21..bf9e3e3 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -258,7 +258,6 @@ extern const nfs4_stateid zero_stateid;
 
 /* nfs4xdr.c */
 extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
-extern struct rpc_procinfo *nfs4_procedures;
 #if defined(CONFIG_NFS_V4_1)
 extern struct rpc_version *nfs4_minorversions[];
 extern struct rpc_procinfo *nfs4_minorversion_procedures[];
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7d2e3b6..5ece784 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1128,7 +1128,8 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
 	struct nfs_server *server = NFS_SERVER(data->dir->d_inode);
 	struct rpc_task *task;
 	struct  rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_CONFIRM],
+		.rpc_proc = nfs4_proc(server->nfs_client,
+				      NFSPROC4_CLNT_OPEN_CONFIRM),
 		.rpc_argp = &data->c_arg,
 		.rpc_resp = &data->c_res,
 		.rpc_cred = data->owner->so_cred,
@@ -1191,7 +1192,8 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata)
 		sp->so_client->rpc_ops->nfs4_clientid(sp->so_client);
 
 	if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) {
-		task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR];
+		task->tk_msg.rpc_proc = nfs4_proc(sp->so_client,
+						  NFSPROC4_CLNT_OPEN_NOATTR);
 		nfs_copy_fh(&data->o_res.fh, data->o_arg.fh);
 	}
 	data->timestamp = jiffies;
@@ -1291,7 +1293,7 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
 	struct nfs_openres *o_res = &data->o_res;
 	struct rpc_task *task;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_OPEN),
 		.rpc_argp = o_arg,
 		.rpc_resp = o_res,
 		.rpc_cred = data->owner->so_cred,
@@ -1544,7 +1546,8 @@ static int _nfs4_do_setattr(struct inode *inode, struct nfs_fattr *fattr,
 		.server		= server,
         };
         struct rpc_message msg = {
-                .rpc_proc       = &nfs4_procedures[NFSPROC4_CLNT_SETATTR],
+                .rpc_proc       = nfs4_proc(server->nfs_client,
+					    NFSPROC4_CLNT_SETATTR),
                 .rpc_argp       = &arg,
                 .rpc_resp       = &res,
         };
@@ -1666,10 +1669,12 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
 	}
 	nfs_fattr_init(calldata->res.fattr);
 	if (test_bit(NFS_O_RDONLY_STATE, &state->flags) != 0) {
-		task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE];
+		task->tk_msg.rpc_proc = nfs4_proc(state->owner->so_client,
+						  NFSPROC4_CLNT_OPEN_DOWNGRADE);
 		calldata->arg.open_flags = FMODE_READ;
 	} else if (test_bit(NFS_O_WRONLY_STATE, &state->flags) != 0) {
-		task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE];
+		task->tk_msg.rpc_proc = nfs4_proc(state->owner->so_client,
+						  NFSPROC4_CLNT_OPEN_DOWNGRADE);
 		calldata->arg.open_flags = FMODE_WRITE;
 	}
 	calldata->timestamp = jiffies;
@@ -1719,7 +1724,7 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, int wait)
 	struct nfs4_state_owner *sp = state->owner;
 	struct rpc_task *task;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE],
+		.rpc_proc = nfs4_proc(sp->so_client, NFSPROC4_CLNT_CLOSE),
 		.rpc_cred = state->owner->so_cred,
 	};
 	struct rpc_task_setup task_setup_data = {
@@ -1893,7 +1898,7 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
 	};
 	struct nfs4_server_caps_res res = {};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SERVER_CAPS],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_SERVER_CAPS),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -1941,7 +1946,7 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
 		.fh = fhandle,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOOKUP_ROOT],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_LOOKUP_ROOT),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2040,7 +2045,7 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
 		.server = server,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GETATTR],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_GETATTR),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2128,7 +2133,7 @@ static int _nfs4_proc_lookupfh(struct nfs_server *server, const struct nfs_fh *d
 		.fh = fhandle,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOOKUP],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_LOOKUP),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2198,7 +2203,7 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
 		.fattr = &fattr,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_ACCESS],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_ACCESS),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 		.rpc_cred = entry->cred,
@@ -2286,7 +2291,7 @@ static int _nfs4_proc_readlink(struct inode *inode, struct page *page,
 	};
 	struct nfs4_readlink_res res;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READLINK],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_READLINK),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2380,7 +2385,7 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
 		.server = server,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_REMOVE),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2417,7 +2422,7 @@ static void nfs4_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
 
 	args->bitmask = server->attr_bitmask;
 	res->server = server;
-	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE];
+	msg->rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_REMOVE);
 }
 
 static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
@@ -2454,7 +2459,7 @@ static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
 		.new_fattr = &new_fattr,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_RENAME),
 		.rpc_argp = &arg,
 		.rpc_resp = &res,
 	};
@@ -2504,7 +2509,7 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *
 		.dir_attr = &dir_attr,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_LINK),
 		.rpc_argp = &arg,
 		.rpc_resp = &res,
 	};
@@ -2556,7 +2561,7 @@ static int _nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
 		.dir_fattr = &dir_fattr,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SYMLINK],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_SYMLINK),
 		.rpc_argp = &arg,
 		.rpc_resp = &res,
 	};
@@ -2616,7 +2621,7 @@ static int _nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
 		.dir_fattr = &dir_fattr,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CREATE],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_CREATE),
 		.rpc_argp = &arg,
 		.rpc_resp = &res,
 	};
@@ -2662,7 +2667,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
 	};
 	struct nfs4_readdir_res res;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READDIR],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_READDIR),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 		.rpc_cred = cred,
@@ -2722,7 +2727,7 @@ static int _nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
 		.dir_fattr = &dir_fattr,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CREATE],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_CREATE),
 		.rpc_argp = &arg,
 		.rpc_resp = &res,
 	};
@@ -2783,7 +2788,7 @@ static int _nfs4_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
 		.fsstat = fsstat,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_STATFS],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_STATFS),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2819,7 +2824,7 @@ static int _nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle,
 		.fsinfo = fsinfo,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_FSINFO],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_FSINFO),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2863,7 +2868,7 @@ static int _nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle
 		.pathconf = pathconf,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_PATHCONF],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_PATHCONF),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -2925,8 +2930,10 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
 
 static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message *msg)
 {
+	struct nfs_server *server = NFS_SERVER(data->inode);
+
 	data->timestamp   = jiffies;
-	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ];
+	msg->rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_READ);
 }
 
 static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
@@ -2958,7 +2965,7 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
 	data->res.server = server;
 	data->timestamp   = jiffies;
 
-	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE];
+	msg->rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_WRITE);
 }
 
 static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
@@ -2985,7 +2992,7 @@ static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_messa
 	
 	data->args.bitmask = server->attr_bitmask;
 	data->res.server = server;
-	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
+	msg->rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_COMMIT);
 }
 
 /*
@@ -3022,7 +3029,7 @@ static const struct rpc_call_ops nfs4_renew_ops = {
 int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred)
 {
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_RENEW],
+		.rpc_proc	= nfs4_proc(clp, NFSPROC4_CLNT_RENEW),
 		.rpc_argp	= clp,
 		.rpc_cred	= cred,
 	};
@@ -3034,7 +3041,7 @@ int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred)
 int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred)
 {
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_RENEW],
+		.rpc_proc	= nfs4_proc(clp, NFSPROC4_CLNT_RENEW),
 		.rpc_argp	= clp,
 		.rpc_cred	= cred,
 	};
@@ -3158,7 +3165,8 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
 	};
 	void *resp_buf;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GETACL],
+		.rpc_proc = nfs4_proc(NFS_SERVER(inode)->nfs_client,
+				      NFSPROC4_CLNT_GETACL),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -3242,7 +3250,7 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl
 	};
 	struct nfs_setaclres res;
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_SETACL],
+		.rpc_proc	= nfs4_proc(server->nfs_client, NFSPROC4_CLNT_SETACL),
 		.rpc_argp	= &arg,
 		.rpc_resp	= &res,
 	};
@@ -3429,7 +3437,7 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, unsigned short po
 		.sc_prog = program,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SETCLIENTID],
+		.rpc_proc = nfs4_proc(clp, NFSPROC4_CLNT_SETCLIENTID),
 		.rpc_argp = &setclientid,
 		.rpc_resp = clp,
 		.rpc_cred = cred,
@@ -3478,7 +3486,7 @@ static int _nfs4_proc_setclientid_confirm(struct nfs_client *clp, struct rpc_cre
 {
 	struct nfs_fsinfo fsinfo;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SETCLIENTID_CONFIRM],
+		.rpc_proc = nfs4_proc(clp, NFSPROC4_CLNT_SETCLIENTID_CONFIRM),
 		.rpc_argp = clp,
 		.rpc_resp = &fsinfo,
 		.rpc_cred = cred,
@@ -3574,7 +3582,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co
 	struct nfs_server *server = NFS_SERVER(inode);
 	struct rpc_task *task;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_DELEGRETURN],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_DELEGRETURN),
 		.rpc_cred = cred,
 	};
 	struct rpc_task_setup task_setup_data = {
@@ -3666,7 +3674,7 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock
 		.denied = request,
 	};
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_LOCKT],
+		.rpc_proc	= nfs4_proc(clp, NFSPROC4_CLNT_LOCKT),
 		.rpc_argp       = &arg,
 		.rpc_resp       = &res,
 		.rpc_cred	= state->owner->so_cred,
@@ -3840,7 +3848,8 @@ static struct rpc_task *nfs4_do_unlck(struct file_lock *fl,
 {
 	struct nfs4_unlockdata *data;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOCKU],
+		.rpc_proc = nfs4_proc(NFS_SERVER(lsp->ls_state->inode)->nfs_client,
+				      NFSPROC4_CLNT_LOCKU),
 		.rpc_cred = ctx->cred,
 	};
 	struct rpc_task_setup task_setup_data = {
@@ -4051,7 +4060,8 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
 	struct nfs4_lockdata *data;
 	struct rpc_task *task;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOCK],
+		.rpc_proc = nfs4_proc(NFS_SERVER(state->inode)->nfs_client,
+				      NFSPROC4_CLNT_LOCK),
 		.rpc_cred = state->owner->so_cred,
 	};
 	struct rpc_task_setup task_setup_data = {
@@ -4297,7 +4307,7 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
 		.fs_locations = fs_locations,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_FS_LOCATIONS],
+		.rpc_proc = nfs4_proc(server->nfs_client, NFSPROC4_CLNT_FS_LOCATIONS),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -4327,7 +4337,7 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
 	int loop = 0;
 	int got_cred = 0;
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_EXCHANGE_ID],
+		.rpc_proc = nfs4_proc(clp, NFSPROC4_CLNT_EXCHANGE_ID),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 		.rpc_cred = cred,
@@ -4460,7 +4470,7 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp,
 		.session = session,
 	};
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GET_LEASE_TIME],
+		.rpc_proc = nfs4_proc(clp, NFSPROC4_CLNT_GET_LEASE_TIME),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -4703,7 +4713,7 @@ static int _nfs4_proc_create_session(struct nfs_client *clp,
 	};
 
 	struct rpc_message msg = {
-		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CREATE_SESSION],
+		.rpc_proc = nfs4_proc(clp, NFSPROC4_CLNT_CREATE_SESSION),
 		.rpc_argp = &args,
 		.rpc_resp = &res,
 	};
@@ -4798,7 +4808,7 @@ int nfs4_proc_destroy_session(struct nfs4_session *session, struct rpc_clnt *cln
 	dprintk("--> nfs4_proc_destroy_session\n");
 	BUG_ON(session == NULL);
 
-	msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_DESTROY_SESSION];
+	msg.rpc_proc = nfs4_proc(session->clp, NFSPROC4_CLNT_DESTROY_SESSION);
 	msg.rpc_argp = session;
 	msg.rpc_resp = NULL;
 	msg.rpc_cred = NULL;
@@ -4820,7 +4830,7 @@ static int nfs4_proc_sequence(struct nfs_client *clp, struct rpc_cred *cred)
 	struct nfs_server *server;
 
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_SEQUENCE],
+		.rpc_proc	= nfs4_proc(clp, NFSPROC4_CLNT_SEQUENCE),
 		.rpc_argp	= &args,
 		.rpc_resp	= &res,
 		.rpc_cred	= cred,
@@ -4919,7 +4929,7 @@ static int nfs41_proc_async_sequence(struct nfs_client *clp,
 	struct nfs41_sequence_res *res;
 	struct nfs_server *server;
 	struct rpc_message msg = {
-		.rpc_proc	= &nfs4_procedures[NFSPROC4_CLNT_SEQUENCE],
+		.rpc_proc	= nfs4_proc(clp, NFSPROC4_CLNT_SEQUENCE),
 		.rpc_cred	= cred,
 	};
 
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index f653ce0..62720f5 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -7102,8 +7102,6 @@ struct rpc_procinfo *nfs4_minorversion_procedures[] = {
 #endif
 };
 
-struct rpc_procinfo *nfs4_procedures;
-
 /*
  * Local variables:
  *  c-basic-offset: 8
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 7bee5d6..d237c55 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -74,6 +74,7 @@ struct nfs_client {
 	char			cl_ipaddr[48];
 	unsigned char		cl_id_uniquifier;
 	u32			cl_minorversion;
+	struct rpc_procinfo	*nfs4_procedures;
 #endif /* CONFIG_NFS_V4 */
 
 #ifdef CONFIG_NFS_V4_1
@@ -85,6 +86,14 @@ struct nfs_client {
 #endif /* CONFIG_NFS_V4_1 */
 };
 
+#ifdef CONFIG_NFS_V4
+static inline struct rpc_procinfo *
+nfs4_proc(struct nfs_client *clp, int idx)
+{
+	return &clp->nfs4_procedures[idx];
+}
+#endif /* CONFIG_NFS_V4 */
+
 /*
  * NFS client parameters stored in the superblock.
  */
-- 
1.5.6.GIT



More information about the pNFS mailing list