NFS: Remake nfsroot_mount as a permanent part of NFS client
Subsystems (2)
PATCH 4/13 NFS: Remake nfsroot_mount as a permanent part of NFS client
In preparation for supporting NFSv2 and NFSv3 mount option handling in the kernel NFS client, convert mount_clnt.c to be a permanent part of the NFS client, instead of built only when CONFIG_ROOT_NFS is enabled.
Signed-off-by Chuck Lever <[email protected]>
---
fs/nfs/Makefile | 4 ++-- fs/nfs/mount_clnt.c | 18 +++++++++++++----- fs/nfs/nfsroot.c | 2 +- include/linux/nfs_fs.h | 4 +--- 4 files changed, 17 insertions(+), 11 deletions(-)
fs/nfs/Makefile +2 -2
@@ -6,8 +6,8 @@ obj-$(CONFIG_NFS_FS) += nfs.o nfs-y := client.o dir.o file.o getroot.o inode.o super.o nfs2xdr.o \ pagelist.o proc.o read.o symlink.o unlink.o \ - write.o namespace.o -nfs-$(CONFIG_ROOT_NFS) += nfsroot.o mount_clnt.o + write.o namespace.o mount_clnt.o +nfs-$(CONFIG_ROOT_NFS) += nfsroot.o nfs-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o nfs-$(CONFIG_NFS_V3_ACL) += nfs3acl.o nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \
fs/nfs/mount_clnt.c +13 -5
@@ -37,12 +37,20 @@ struct mnt_fhstatus {struct nfs_fh * fh; }; -/* -* Obtain an NFS file handle for the given host and path +/** +* nfs_mount - Obtain an NFS file handle for the given host and path +* @addr: pointer to server's address +* @path: pointer to string containing export path to mount +* @fh: pointer to location to place returned file handle +* @version: mount version to use for this request +* @protocol: transport protocol to use for thie request +* +* Uses default timeout parameters specified by underlying transport. +* +* XXX: Needs to support IPv6 */ -int -nfsroot_mount (struct sockaddr_in *addr,char *path,struct nfs_fh *fh, -int version,int protocol) +int nfs_mount (struct sockaddr_in *addr,char *path,struct nfs_fh *fh, +int version,int protocol) {struct rpc_clnt *mnt_clnt;struct mnt_fhstatus result = {
fs/nfs/nfsroot.c +1 -1
@@ -496,7 +496,7 @@ static int __init root_nfs_get_handle(void) NFS_MNT3_VERSION :NFS_MNT_VERSION ;set_sockaddr (&sin, servaddr,htons (mount_port)); - status =nfsroot_mount (&sin, nfs_path, &fh, version, protocol); + status =nfs_mount (&sin, nfs_path, &fh, version, protocol);if (status <0 )printk (KERN_ERR "Root-NFS: Server returned error %d " "while mounting %s\n" , status, nfs_path);
include/linux/nfs_fs.h +1 -3
@@ -496,10 +496,8 @@ static inline void nfs3_forget_cached_acls(struct inode *inode)/* * linux/fs/mount_clnt.c -* (Used only by nfsroot module) */ -extern int nfsroot_mount (struct sockaddr_in *,char *,struct nfs_fh *, -int ,int ); +extern int nfs_mount (struct sockaddr_in *,char *,struct nfs_fh *,int ,int );/* * inline functions