aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 13:16:20 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 16:07:03 -0400
commit5b616f5d596c0b056129f8aeafbc08409b3cd050 (patch)
treebdbd2eb5bd1f8a26c7287e21be25ec50db075459 /fs/nfs
parent334ccfd545bba9690515f2c5c167d5adb161989b (diff)
[PATCH] RPC: Make rpc_create_client() destroy the transport on failure.
This saves us a couple of lines of cleanup code for each call. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c2
-rw-r--r--fs/nfs/mount_clnt.c4
2 files changed, 1 insertions, 5 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index f2317f3e29f9..ea784969fb85 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -383,7 +383,6 @@ nfs_create_client(struct nfs_server *server, const struct nfs_mount_data *data)
383 return clnt; 383 return clnt;
384 384
385out_fail: 385out_fail:
386 xprt_destroy(xprt);
387 return clnt; 386 return clnt;
388} 387}
389 388
@@ -1623,7 +1622,6 @@ static int nfs4_fill_super(struct super_block *sb, struct nfs4_mount_data *data,
1623 if (IS_ERR(clnt)) { 1622 if (IS_ERR(clnt)) {
1624 up_write(&clp->cl_sem); 1623 up_write(&clp->cl_sem);
1625 printk(KERN_WARNING "NFS: cannot create RPC client.\n"); 1624 printk(KERN_WARNING "NFS: cannot create RPC client.\n");
1626 xprt_destroy(xprt);
1627 err = PTR_ERR(clnt); 1625 err = PTR_ERR(clnt);
1628 goto out_fail; 1626 goto out_fail;
1629 } 1627 }
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index 9d3ddad96d9e..0e82617f2de0 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -80,9 +80,7 @@ mnt_create(char *hostname, struct sockaddr_in *srvaddr, int version,
80 clnt = rpc_create_client(xprt, hostname, 80 clnt = rpc_create_client(xprt, hostname,
81 &mnt_program, version, 81 &mnt_program, version,
82 RPC_AUTH_UNIX); 82 RPC_AUTH_UNIX);
83 if (IS_ERR(clnt)) { 83 if (!IS_ERR(clnt)) {
84 xprt_destroy(xprt);
85 } else {
86 clnt->cl_softrtry = 1; 84 clnt->cl_softrtry = 1;
87 clnt->cl_chatty = 1; 85 clnt->cl_chatty = 1;
88 clnt->cl_oneshot = 1; 86 clnt->cl_oneshot = 1;