summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfsroot.c
diff options
context:
space:
mode:
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);