aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/mount_clnt.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-06-17 21:02:11 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-06-17 21:02:11 -0400
commit2ad780978b7c0c3e7877949f098cbd06e7c73839 (patch)
treece7dadf676f031d1f3bf81ed9c93b4a333e2cdce /fs/nfs/mount_clnt.c
parent0e5c2632e1c9182f0dadc31bec68d6f42e7905ea (diff)
NFS: Clean up MNT program definitions
Clean up: Relocate MNT program procedure number definitions to the only file that uses them. Relocate the version number definitions, which are shared, to nfs.h. Remove duplicate program number definitions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/mount_clnt.c')
-rw-r--r--fs/nfs/mount_clnt.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index ca905a5bb1b..af45a374d56 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -20,6 +20,30 @@
20# define NFSDBG_FACILITY NFSDBG_MOUNT 20# define NFSDBG_FACILITY NFSDBG_MOUNT
21#endif 21#endif
22 22
23/*
24 * Defined by RFC 1094, section A.5
25 */
26enum {
27 MOUNTPROC_NULL = 0,
28 MOUNTPROC_MNT = 1,
29 MOUNTPROC_DUMP = 2,
30 MOUNTPROC_UMNT = 3,
31 MOUNTPROC_UMNTALL = 4,
32 MOUNTPROC_EXPORT = 5,
33};
34
35/*
36 * Defined by RFC 1813, section 5.2
37 */
38enum {
39 MOUNTPROC3_NULL = 0,
40 MOUNTPROC3_MNT = 1,
41 MOUNTPROC3_DUMP = 2,
42 MOUNTPROC3_UMNT = 3,
43 MOUNTPROC3_UMNTALL = 4,
44 MOUNTPROC3_EXPORT = 5,
45};
46
23static struct rpc_program mnt_program; 47static struct rpc_program mnt_program;
24 48
25struct mnt_fhstatus { 49struct mnt_fhstatus {
@@ -68,7 +92,7 @@ int nfs_mount(struct nfs_mount_request *info)
68 if (info->version == NFS_MNT3_VERSION) 92 if (info->version == NFS_MNT3_VERSION)
69 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC3_MNT]; 93 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC3_MNT];
70 else 94 else
71 msg.rpc_proc = &mnt_clnt->cl_procinfo[MNTPROC_MNT]; 95 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC_MNT];
72 96
73 status = rpc_call_sync(mnt_clnt, &msg, 0); 97 status = rpc_call_sync(mnt_clnt, &msg, 0);
74 rpc_shutdown_client(mnt_clnt); 98 rpc_shutdown_client(mnt_clnt);
@@ -145,13 +169,13 @@ static int xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p,
145#define MNT_fhstatus3_sz (1 + 16) 169#define MNT_fhstatus3_sz (1 + 16)
146 170
147static struct rpc_procinfo mnt_procedures[] = { 171static struct rpc_procinfo mnt_procedures[] = {
148 [MNTPROC_MNT] = { 172 [MOUNTPROC_MNT] = {
149 .p_proc = MNTPROC_MNT, 173 .p_proc = MOUNTPROC_MNT,
150 .p_encode = (kxdrproc_t) xdr_encode_dirpath, 174 .p_encode = (kxdrproc_t) xdr_encode_dirpath,
151 .p_decode = (kxdrproc_t) xdr_decode_fhstatus, 175 .p_decode = (kxdrproc_t) xdr_decode_fhstatus,
152 .p_arglen = MNT_dirpath_sz, 176 .p_arglen = MNT_dirpath_sz,
153 .p_replen = MNT_fhstatus_sz, 177 .p_replen = MNT_fhstatus_sz,
154 .p_statidx = MNTPROC_MNT, 178 .p_statidx = MOUNTPROC_MNT,
155 .p_name = "MOUNT", 179 .p_name = "MOUNT",
156 }, 180 },
157}; 181};