aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-07-01 12:13:33 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:46 -0400
commit19207231c9874899e7511507ebb1b88d648a5743 (patch)
tree50942ddd79d25b24d81b9e2690be1b37e4ee0b43 /fs/nfs
parent3ea97309e6b18bce200211b3f9188e8023321adc (diff)
NFS: Clean up in-kernel NFS mount
Clean up white space and coding conventions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/mount_clnt.c83
1 files changed, 37 insertions, 46 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index ee4899d96629..961dc5243277 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -1,7 +1,5 @@
1/* 1/*
2 * linux/fs/nfs/mount_clnt.c 2 * In-kernel MOUNT protocol client
3 *
4 * MOUNT client to support NFSroot.
5 * 3 *
6 * Copyright (C) 1997, Olaf Kirch <okir@monad.swb.de> 4 * Copyright (C) 1997, Olaf Kirch <okir@monad.swb.de>
7 */ 5 */
@@ -21,18 +19,11 @@
21# define NFSDBG_FACILITY NFSDBG_MOUNT 19# define NFSDBG_FACILITY NFSDBG_MOUNT
22#endif 20#endif
23 21
24/*
25#define MOUNT_PROGRAM 100005
26#define MOUNT_VERSION 1
27#define MOUNT_MNT 1
28#define MOUNT_UMNT 3
29 */
30
31static struct rpc_program mnt_program; 22static struct rpc_program mnt_program;
32 23
33struct mnt_fhstatus { 24struct mnt_fhstatus {
34 unsigned int status; 25 u32 status;
35 struct nfs_fh * fh; 26 struct nfs_fh *fh;
36}; 27};
37 28
38/** 29/**
@@ -90,8 +81,8 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path,
90/* 81/*
91 * XDR encode/decode functions for MOUNT 82 * XDR encode/decode functions for MOUNT
92 */ 83 */
93static int 84static int xdr_encode_dirpath(struct rpc_rqst *req, __be32 *p,
94xdr_encode_dirpath(struct rpc_rqst *req, __be32 *p, const char *path) 85 const char *path)
95{ 86{
96 p = xdr_encode_string(p, path); 87 p = xdr_encode_string(p, path);
97 88
@@ -99,8 +90,8 @@ xdr_encode_dirpath(struct rpc_rqst *req, __be32 *p, const char *path)
99 return 0; 90 return 0;
100} 91}
101 92
102static int 93static int xdr_decode_fhstatus(struct rpc_rqst *req, __be32 *p,
103xdr_decode_fhstatus(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res) 94 struct mnt_fhstatus *res)
104{ 95{
105 struct nfs_fh *fh = res->fh; 96 struct nfs_fh *fh = res->fh;
106 97
@@ -111,8 +102,8 @@ xdr_decode_fhstatus(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res)
111 return 0; 102 return 0;
112} 103}
113 104
114static int 105static int xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p,
115xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res) 106 struct mnt_fhstatus *res)
116{ 107{
117 struct nfs_fh *fh = res->fh; 108 struct nfs_fh *fh = res->fh;
118 109
@@ -131,53 +122,53 @@ xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res)
131#define MNT_fhstatus_sz (1 + 8) 122#define MNT_fhstatus_sz (1 + 8)
132#define MNT_fhstatus3_sz (1 + 16) 123#define MNT_fhstatus3_sz (1 + 16)
133 124
134static struct rpc_procinfo mnt_procedures[] = { 125static struct rpc_procinfo mnt_procedures[] = {
135[MNTPROC_MNT] = { 126 [MNTPROC_MNT] = {
136 .p_proc = MNTPROC_MNT, 127 .p_proc = MNTPROC_MNT,
137 .p_encode = (kxdrproc_t) xdr_encode_dirpath, 128 .p_encode = (kxdrproc_t) xdr_encode_dirpath,
138 .p_decode = (kxdrproc_t) xdr_decode_fhstatus, 129 .p_decode = (kxdrproc_t) xdr_decode_fhstatus,
139 .p_arglen = MNT_dirpath_sz, 130 .p_arglen = MNT_dirpath_sz,
140 .p_replen = MNT_fhstatus_sz, 131 .p_replen = MNT_fhstatus_sz,
141 .p_statidx = MNTPROC_MNT, 132 .p_statidx = MNTPROC_MNT,
142 .p_name = "MOUNT", 133 .p_name = "MOUNT",
143 }, 134 },
144}; 135};
145 136
146static struct rpc_procinfo mnt3_procedures[] = { 137static struct rpc_procinfo mnt3_procedures[] = {
147[MOUNTPROC3_MNT] = { 138 [MOUNTPROC3_MNT] = {
148 .p_proc = MOUNTPROC3_MNT, 139 .p_proc = MOUNTPROC3_MNT,
149 .p_encode = (kxdrproc_t) xdr_encode_dirpath, 140 .p_encode = (kxdrproc_t) xdr_encode_dirpath,
150 .p_decode = (kxdrproc_t) xdr_decode_fhstatus3, 141 .p_decode = (kxdrproc_t) xdr_decode_fhstatus3,
151 .p_arglen = MNT_dirpath_sz, 142 .p_arglen = MNT_dirpath_sz,
152 .p_replen = MNT_fhstatus3_sz, 143 .p_replen = MNT_fhstatus3_sz,
153 .p_statidx = MOUNTPROC3_MNT, 144 .p_statidx = MOUNTPROC3_MNT,
154 .p_name = "MOUNT", 145 .p_name = "MOUNT",
155 }, 146 },
156}; 147};
157 148
158 149
159static struct rpc_version mnt_version1 = { 150static struct rpc_version mnt_version1 = {
160 .number = 1, 151 .number = 1,
161 .nrprocs = 2, 152 .nrprocs = 2,
162 .procs = mnt_procedures 153 .procs = mnt_procedures,
163}; 154};
164 155
165static struct rpc_version mnt_version3 = { 156static struct rpc_version mnt_version3 = {
166 .number = 3, 157 .number = 3,
167 .nrprocs = 2, 158 .nrprocs = 2,
168 .procs = mnt3_procedures 159 .procs = mnt3_procedures,
169}; 160};
170 161
171static struct rpc_version * mnt_version[] = { 162static struct rpc_version *mnt_version[] = {
172 NULL, 163 NULL,
173 &mnt_version1, 164 &mnt_version1,
174 NULL, 165 NULL,
175 &mnt_version3, 166 &mnt_version3,
176}; 167};
177 168
178static struct rpc_stat mnt_stats; 169static struct rpc_stat mnt_stats;
179 170
180static struct rpc_program mnt_program = { 171static struct rpc_program mnt_program = {
181 .name = "mount", 172 .name = "mount",
182 .number = NFS_MNT_PROGRAM, 173 .number = NFS_MNT_PROGRAM,
183 .nrvers = ARRAY_SIZE(mnt_version), 174 .nrvers = ARRAY_SIZE(mnt_version),