*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
return NULL;
}
+static void nfs4_shutdown_client(struct nfs_client *clp)
+{
+#ifdef CONFIG_NFS_V4
+ if (__test_and_clear_bit(NFS_CS_RENEWD, &clp->cl_res_state))
+ nfs4_kill_renewd(clp);
+ while (!list_empty(&clp->cl_unused)) {
+ struct nfs4_state_owner *sp;
+
+ sp = list_entry(clp->cl_unused.next,
+ struct nfs4_state_owner,
+ so_list);
+ list_del(&sp->so_list);
+ kfree(sp);
+ }
+ BUG_ON(!list_empty(&clp->cl_state_owners));
+ if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state))
+ nfs_idmap_delete(clp);
+#endif
+}
+
/*
* Destroy a shared client record
*/
{
dprintk("--> nfs_free_client(%d)\n", clp->cl_nfsversion);
-#ifdef CONFIG_NFS_V4
- if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state)) {
- while (!list_empty(&clp->cl_unused)) {
- struct nfs4_state_owner *sp;
-
- sp = list_entry(clp->cl_unused.next,
- struct nfs4_state_owner,
- so_list);
- list_del(&sp->so_list);
- kfree(sp);
- }
- BUG_ON(!list_empty(&clp->cl_state_owners));
- nfs_idmap_delete(clp);
- }
-#endif
+ nfs4_shutdown_client(clp);
/* -EIO all pending I/O */
if (!IS_ERR(clp->cl_rpcclient))
clp = __nfs_find_client(addr, nfsversion);
spin_unlock(&nfs_client_lock);
- BUG_ON(clp->cl_cons_state == 0);
+ BUG_ON(clp && clp->cl_cons_state == 0);
return clp;
}
goto out;
if (server->flags & NFS_MOUNT_NONLM)
goto out;
- error = lockd_up();
+ error = lockd_up((server->flags & NFS_MOUNT_TCP) ?
+ IPPROTO_TCP : IPPROTO_UDP);
if (error < 0)
server->flags |= NFS_MOUNT_NONLM;
else
}
memcpy(&server->fsid, &fattr.fsid, sizeof(server->fsid));
- dprintk("Server FSID: %llx:%llx\n", server->fsid.major, server->fsid.minor);
+ dprintk("Server FSID: %llx:%llx\n",
+ (unsigned long long) server->fsid.major,
+ (unsigned long long) server->fsid.minor);
BUG_ON(!server->nfs_client);
BUG_ON(!server->nfs_client->rpc_ops);
if (error < 0)
goto error;
- dprintk("Server FSID: %llx:%llx\n", server->fsid.major, server->fsid.minor);
+ dprintk("Server FSID: %llx:%llx\n",
+ (unsigned long long) server->fsid.major,
+ (unsigned long long) server->fsid.minor);
dprintk("Mount FH: %d\n", mntfh->size);
error = nfs_probe_fsinfo(server, mntfh, &fattr);
parent_server->client->cl_xprt->prot,
parent_client->retrans_timeo,
parent_client->retrans_count);
+ if (error < 0)
+ goto error;
/* Initialise the client representation from the parent server */
nfs_server_copy_userdata(server, parent_server);
goto error;
dprintk("Referral FSID: %llx:%llx\n",
- server->fsid.major, server->fsid.minor);
+ (unsigned long long) server->fsid.major,
+ (unsigned long long) server->fsid.minor);
spin_lock(&nfs_client_lock);
list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks);
int error;
dprintk("--> nfs_clone_server(,%llx:%llx,)\n",
- fattr->fsid.major, fattr->fsid.minor);
+ (unsigned long long) fattr->fsid.major,
+ (unsigned long long) fattr->fsid.minor);
server = nfs_alloc_server();
if (!server)
goto out_free_server;
dprintk("Cloned FSID: %llx:%llx\n",
- server->fsid.major, server->fsid.minor);
+ (unsigned long long) server->fsid.major,
+ (unsigned long long) server->fsid.minor);
error = nfs_start_lockd(server);
if (error < 0)
MAJOR(server->s_dev), MINOR(server->s_dev));
snprintf(fsid, 17, "%llx:%llx",
- server->fsid.major, server->fsid.minor);
+ (unsigned long long) server->fsid.major,
+ (unsigned long long) server->fsid.minor);
seq_printf(m, "v%d %02x%02x%02x%02x %4hx %-7s %-17s\n",
clp->cl_nfsversion,