Lines Matching refs:dentry

11 static inline int autofs_can_expire(struct dentry *dentry,  in autofs_can_expire()  argument
14 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_can_expire()
30 struct dentry *dentry, unsigned int how) in autofs_mount_busy() argument
32 struct dentry *top = dentry; in autofs_mount_busy()
33 struct path path = {.mnt = mnt, .dentry = dentry}; in autofs_mount_busy()
36 pr_debug("dentry %p %pd\n", dentry, dentry); in autofs_mount_busy()
43 if (is_autofs_dentry(path.dentry)) { in autofs_mount_busy()
44 struct autofs_sb_info *sbi = autofs_sbi(path.dentry->d_sb); in autofs_mount_busy()
74 static struct dentry *positive_after(struct dentry *p, struct dentry *child) in positive_after()
79 child = list_first_entry(&p->d_subdirs, struct dentry, d_child); in positive_after()
97 static struct dentry *get_next_positive_subdir(struct dentry *prev, in get_next_positive_subdir()
98 struct dentry *root) in get_next_positive_subdir()
101 struct dentry *q; in get_next_positive_subdir()
115 static struct dentry *get_next_positive_dentry(struct dentry *prev, in get_next_positive_dentry()
116 struct dentry *root) in get_next_positive_dentry()
119 struct dentry *p = prev, *ret = NULL, *d = NULL; in get_next_positive_dentry()
127 struct dentry *parent; in get_next_positive_dentry()
151 struct dentry *top, in autofs_direct_busy()
183 struct dentry *top, in autofs_tree_busy()
188 struct dentry *p; in autofs_tree_busy()
241 static struct dentry *autofs_check_leaves(struct vfsmount *mnt, in autofs_check_leaves()
242 struct dentry *parent, in autofs_check_leaves()
246 struct dentry *p; in autofs_check_leaves()
274 static struct dentry *autofs_expire_direct(struct super_block *sb, in autofs_expire_direct()
279 struct dentry *root = dget(sb->s_root); in autofs_expire_direct()
321 static struct dentry *should_expire(struct dentry *dentry, in should_expire() argument
326 struct autofs_info *ino = autofs_dentry_ino(dentry); in should_expire()
339 if (d_mountpoint(dentry)) { in should_expire()
340 pr_debug("checking mountpoint %p %pd\n", dentry, dentry); in should_expire()
343 if (autofs_mount_busy(mnt, dentry, how)) in should_expire()
350 return dentry; in should_expire()
353 if (autofs_can_expire(dentry, timeout, how)) in should_expire()
354 return dentry; in should_expire()
358 if (d_is_symlink(dentry)) { in should_expire()
359 pr_debug("checking symlink %p %pd\n", dentry, dentry); in should_expire()
363 return dentry; in should_expire()
369 if (autofs_can_expire(dentry, timeout, how)) in should_expire()
370 return dentry; in should_expire()
383 if (d_count(dentry) > ino_count) in should_expire()
387 if (!autofs_tree_busy(mnt, dentry, timeout, how)) in should_expire()
388 return dentry; in should_expire()
394 struct dentry *expired; in should_expire()
400 if (d_count(dentry) > ino_count) in should_expire()
404 expired = autofs_check_leaves(mnt, dentry, timeout, how); in should_expire()
406 if (expired == dentry) in should_expire()
407 dput(dentry); in should_expire()
420 static struct dentry *autofs_expire_indirect(struct super_block *sb, in autofs_expire_indirect()
426 struct dentry *root = sb->s_root; in autofs_expire_indirect()
427 struct dentry *dentry; in autofs_expire_indirect() local
428 struct dentry *expired; in autofs_expire_indirect()
429 struct dentry *found; in autofs_expire_indirect()
437 dentry = NULL; in autofs_expire_indirect()
438 while ((dentry = get_next_positive_subdir(dentry, root))) { in autofs_expire_indirect()
440 ino = autofs_dentry_ino(dentry); in autofs_expire_indirect()
447 expired = should_expire(dentry, mnt, timeout, how); in autofs_expire_indirect()
467 if (expired != dentry) in autofs_expire_indirect()
468 dput(dentry); in autofs_expire_indirect()
476 if (expired != dentry) in autofs_expire_indirect()
491 struct dentry *dentry = path->dentry; in autofs_expire_wait() local
492 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_expire_wait()
493 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_expire_wait()
518 pr_debug("waiting for expire %p name=%pd\n", dentry, dentry); in autofs_expire_wait()
525 if (d_unhashed(dentry)) in autofs_expire_wait()
543 struct dentry *dentry; in autofs_expire_run() local
551 dentry = autofs_expire_indirect(sb, mnt, sbi, 0); in autofs_expire_run()
552 if (!dentry) in autofs_expire_run()
555 pkt.len = dentry->d_name.len; in autofs_expire_run()
556 memcpy(pkt.name, dentry->d_name.name, pkt.len); in autofs_expire_run()
563 ino = autofs_dentry_ino(dentry); in autofs_expire_run()
570 dput(dentry); in autofs_expire_run()
578 struct dentry *dentry; in autofs_do_expire_multi() local
582 dentry = autofs_expire_direct(sb, mnt, sbi, how); in autofs_do_expire_multi()
584 dentry = autofs_expire_indirect(sb, mnt, sbi, how); in autofs_do_expire_multi()
586 if (dentry) { in autofs_do_expire_multi()
587 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_do_expire_multi()
588 const struct path path = { .mnt = mnt, .dentry = dentry }; in autofs_do_expire_multi()
601 dput(dentry); in autofs_do_expire_multi()