diff options
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r-- | fs/lockd/host.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 826a89184f90..11b6832277f6 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -151,7 +151,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, | |||
151 | host->h_state = 0; | 151 | host->h_state = 0; |
152 | host->h_nsmstate = 0; | 152 | host->h_nsmstate = 0; |
153 | host->h_pidcount = 0; | 153 | host->h_pidcount = 0; |
154 | atomic_set(&host->h_count, 1); | 154 | refcount_set(&host->h_count, 1); |
155 | mutex_init(&host->h_mutex); | 155 | mutex_init(&host->h_mutex); |
156 | host->h_nextrebind = now + NLM_HOST_REBIND; | 156 | host->h_nextrebind = now + NLM_HOST_REBIND; |
157 | host->h_expires = now + NLM_HOST_EXPIRE; | 157 | host->h_expires = now + NLM_HOST_EXPIRE; |
@@ -290,7 +290,7 @@ void nlmclnt_release_host(struct nlm_host *host) | |||
290 | 290 | ||
291 | WARN_ON_ONCE(host->h_server); | 291 | WARN_ON_ONCE(host->h_server); |
292 | 292 | ||
293 | if (atomic_dec_and_test(&host->h_count)) { | 293 | if (refcount_dec_and_test(&host->h_count)) { |
294 | WARN_ON_ONCE(!list_empty(&host->h_lockowners)); | 294 | WARN_ON_ONCE(!list_empty(&host->h_lockowners)); |
295 | WARN_ON_ONCE(!list_empty(&host->h_granted)); | 295 | WARN_ON_ONCE(!list_empty(&host->h_granted)); |
296 | WARN_ON_ONCE(!list_empty(&host->h_reclaim)); | 296 | WARN_ON_ONCE(!list_empty(&host->h_reclaim)); |
@@ -410,7 +410,7 @@ void nlmsvc_release_host(struct nlm_host *host) | |||
410 | dprintk("lockd: release server host %s\n", host->h_name); | 410 | dprintk("lockd: release server host %s\n", host->h_name); |
411 | 411 | ||
412 | WARN_ON_ONCE(!host->h_server); | 412 | WARN_ON_ONCE(!host->h_server); |
413 | atomic_dec(&host->h_count); | 413 | refcount_dec(&host->h_count); |
414 | } | 414 | } |
415 | 415 | ||
416 | /* | 416 | /* |
@@ -504,7 +504,7 @@ struct nlm_host * nlm_get_host(struct nlm_host *host) | |||
504 | { | 504 | { |
505 | if (host) { | 505 | if (host) { |
506 | dprintk("lockd: get host %s\n", host->h_name); | 506 | dprintk("lockd: get host %s\n", host->h_name); |
507 | atomic_inc(&host->h_count); | 507 | refcount_inc(&host->h_count); |
508 | host->h_expires = jiffies + NLM_HOST_EXPIRE; | 508 | host->h_expires = jiffies + NLM_HOST_EXPIRE; |
509 | } | 509 | } |
510 | return host; | 510 | return host; |
@@ -593,7 +593,7 @@ static void nlm_complain_hosts(struct net *net) | |||
593 | if (net && host->net != net) | 593 | if (net && host->net != net) |
594 | continue; | 594 | continue; |
595 | dprintk(" %s (cnt %d use %d exp %ld net %x)\n", | 595 | dprintk(" %s (cnt %d use %d exp %ld net %x)\n", |
596 | host->h_name, atomic_read(&host->h_count), | 596 | host->h_name, refcount_read(&host->h_count), |
597 | host->h_inuse, host->h_expires, host->net->ns.inum); | 597 | host->h_inuse, host->h_expires, host->net->ns.inum); |
598 | } | 598 | } |
599 | } | 599 | } |
@@ -662,11 +662,11 @@ nlm_gc_hosts(struct net *net) | |||
662 | for_each_host_safe(host, next, chain, nlm_server_hosts) { | 662 | for_each_host_safe(host, next, chain, nlm_server_hosts) { |
663 | if (net && host->net != net) | 663 | if (net && host->net != net) |
664 | continue; | 664 | continue; |
665 | if (atomic_read(&host->h_count) || host->h_inuse | 665 | if (refcount_read(&host->h_count) || host->h_inuse |
666 | || time_before(jiffies, host->h_expires)) { | 666 | || time_before(jiffies, host->h_expires)) { |
667 | dprintk("nlm_gc_hosts skipping %s " | 667 | dprintk("nlm_gc_hosts skipping %s " |
668 | "(cnt %d use %d exp %ld net %x)\n", | 668 | "(cnt %d use %d exp %ld net %x)\n", |
669 | host->h_name, atomic_read(&host->h_count), | 669 | host->h_name, refcount_read(&host->h_count), |
670 | host->h_inuse, host->h_expires, | 670 | host->h_inuse, host->h_expires, |
671 | host->net->ns.inum); | 671 | host->net->ns.inum); |
672 | continue; | 672 | continue; |