mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
NFS: Clean up nfs4_set_client()
If we cut out the dprintk()s, then we can return error codes directly and cut out the goto. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
8da0f93438
commit
2dc42c0d60
@ -854,9 +854,6 @@ static int nfs4_set_client(struct nfs_server *server,
|
|||||||
.timeparms = timeparms,
|
.timeparms = timeparms,
|
||||||
};
|
};
|
||||||
struct nfs_client *clp;
|
struct nfs_client *clp;
|
||||||
int error;
|
|
||||||
|
|
||||||
dprintk("--> nfs4_set_client()\n");
|
|
||||||
|
|
||||||
if (server->flags & NFS_MOUNT_NORESVPORT)
|
if (server->flags & NFS_MOUNT_NORESVPORT)
|
||||||
set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
|
set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
|
||||||
@ -865,15 +862,11 @@ static int nfs4_set_client(struct nfs_server *server,
|
|||||||
|
|
||||||
/* Allocate or find a client reference we can use */
|
/* Allocate or find a client reference we can use */
|
||||||
clp = nfs_get_client(&cl_init);
|
clp = nfs_get_client(&cl_init);
|
||||||
if (IS_ERR(clp)) {
|
if (IS_ERR(clp))
|
||||||
error = PTR_ERR(clp);
|
return PTR_ERR(clp);
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (server->nfs_client == clp) {
|
if (server->nfs_client == clp)
|
||||||
error = -ELOOP;
|
return -ELOOP;
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Query for the lease time on clientid setup or renewal
|
* Query for the lease time on clientid setup or renewal
|
||||||
@ -885,11 +878,7 @@ static int nfs4_set_client(struct nfs_server *server,
|
|||||||
set_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state);
|
set_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state);
|
||||||
|
|
||||||
server->nfs_client = clp;
|
server->nfs_client = clp;
|
||||||
dprintk("<-- nfs4_set_client() = 0 [new %p]\n", clp);
|
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
|
||||||
dprintk("<-- nfs4_set_client() = xerror %d\n", error);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user