aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/mount_clnt.c32
-rw-r--r--fs/nfs/nfsroot.c3
-rw-r--r--include/linux/nfs.h5
-rw-r--r--include/linux/nfs2.h7
-rw-r--r--include/linux/nfs3.h5
5 files changed, 34 insertions, 18 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index ca905a5bb1ba..af45a374d56f 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};
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index e3ed5908820b..24c1b93874c4 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -92,6 +92,9 @@
92#undef NFSROOT_DEBUG 92#undef NFSROOT_DEBUG
93#define NFSDBG_FACILITY NFSDBG_ROOT 93#define NFSDBG_FACILITY NFSDBG_ROOT
94 94
95/* Default port to use if server is not running a portmapper */
96#define NFS_MNT_PORT 627
97
95/* Default path we try to mount. "%s" gets replaced by our IP address */ 98/* Default path we try to mount. "%s" gets replaced by our IP address */
96#define NFS_ROOT "/tftpboot/%s" 99#define NFS_ROOT "/tftpboot/%s"
97 100
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index 214d499718f7..f387919bbc59 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -25,8 +25,9 @@
25#define NFSMODE_SOCK 0140000 25#define NFSMODE_SOCK 0140000
26#define NFSMODE_FIFO 0010000 26#define NFSMODE_FIFO 0010000
27 27
28#define NFS_MNT_PROGRAM 100005 28#define NFS_MNT_PROGRAM 100005
29#define NFS_MNT_PORT 627 29#define NFS_MNT_VERSION 1
30#define NFS_MNT3_VERSION 3
30 31
31/* 32/*
32 * NFS stats. The good thing with these values is that NFSv3 errors are 33 * NFS stats. The good thing with these values is that NFSv3 errors are
diff --git a/include/linux/nfs2.h b/include/linux/nfs2.h
index 0ed9517138fc..fde24b30cc9e 100644
--- a/include/linux/nfs2.h
+++ b/include/linux/nfs2.h
@@ -64,11 +64,4 @@ struct nfs2_fh {
64#define NFSPROC_READDIR 16 64#define NFSPROC_READDIR 16
65#define NFSPROC_STATFS 17 65#define NFSPROC_STATFS 17
66 66
67#define NFS_MNT_PROGRAM 100005
68#define NFS_MNT_VERSION 1
69#define MNTPROC_NULL 0
70#define MNTPROC_MNT 1
71#define MNTPROC_UMNT 3
72#define MNTPROC_UMNTALL 4
73
74#endif /* _LINUX_NFS2_H */ 67#endif /* _LINUX_NFS2_H */
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h
index 539f3b550eab..ac33806ec7f9 100644
--- a/include/linux/nfs3.h
+++ b/include/linux/nfs3.h
@@ -88,12 +88,7 @@ struct nfs3_fh {
88#define NFS3PROC_PATHCONF 20 88#define NFS3PROC_PATHCONF 20
89#define NFS3PROC_COMMIT 21 89#define NFS3PROC_COMMIT 21
90 90
91#define NFS_MNT3_PROGRAM 100005
92#define NFS_MNT3_VERSION 3 91#define NFS_MNT3_VERSION 3
93#define MOUNTPROC3_NULL 0
94#define MOUNTPROC3_MNT 1
95#define MOUNTPROC3_UMNT 3
96#define MOUNTPROC3_UMNTALL 4
97 92
98 93
99#if defined(__KERNEL__) 94#if defined(__KERNEL__)