aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Kent <ikent@redhat.com>2016-11-23 16:03:42 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-12-03 20:51:48 -0500
commitdd36a882e7ade2c642f8711426ad8e4b7009aaae (patch)
tree3d64641e78b2926cb8089494ccdb10f19e033f40
parent74f504cff50b918f8ec2762b1513ae755da56a95 (diff)
autofs: change autofs4_wait() to take struct path
In order to use the functions path_is_mountpoint() and path_has_submounts() autofs needs to pass a struct path in several places. Now change autofs4_wait() to take a struct path instead of a struct dentry. Link: http://lkml.kernel.org/r/20161011053413.27645.84666.stgit@pluto.themaw.net Signed-off-by: Ian Kent <raven@themaw.net> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Omar Sandoval <osandov@osandov.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/autofs4/autofs_i.h3
-rw-r--r--fs/autofs4/expire.c5
-rw-r--r--fs/autofs4/root.c16
-rw-r--r--fs/autofs4/waitq.c3
4 files changed, 15 insertions, 12 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 45311525ad89..c885daae68c8 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -217,7 +217,8 @@ static inline int autofs_prepare_pipe(struct file *pipe)
217 217
218/* Queue management functions */ 218/* Queue management functions */
219 219
220int autofs4_wait(struct autofs_sb_info *, struct dentry *, enum autofs_notify); 220int autofs4_wait(struct autofs_sb_info *,
221 const struct path *, enum autofs_notify);
221int autofs4_wait_release(struct autofs_sb_info *, autofs_wqt_t, int); 222int autofs4_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
222void autofs4_catatonic_mode(struct autofs_sb_info *); 223void autofs4_catatonic_mode(struct autofs_sb_info *);
223 224
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 6ba6107e6102..9c352da24444 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -526,7 +526,7 @@ retry:
526 526
527 pr_debug("waiting for expire %p name=%pd\n", dentry, dentry); 527 pr_debug("waiting for expire %p name=%pd\n", dentry, dentry);
528 528
529 status = autofs4_wait(sbi, dentry, NFY_NONE); 529 status = autofs4_wait(sbi, path, NFY_NONE);
530 wait_for_completion(&ino->expire_complete); 530 wait_for_completion(&ino->expire_complete);
531 531
532 pr_debug("expire done status=%d\n", status); 532 pr_debug("expire done status=%d\n", status);
@@ -593,11 +593,12 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
593 593
594 if (dentry) { 594 if (dentry) {
595 struct autofs_info *ino = autofs4_dentry_ino(dentry); 595 struct autofs_info *ino = autofs4_dentry_ino(dentry);
596 struct path path = { .mnt = mnt, .dentry = dentry };
596 597
597 /* This is synchronous because it makes the daemon a 598 /* This is synchronous because it makes the daemon a
598 * little easier 599 * little easier
599 */ 600 */
600 ret = autofs4_wait(sbi, dentry, NFY_EXPIRE); 601 ret = autofs4_wait(sbi, &path, NFY_EXPIRE);
601 602
602 spin_lock(&sbi->fs_lock); 603 spin_lock(&sbi->fs_lock);
603 /* avoid rapid-fire expire attempts if expiry fails */ 604 /* avoid rapid-fire expire attempts if expiry fails */
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 6b06337ca9fc..0e9881552881 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -269,17 +269,17 @@ next:
269 return NULL; 269 return NULL;
270} 270}
271 271
272static int autofs4_mount_wait(struct dentry *dentry, bool rcu_walk) 272static int autofs4_mount_wait(const struct path *path, bool rcu_walk)
273{ 273{
274 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); 274 struct autofs_sb_info *sbi = autofs4_sbi(path->dentry->d_sb);
275 struct autofs_info *ino = autofs4_dentry_ino(dentry); 275 struct autofs_info *ino = autofs4_dentry_ino(path->dentry);
276 int status = 0; 276 int status = 0;
277 277
278 if (ino->flags & AUTOFS_INF_PENDING) { 278 if (ino->flags & AUTOFS_INF_PENDING) {
279 if (rcu_walk) 279 if (rcu_walk)
280 return -ECHILD; 280 return -ECHILD;
281 pr_debug("waiting for mount name=%pd\n", dentry); 281 pr_debug("waiting for mount name=%pd\n", path->dentry);
282 status = autofs4_wait(sbi, dentry, NFY_MOUNT); 282 status = autofs4_wait(sbi, path, NFY_MOUNT);
283 pr_debug("mount wait done status=%d\n", status); 283 pr_debug("mount wait done status=%d\n", status);
284 } 284 }
285 ino->last_used = jiffies; 285 ino->last_used = jiffies;
@@ -364,7 +364,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
364 spin_lock(&sbi->fs_lock); 364 spin_lock(&sbi->fs_lock);
365 if (ino->flags & AUTOFS_INF_PENDING) { 365 if (ino->flags & AUTOFS_INF_PENDING) {
366 spin_unlock(&sbi->fs_lock); 366 spin_unlock(&sbi->fs_lock);
367 status = autofs4_mount_wait(dentry, 0); 367 status = autofs4_mount_wait(path, 0);
368 if (status) 368 if (status)
369 return ERR_PTR(status); 369 return ERR_PTR(status);
370 goto done; 370 goto done;
@@ -405,7 +405,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
405 } 405 }
406 ino->flags |= AUTOFS_INF_PENDING; 406 ino->flags |= AUTOFS_INF_PENDING;
407 spin_unlock(&sbi->fs_lock); 407 spin_unlock(&sbi->fs_lock);
408 status = autofs4_mount_wait(dentry, 0); 408 status = autofs4_mount_wait(path, 0);
409 spin_lock(&sbi->fs_lock); 409 spin_lock(&sbi->fs_lock);
410 ino->flags &= ~AUTOFS_INF_PENDING; 410 ino->flags &= ~AUTOFS_INF_PENDING;
411 if (status) { 411 if (status) {
@@ -447,7 +447,7 @@ static int autofs4_d_manage(const struct path *path, bool rcu_walk)
447 * This dentry may be under construction so wait on mount 447 * This dentry may be under construction so wait on mount
448 * completion. 448 * completion.
449 */ 449 */
450 status = autofs4_mount_wait(dentry, rcu_walk); 450 status = autofs4_mount_wait(path, rcu_walk);
451 if (status) 451 if (status)
452 return status; 452 return status;
453 453
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index e44271dfceb6..38ef973f80e9 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -345,8 +345,9 @@ static int validate_request(struct autofs_wait_queue **wait,
345} 345}
346 346
347int autofs4_wait(struct autofs_sb_info *sbi, 347int autofs4_wait(struct autofs_sb_info *sbi,
348 struct dentry *dentry, enum autofs_notify notify) 348 const struct path *path, enum autofs_notify notify)
349{ 349{
350 struct dentry *dentry = path->dentry;
350 struct autofs_wait_queue *wq; 351 struct autofs_wait_queue *wq;
351 struct qstr qstr; 352 struct qstr qstr;
352 char *name; 353 char *name;