Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229191
b: refs/heads/master
c: 723bb5b
h: refs/heads/master
i:
  229189: af331bc
  229187: 93d762e
  229183: b674bad
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Dec 16, 2010
1 parent 5e3f54c commit 734eec4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: a7952f4056d4d9c63c70534bcfd4f2c11e487000
refs/heads/master: 723bb5b5052faba57060a2feb564ced22416b5bc
19 changes: 11 additions & 8 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,30 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
}

/*
* Destroy a host
* Destroy an nlm_host and free associated resources
*
* Caller must hold nlm_host_mutex.
*/
static void
nlm_destroy_host(struct nlm_host *host)
static void nlm_destroy_host_locked(struct nlm_host *host)
{
struct rpc_clnt *clnt;

dprintk("lockd: destroy host %s\n", host->h_name);

BUG_ON(!list_empty(&host->h_lockowners));
BUG_ON(atomic_read(&host->h_count));

hlist_del_init(&host->h_hash);

nsm_unmonitor(host);
nsm_release(host->h_nsmhandle);

clnt = host->h_rpcclnt;
if (clnt != NULL)
rpc_shutdown_client(clnt);
kfree(host);

nrhosts--;
}

/**
Expand Down Expand Up @@ -589,11 +596,7 @@ nlm_gc_hosts(void)
host->h_inuse, host->h_expires);
continue;
}
dprintk("lockd: delete host %s\n", host->h_name);
hlist_del_init(&host->h_hash);

nlm_destroy_host(host);
nrhosts--;
nlm_destroy_host_locked(host);
}

next_gc = jiffies + NLM_HOST_COLLECT;
Expand Down

0 comments on commit 734eec4

Please sign in to comment.