Skip to content

Commit

Permalink
NFS: Kernel mount client should use async bind
Browse files Browse the repository at this point in the history
Simplify the in-kernel mount client by using autobind instead of an
explicit call to rpc_getport_sync.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Oct 9, 2007
1 parent b79dc8c commit efd8340
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,15 +1027,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
sin = args->mount_server.address;
else
sin = args->nfs_server.address;
if (args->mount_server.port == 0) {
status = rpcb_getport_sync(&sin,
args->mount_server.program,
args->mount_server.version,
args->mount_server.protocol);
if (status < 0)
goto out_err;
sin.sin_port = htons(status);
} else
if (args->mount_server.port != 0)
sin.sin_port = htons(args->mount_server.port);

/*
Expand All @@ -1049,14 +1041,11 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
args->mount_server.version,
args->mount_server.protocol,
root_fh);
if (status < 0)
goto out_err;

return status;
if (status == 0)
return 0;

out_err:
dfprintk(MOUNT, "NFS: unable to contact server on host "
NIPQUAD_FMT "\n", NIPQUAD(sin.sin_addr.s_addr));
dfprintk(MOUNT, "NFS: unable to mount server " NIPQUAD_FMT
", error %d\n", NIPQUAD(sin.sin_addr.s_addr), status);
return status;
}

Expand Down

0 comments on commit efd8340

Please sign in to comment.