Lines Matching refs:parent
109 static inline struct hlist_bl_head *in_lookup_hash(const struct dentry *parent, in in_lookup_hash() argument
112 hash += (unsigned long) parent / L1_CACHE_BYTES; in in_lookup_hash()
512 static inline void dentry_unlist(struct dentry *dentry, struct dentry *parent) in dentry_unlist() argument
542 while (dentry->d_child.next != &parent->d_subdirs) { in dentry_unlist()
552 struct dentry *parent = NULL; in __dentry_kill() local
555 parent = dentry->d_parent; in __dentry_kill()
575 dentry_unlist(dentry, parent); in __dentry_kill()
576 if (parent) in __dentry_kill()
577 spin_unlock(&parent->d_lock); in __dentry_kill()
599 struct dentry *parent; in __lock_parent() local
603 parent = READ_ONCE(dentry->d_parent); in __lock_parent()
604 spin_lock(&parent->d_lock); in __lock_parent()
613 if (unlikely(parent != dentry->d_parent)) { in __lock_parent()
614 spin_unlock(&parent->d_lock); in __lock_parent()
618 if (parent != dentry) in __lock_parent()
621 parent = NULL; in __lock_parent()
622 return parent; in __lock_parent()
627 struct dentry *parent = dentry->d_parent; in lock_parent() local
630 if (likely(spin_trylock(&parent->d_lock))) in lock_parent()
631 return parent; in lock_parent()
668 struct dentry *parent = NULL; in dentry_kill() local
674 parent = dentry->d_parent; in dentry_kill()
675 if (unlikely(!spin_trylock(&parent->d_lock))) { in dentry_kill()
676 parent = __lock_parent(dentry); in dentry_kill()
680 if (parent) in dentry_kill()
681 spin_unlock(&parent->d_lock); in dentry_kill()
687 return parent; in dentry_kill()
693 parent = lock_parent(dentry); in dentry_kill()
699 return parent; in dentry_kill()
704 if (parent) in dentry_kill()
705 spin_unlock(&parent->d_lock); in dentry_kill()
1029 struct dentry *parent = lock_parent(dentry); in d_prune_aliases() local
1032 dput(parent); in d_prune_aliases()
1035 if (parent) in d_prune_aliases()
1036 spin_unlock(&parent->d_lock); in d_prune_aliases()
1058 struct dentry *parent; in shrink_lock_dentry() local
1075 parent = dentry->d_parent; in shrink_lock_dentry()
1076 if (IS_ROOT(dentry) || likely(spin_trylock(&parent->d_lock))) in shrink_lock_dentry()
1080 spin_lock(&parent->d_lock); in shrink_lock_dentry()
1081 if (unlikely(parent != dentry->d_parent)) { in shrink_lock_dentry()
1082 spin_unlock(&parent->d_lock); in shrink_lock_dentry()
1089 spin_unlock(&parent->d_lock); in shrink_lock_dentry()
1099 struct dentry *dentry, *parent; in shrink_dentry_list() local
1117 parent = dentry->d_parent; in shrink_dentry_list()
1118 if (parent != dentry) in shrink_dentry_list()
1119 __dput_to_list(parent, list); in shrink_dentry_list()
1267 static void d_walk(struct dentry *parent, void *data, in d_walk() argument
1278 this_parent = parent; in d_walk()
1334 if (this_parent != parent) { in d_walk()
1400 int path_has_submounts(const struct path *parent) in path_has_submounts() argument
1402 struct check_mount data = { .mnt = parent->mnt, .mounted = 0 }; in path_has_submounts()
1405 d_walk(parent->dentry, &data, path_check_mount); in path_has_submounts()
1538 void shrink_dcache_parent(struct dentry *parent) in shrink_dcache_parent() argument
1541 struct select_data data = {.start = parent}; in shrink_dcache_parent()
1544 d_walk(parent, &data, select_collect); in shrink_dcache_parent()
1555 d_walk(parent, &data, select_collect2); in shrink_dcache_parent()
1557 struct dentry *parent; in shrink_dcache_parent() local
1564 parent = data.victim->d_parent; in shrink_dcache_parent()
1565 if (parent != data.victim) in shrink_dcache_parent()
1566 __dput_to_list(parent, &data.dispose); in shrink_dcache_parent()
1765 struct dentry *d_alloc(struct dentry * parent, const struct qstr *name) in d_alloc() argument
1767 struct dentry *dentry = __d_alloc(parent->d_sb, name); in d_alloc()
1770 spin_lock(&parent->d_lock); in d_alloc()
1775 __dget_dlock(parent); in d_alloc()
1776 dentry->d_parent = parent; in d_alloc()
1777 list_add(&dentry->d_child, &parent->d_subdirs); in d_alloc()
1778 spin_unlock(&parent->d_lock); in d_alloc()
1790 struct dentry *d_alloc_cursor(struct dentry * parent) in d_alloc_cursor() argument
1792 struct dentry *dentry = d_alloc_anon(parent->d_sb); in d_alloc_cursor()
1795 dentry->d_parent = dget(parent); in d_alloc_cursor()
1823 struct dentry *d_alloc_name(struct dentry *parent, const char *name) in d_alloc_name() argument
1828 q.hash_len = hashlen_string(parent, name); in d_alloc_name()
1829 return d_alloc(parent, &q); in d_alloc_name()
2170 const struct dentry *parent, in d_same_name() argument
2173 if (likely(!(parent->d_flags & DCACHE_OP_COMPARE))) { in d_same_name()
2178 return parent->d_op->d_compare(dentry, in d_same_name()
2212 struct dentry *__d_lookup_rcu(const struct dentry *parent, in __d_lookup_rcu() argument
2264 if (dentry->d_parent != parent) in __d_lookup_rcu()
2269 if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) { in __d_lookup_rcu()
2281 if (parent->d_op->d_compare(dentry, in __d_lookup_rcu()
2307 struct dentry *d_lookup(const struct dentry *parent, const struct qstr *name) in d_lookup() argument
2314 dentry = __d_lookup(parent, name); in d_lookup()
2337 struct dentry *__d_lookup(const struct dentry *parent, const struct qstr *name) in __d_lookup() argument
2373 if (dentry->d_parent != parent) in __d_lookup()
2378 if (!d_same_name(dentry, parent, name)) in __d_lookup()
2512 struct dentry *d_alloc_parallel(struct dentry *parent, in d_alloc_parallel() argument
2517 struct hlist_bl_head *b = in_lookup_hash(parent, hash); in d_alloc_parallel()
2519 struct dentry *new = d_alloc(parent, name); in d_alloc_parallel()
2528 seq = smp_load_acquire(&parent->d_inode->i_dir_seq); in d_alloc_parallel()
2530 dentry = __d_lookup_rcu(parent, name, &d_seq); in d_alloc_parallel()
2556 if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) { in d_alloc_parallel()
2571 if (dentry->d_parent != parent) in d_alloc_parallel()
2573 if (!d_same_name(dentry, parent, name)) in d_alloc_parallel()
2597 if (unlikely(dentry->d_parent != parent)) in d_alloc_parallel()
2601 if (unlikely(!d_same_name(dentry, parent, name))) in d_alloc_parallel()
3107 void d_genocide(struct dentry *parent) in d_genocide() argument
3109 d_walk(parent, parent, d_genocide_kill); in d_genocide()