NLM: sem to mutex conversion
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
3134cbec5e
commit
5046791417
2 changed files with 5 additions and 5 deletions
|
@ -112,7 +112,7 @@ nlm_lookup_host(int server, struct sockaddr_in *sin,
|
||||||
host->h_version = version;
|
host->h_version = version;
|
||||||
host->h_proto = proto;
|
host->h_proto = proto;
|
||||||
host->h_rpcclnt = NULL;
|
host->h_rpcclnt = NULL;
|
||||||
init_MUTEX(&host->h_sema);
|
mutex_init(&host->h_mutex);
|
||||||
host->h_nextrebind = jiffies + NLM_HOST_REBIND;
|
host->h_nextrebind = jiffies + NLM_HOST_REBIND;
|
||||||
host->h_expires = jiffies + NLM_HOST_EXPIRE;
|
host->h_expires = jiffies + NLM_HOST_EXPIRE;
|
||||||
atomic_set(&host->h_count, 1);
|
atomic_set(&host->h_count, 1);
|
||||||
|
@ -172,7 +172,7 @@ nlm_bind_host(struct nlm_host *host)
|
||||||
(unsigned)ntohl(host->h_addr.sin_addr.s_addr));
|
(unsigned)ntohl(host->h_addr.sin_addr.s_addr));
|
||||||
|
|
||||||
/* Lock host handle */
|
/* Lock host handle */
|
||||||
down(&host->h_sema);
|
mutex_lock(&host->h_mutex);
|
||||||
|
|
||||||
/* If we've already created an RPC client, check whether
|
/* If we've already created an RPC client, check whether
|
||||||
* RPC rebind is required
|
* RPC rebind is required
|
||||||
|
@ -204,12 +204,12 @@ nlm_bind_host(struct nlm_host *host)
|
||||||
host->h_rpcclnt = clnt;
|
host->h_rpcclnt = clnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
up(&host->h_sema);
|
mutex_unlock(&host->h_mutex);
|
||||||
return clnt;
|
return clnt;
|
||||||
|
|
||||||
forgetit:
|
forgetit:
|
||||||
printk("lockd: couldn't create RPC handle for %s\n", host->h_name);
|
printk("lockd: couldn't create RPC handle for %s\n", host->h_name);
|
||||||
up(&host->h_sema);
|
mutex_unlock(&host->h_mutex);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct nlm_host {
|
||||||
u32 h_nsmstate; /* true remote NSM state */
|
u32 h_nsmstate; /* true remote NSM state */
|
||||||
u32 h_pidcount; /* Pseudopids */
|
u32 h_pidcount; /* Pseudopids */
|
||||||
atomic_t h_count; /* reference count */
|
atomic_t h_count; /* reference count */
|
||||||
struct semaphore h_sema; /* mutex for pmap binding */
|
struct mutex h_mutex; /* mutex for pmap binding */
|
||||||
unsigned long h_nextrebind; /* next portmap call */
|
unsigned long h_nextrebind; /* next portmap call */
|
||||||
unsigned long h_expires; /* eligible for GC */
|
unsigned long h_expires; /* eligible for GC */
|
||||||
struct list_head h_lockowners; /* Lockowners for the client */
|
struct list_head h_lockowners; /* Lockowners for the client */
|
||||||
|
|
Loading…
Add table
Reference in a new issue