Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79663
b: refs/heads/master
c: 9289e7f
h: refs/heads/master
i:
  79661: 49be109
  79659: e20bdd9
  79655: 9bc9b54
  79647: ef5495a
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jan 30, 2008
1 parent f38bba4 commit a7bc4d6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52c4044d00fe703eb3fb18e0d8dfd1c196eb28be
refs/heads/master: 9289e7f91add1c09c3ec8571a2080f7507730b8d
32 changes: 19 additions & 13 deletions trunk/fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,28 +458,34 @@ static int nfs_create_rpc_client(struct nfs_client *clp,
static void nfs_destroy_server(struct nfs_server *server)
{
if (!(server->flags & NFS_MOUNT_NONLM))
lockd_down(); /* release rpc.lockd */
nlmclnt_done(server->nlm_host);
}

/*
* Version 2 or 3 lockd setup
*/
static int nfs_start_lockd(struct nfs_server *server)
{
int error = 0;
struct nlm_host *host;
struct nfs_client *clp = server->nfs_client;
u32 nfs_version = clp->rpc_ops->version;
unsigned short protocol = server->flags & NFS_MOUNT_TCP ?
IPPROTO_TCP : IPPROTO_UDP;

if (server->nfs_client->rpc_ops->version > 3)
goto out;
if (nfs_version > 3)
return 0;
if (server->flags & NFS_MOUNT_NONLM)
goto out;
error = lockd_up((server->flags & NFS_MOUNT_TCP) ?
IPPROTO_TCP : IPPROTO_UDP);
if (error < 0)
server->flags |= NFS_MOUNT_NONLM;
else
server->destroy = nfs_destroy_server;
out:
return error;
return 0;

host = nlmclnt_init(clp->cl_hostname,
(struct sockaddr *)&clp->cl_addr,
clp->cl_addrlen, protocol, nfs_version);
if (IS_ERR(host))
return PTR_ERR(host);

server->nlm_host = host;
server->destroy = nfs_destroy_server;
return 0;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/nfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <asm/atomic.h>

struct nfs_iostats;
struct nlm_host;

/*
* The nfs_client identifies our client state to the server.
Expand Down Expand Up @@ -80,6 +81,7 @@ struct nfs_server {
struct list_head master_link; /* link in master servers list */
struct rpc_clnt * client; /* RPC client handle */
struct rpc_clnt * client_acl; /* ACL RPC client handle */
struct nlm_host *nlm_host; /* NLM client handle */
struct nfs_iostats * io_stats; /* I/O statistics */
struct backing_dev_info backing_dev_info;
atomic_long_t writeback; /* number of writeback pages */
Expand Down

0 comments on commit a7bc4d6

Please sign in to comment.