Skip to content

Commit d2df048

Browse files
chuckleverTrond Myklebust
authored andcommitted
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>
1 parent 67216b9 commit d2df048

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎fs/lockd/host.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define NLM_HOST_EXPIRE (300 * HZ)
2626
#define NLM_HOST_COLLECT (120 * HZ)
2727

28-
static struct hlist_head nlm_hosts[NLM_HOST_NRHASH];
28+
static struct hlist_head nlm_server_hosts[NLM_HOST_NRHASH];
2929
static struct hlist_head nlm_client_hosts[NLM_HOST_NRHASH];
3030

3131
#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)
184184
* different NLM rpc_clients into one single nlm_host object.
185185
* This would allow us to have one nlm_host per address.
186186
*/
187-
chain = &nlm_hosts[nlm_hash_address(ni->sap)];
187+
chain = &nlm_server_hosts[nlm_hash_address(ni->sap)];
188188
hlist_for_each_entry(host, pos, chain, h_hash) {
189189
if (!rpc_cmp_addr(nlm_addr(host), ni->sap))
190190
continue;
@@ -428,7 +428,7 @@ struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp,
428428
if (time_after_eq(jiffies, next_gc))
429429
nlm_gc_hosts();
430430

431-
chain = &nlm_hosts[nlm_hash_address(ni.sap)];
431+
chain = &nlm_server_hosts[nlm_hash_address(ni.sap)];
432432
hlist_for_each_entry(host, pos, chain, h_hash) {
433433
if (!rpc_cmp_addr(nlm_addr(host), ni.sap))
434434
continue;
@@ -632,7 +632,7 @@ void nlm_host_rebooted(const struct nlm_reboot *info)
632632
* lock for this.
633633
* To avoid processing a host several times, we match the nsmstate.
634634
*/
635-
while ((host = next_host_state(nlm_hosts, nsm, info)) != NULL) {
635+
while ((host = next_host_state(nlm_server_hosts, nsm, info)) != NULL) {
636636
nlmsvc_free_host_resources(host);
637637
nlmsvc_release_host(host);
638638
}
@@ -660,7 +660,7 @@ nlm_shutdown_hosts(void)
660660

661661
/* First, make all hosts eligible for gc */
662662
dprintk("lockd: nuking all hosts...\n");
663-
for_each_host(host, pos, chain, nlm_hosts) {
663+
for_each_host(host, pos, chain, nlm_server_hosts) {
664664
host->h_expires = jiffies - 1;
665665
if (host->h_rpcclnt) {
666666
rpc_shutdown_client(host->h_rpcclnt);
@@ -676,7 +676,7 @@ nlm_shutdown_hosts(void)
676676
if (nrhosts) {
677677
printk(KERN_WARNING "lockd: couldn't shutdown host module!\n");
678678
dprintk("lockd: %d hosts left:\n", nrhosts);
679-
for_each_host(host, pos, chain, nlm_hosts) {
679+
for_each_host(host, pos, chain, nlm_server_hosts) {
680680
dprintk(" %s (cnt %d use %d exp %ld)\n",
681681
host->h_name, atomic_read(&host->h_count),
682682
host->h_inuse, host->h_expires);
@@ -697,13 +697,13 @@ nlm_gc_hosts(void)
697697
struct nlm_host *host;
698698

699699
dprintk("lockd: host garbage collection\n");
700-
for_each_host(host, pos, chain, nlm_hosts)
700+
for_each_host(host, pos, chain, nlm_server_hosts)
701701
host->h_inuse = 0;
702702

703703
/* Mark all hosts that hold locks, blocks or shares */
704704
nlmsvc_mark_resources();
705705

706-
for_each_host_safe(host, pos, next, chain, nlm_hosts) {
706+
for_each_host_safe(host, pos, next, chain, nlm_server_hosts) {
707707
if (atomic_read(&host->h_count) || host->h_inuse
708708
|| time_before(jiffies, host->h_expires)) {
709709
dprintk("nlm_gc_hosts skipping %s "

0 commit comments

Comments
 (0)