summaryrefslogtreecommitdiff
path: root/fs/nfs/nfsroot.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-12-23 23:21:35 +0300
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 23:21:35 +0300
commitc5d120f8e8b464368a7dcb038dc5c077d234d10a (patch)
tree28ec4ffebf3ebe0cdd1ed9c5ba174457b5960e32 /fs/nfs/nfsroot.c
parent146ec944bbd31d241a44a00518b054fb01921d22 (diff)
downloadlinux-c5d120f8e8b464368a7dcb038dc5c077d234d10a.tar.xz
NFS: introduce nfs_mount_info struct for calling nfs_mount()
Clean up: convert nfs_mount() to take a single data structure argument to make it simpler to add more arguments. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfsroot.c')
-rw-r--r--fs/nfs/nfsroot.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index a96e5fdb38af..f015e0d62add 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -487,15 +487,20 @@ static int __init root_nfs_get_handle(void)
{
struct nfs_fh fh;
struct sockaddr_in sin;
+ struct nfs_mount_request request = {
+ .sap = (struct sockaddr *)&sin,
+ .salen = sizeof(sin),
+ .dirpath = nfs_export_path,
+ .version = (nfs_data.flags & NFS_MOUNT_VER3) ?
+ NFS_MNT3_VERSION : NFS_MNT_VERSION,
+ .protocol = (nfs_data.flags & NFS_MOUNT_TCP) ?
+ XPRT_TRANSPORT_TCP : XPRT_TRANSPORT_UDP,
+ .fh = &fh,
+ };
int status;
- int protocol = (nfs_data.flags & NFS_MOUNT_TCP) ?
- XPRT_TRANSPORT_TCP : XPRT_TRANSPORT_UDP;
- int version = (nfs_data.flags & NFS_MOUNT_VER3) ?
- NFS_MNT3_VERSION : NFS_MNT_VERSION;
set_sockaddr(&sin, servaddr, htons(mount_port));
- status = nfs_mount((struct sockaddr *) &sin, sizeof(sin), NULL,
- nfs_export_path, version, protocol, &fh);
+ status = nfs_mount(&request);
if (status < 0)
printk(KERN_ERR "Root-NFS: Server returned error %d "
"while mounting %s\n", status, nfs_export_path);