mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 21:53:44 +00:00
lockd: Rename nlm_hosts
Clean up. nlm_hosts now contains only server-side entries. Rename it to match convention of client side cache. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
67216b94d4
commit
d2df0484bb
@ -25,7 +25,7 @@
|
|||||||
#define NLM_HOST_EXPIRE (300 * HZ)
|
#define NLM_HOST_EXPIRE (300 * HZ)
|
||||||
#define NLM_HOST_COLLECT (120 * HZ)
|
#define NLM_HOST_COLLECT (120 * HZ)
|
||||||
|
|
||||||
static struct hlist_head nlm_hosts[NLM_HOST_NRHASH];
|
static struct hlist_head nlm_server_hosts[NLM_HOST_NRHASH];
|
||||||
static struct hlist_head nlm_client_hosts[NLM_HOST_NRHASH];
|
static struct hlist_head nlm_client_hosts[NLM_HOST_NRHASH];
|
||||||
|
|
||||||
#define for_each_host(host, pos, chain, table) \
|
#define for_each_host(host, pos, chain, table) \
|
||||||
@ -184,7 +184,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
|
|||||||
* different NLM rpc_clients into one single nlm_host object.
|
* different NLM rpc_clients into one single nlm_host object.
|
||||||
* This would allow us to have one nlm_host per address.
|
* This would allow us to have one nlm_host per address.
|
||||||
*/
|
*/
|
||||||
chain = &nlm_hosts[nlm_hash_address(ni->sap)];
|
chain = &nlm_server_hosts[nlm_hash_address(ni->sap)];
|
||||||
hlist_for_each_entry(host, pos, chain, h_hash) {
|
hlist_for_each_entry(host, pos, chain, h_hash) {
|
||||||
if (!rpc_cmp_addr(nlm_addr(host), ni->sap))
|
if (!rpc_cmp_addr(nlm_addr(host), ni->sap))
|
||||||
continue;
|
continue;
|
||||||
@ -428,7 +428,7 @@ struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp,
|
|||||||
if (time_after_eq(jiffies, next_gc))
|
if (time_after_eq(jiffies, next_gc))
|
||||||
nlm_gc_hosts();
|
nlm_gc_hosts();
|
||||||
|
|
||||||
chain = &nlm_hosts[nlm_hash_address(ni.sap)];
|
chain = &nlm_server_hosts[nlm_hash_address(ni.sap)];
|
||||||
hlist_for_each_entry(host, pos, chain, h_hash) {
|
hlist_for_each_entry(host, pos, chain, h_hash) {
|
||||||
if (!rpc_cmp_addr(nlm_addr(host), ni.sap))
|
if (!rpc_cmp_addr(nlm_addr(host), ni.sap))
|
||||||
continue;
|
continue;
|
||||||
@ -632,7 +632,7 @@ void nlm_host_rebooted(const struct nlm_reboot *info)
|
|||||||
* lock for this.
|
* lock for this.
|
||||||
* To avoid processing a host several times, we match the nsmstate.
|
* To avoid processing a host several times, we match the nsmstate.
|
||||||
*/
|
*/
|
||||||
while ((host = next_host_state(nlm_hosts, nsm, info)) != NULL) {
|
while ((host = next_host_state(nlm_server_hosts, nsm, info)) != NULL) {
|
||||||
nlmsvc_free_host_resources(host);
|
nlmsvc_free_host_resources(host);
|
||||||
nlmsvc_release_host(host);
|
nlmsvc_release_host(host);
|
||||||
}
|
}
|
||||||
@ -660,7 +660,7 @@ nlm_shutdown_hosts(void)
|
|||||||
|
|
||||||
/* First, make all hosts eligible for gc */
|
/* First, make all hosts eligible for gc */
|
||||||
dprintk("lockd: nuking all hosts...\n");
|
dprintk("lockd: nuking all hosts...\n");
|
||||||
for_each_host(host, pos, chain, nlm_hosts) {
|
for_each_host(host, pos, chain, nlm_server_hosts) {
|
||||||
host->h_expires = jiffies - 1;
|
host->h_expires = jiffies - 1;
|
||||||
if (host->h_rpcclnt) {
|
if (host->h_rpcclnt) {
|
||||||
rpc_shutdown_client(host->h_rpcclnt);
|
rpc_shutdown_client(host->h_rpcclnt);
|
||||||
@ -676,7 +676,7 @@ nlm_shutdown_hosts(void)
|
|||||||
if (nrhosts) {
|
if (nrhosts) {
|
||||||
printk(KERN_WARNING "lockd: couldn't shutdown host module!\n");
|
printk(KERN_WARNING "lockd: couldn't shutdown host module!\n");
|
||||||
dprintk("lockd: %d hosts left:\n", nrhosts);
|
dprintk("lockd: %d hosts left:\n", nrhosts);
|
||||||
for_each_host(host, pos, chain, nlm_hosts) {
|
for_each_host(host, pos, chain, nlm_server_hosts) {
|
||||||
dprintk(" %s (cnt %d use %d exp %ld)\n",
|
dprintk(" %s (cnt %d use %d exp %ld)\n",
|
||||||
host->h_name, atomic_read(&host->h_count),
|
host->h_name, atomic_read(&host->h_count),
|
||||||
host->h_inuse, host->h_expires);
|
host->h_inuse, host->h_expires);
|
||||||
@ -697,13 +697,13 @@ nlm_gc_hosts(void)
|
|||||||
struct nlm_host *host;
|
struct nlm_host *host;
|
||||||
|
|
||||||
dprintk("lockd: host garbage collection\n");
|
dprintk("lockd: host garbage collection\n");
|
||||||
for_each_host(host, pos, chain, nlm_hosts)
|
for_each_host(host, pos, chain, nlm_server_hosts)
|
||||||
host->h_inuse = 0;
|
host->h_inuse = 0;
|
||||||
|
|
||||||
/* Mark all hosts that hold locks, blocks or shares */
|
/* Mark all hosts that hold locks, blocks or shares */
|
||||||
nlmsvc_mark_resources();
|
nlmsvc_mark_resources();
|
||||||
|
|
||||||
for_each_host_safe(host, pos, next, chain, nlm_hosts) {
|
for_each_host_safe(host, pos, next, chain, nlm_server_hosts) {
|
||||||
if (atomic_read(&host->h_count) || host->h_inuse
|
if (atomic_read(&host->h_count) || host->h_inuse
|
||||||
|| time_before(jiffies, host->h_expires)) {
|
|| time_before(jiffies, host->h_expires)) {
|
||||||
dprintk("nlm_gc_hosts skipping %s "
|
dprintk("nlm_gc_hosts skipping %s "
|
||||||
|
Loading…
Reference in New Issue
Block a user