diff options
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r-- | fs/lockd/host.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 729ac427d359..38b0e8a1aec0 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -112,11 +112,12 @@ nlm_lookup_host(int server, struct sockaddr_in *sin, | |||
112 | host->h_version = version; | 112 | host->h_version = version; |
113 | host->h_proto = proto; | 113 | host->h_proto = proto; |
114 | host->h_rpcclnt = NULL; | 114 | host->h_rpcclnt = NULL; |
115 | init_MUTEX(&host->h_sema); | 115 | mutex_init(&host->h_mutex); |
116 | host->h_nextrebind = jiffies + NLM_HOST_REBIND; | 116 | host->h_nextrebind = jiffies + NLM_HOST_REBIND; |
117 | host->h_expires = jiffies + NLM_HOST_EXPIRE; | 117 | host->h_expires = jiffies + NLM_HOST_EXPIRE; |
118 | atomic_set(&host->h_count, 1); | 118 | atomic_set(&host->h_count, 1); |
119 | init_waitqueue_head(&host->h_gracewait); | 119 | init_waitqueue_head(&host->h_gracewait); |
120 | init_rwsem(&host->h_rwsem); | ||
120 | host->h_state = 0; /* pseudo NSM state */ | 121 | host->h_state = 0; /* pseudo NSM state */ |
121 | host->h_nsmstate = 0; /* real NSM state */ | 122 | host->h_nsmstate = 0; /* real NSM state */ |
122 | host->h_server = server; | 123 | host->h_server = server; |
@@ -172,7 +173,7 @@ nlm_bind_host(struct nlm_host *host) | |||
172 | (unsigned)ntohl(host->h_addr.sin_addr.s_addr)); | 173 | (unsigned)ntohl(host->h_addr.sin_addr.s_addr)); |
173 | 174 | ||
174 | /* Lock host handle */ | 175 | /* Lock host handle */ |
175 | down(&host->h_sema); | 176 | mutex_lock(&host->h_mutex); |
176 | 177 | ||
177 | /* If we've already created an RPC client, check whether | 178 | /* If we've already created an RPC client, check whether |
178 | * RPC rebind is required | 179 | * RPC rebind is required |
@@ -204,12 +205,12 @@ nlm_bind_host(struct nlm_host *host) | |||
204 | host->h_rpcclnt = clnt; | 205 | host->h_rpcclnt = clnt; |
205 | } | 206 | } |
206 | 207 | ||
207 | up(&host->h_sema); | 208 | mutex_unlock(&host->h_mutex); |
208 | return clnt; | 209 | return clnt; |
209 | 210 | ||
210 | forgetit: | 211 | forgetit: |
211 | printk("lockd: couldn't create RPC handle for %s\n", host->h_name); | 212 | printk("lockd: couldn't create RPC handle for %s\n", host->h_name); |
212 | up(&host->h_sema); | 213 | mutex_unlock(&host->h_mutex); |
213 | return NULL; | 214 | return NULL; |
214 | } | 215 | } |
215 | 216 | ||