aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/waitq.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4/waitq.c')
-rw-r--r--fs/autofs4/waitq.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 394ff36ef8f1..be78e9378c03 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -178,7 +178,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
178 return -ENOENT; 178 return -ENOENT;
179 } 179 }
180 180
181 if (down_interruptible(&sbi->wq_sem)) { 181 if (mutex_lock_interruptible(&sbi->wq_mutex)) {
182 kfree(name); 182 kfree(name);
183 return -EINTR; 183 return -EINTR;
184 } 184 }
@@ -194,7 +194,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
194 /* Can't wait for an expire if there's no mount */ 194 /* Can't wait for an expire if there's no mount */
195 if (notify == NFY_NONE && !d_mountpoint(dentry)) { 195 if (notify == NFY_NONE && !d_mountpoint(dentry)) {
196 kfree(name); 196 kfree(name);
197 up(&sbi->wq_sem); 197 mutex_unlock(&sbi->wq_mutex);
198 return -ENOENT; 198 return -ENOENT;
199 } 199 }
200 200
@@ -202,7 +202,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
202 wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL); 202 wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL);
203 if ( !wq ) { 203 if ( !wq ) {
204 kfree(name); 204 kfree(name);
205 up(&sbi->wq_sem); 205 mutex_unlock(&sbi->wq_mutex);
206 return -ENOMEM; 206 return -ENOMEM;
207 } 207 }
208 208
@@ -218,10 +218,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
218 wq->status = -EINTR; /* Status return if interrupted */ 218 wq->status = -EINTR; /* Status return if interrupted */
219 atomic_set(&wq->wait_ctr, 2); 219 atomic_set(&wq->wait_ctr, 2);
220 atomic_set(&wq->notified, 1); 220 atomic_set(&wq->notified, 1);
221 up(&sbi->wq_sem); 221 mutex_unlock(&sbi->wq_mutex);
222 } else { 222 } else {
223 atomic_inc(&wq->wait_ctr); 223 atomic_inc(&wq->wait_ctr);
224 up(&sbi->wq_sem); 224 mutex_unlock(&sbi->wq_mutex);
225 kfree(name); 225 kfree(name);
226 DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d", 226 DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d",
227 (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify); 227 (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
@@ -282,19 +282,19 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok
282{ 282{
283 struct autofs_wait_queue *wq, **wql; 283 struct autofs_wait_queue *wq, **wql;
284 284
285 down(&sbi->wq_sem); 285 mutex_lock(&sbi->wq_mutex);
286 for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) { 286 for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) {
287 if ( wq->wait_queue_token == wait_queue_token ) 287 if ( wq->wait_queue_token == wait_queue_token )
288 break; 288 break;
289 } 289 }
290 290
291 if ( !wq ) { 291 if ( !wq ) {
292 up(&sbi->wq_sem); 292 mutex_unlock(&sbi->wq_mutex);
293 return -EINVAL; 293 return -EINVAL;
294 } 294 }
295 295
296 *wql = wq->next; /* Unlink from chain */ 296 *wql = wq->next; /* Unlink from chain */
297 up(&sbi->wq_sem); 297 mutex_unlock(&sbi->wq_mutex);
298 kfree(wq->name); 298 kfree(wq->name);
299 wq->name = NULL; /* Do not wait on this queue */ 299 wq->name = NULL; /* Do not wait on this queue */
300 300