• Home
  • Raw
  • Download

Lines Matching refs:parent

47 	return strlcpy(buf, kn->parent ? kn->name : "/", buflen);  in kernfs_name_locked()
55 while (to->parent && to != from) { in kernfs_depth()
57 to = to->parent; in kernfs_depth()
75 a = a->parent; in kernfs_common_ancestor()
79 b = b->parent; in kernfs_common_ancestor()
85 b = b->parent; in kernfs_common_ancestor()
86 a = a->parent; in kernfs_common_ancestor()
159 kn = kn->parent; in kernfs_path_from_node_locked()
281 struct kernfs_node *parent; in kernfs_get_parent() local
285 parent = kn->parent; in kernfs_get_parent()
286 kernfs_get(parent); in kernfs_get_parent()
289 return parent; in kernfs_get_parent()
350 struct rb_node **node = &kn->parent->dir.children.rb_node; in kernfs_link_sibling()
351 struct rb_node *parent = NULL; in kernfs_link_sibling() local
358 parent = *node; in kernfs_link_sibling()
369 rb_link_node(&kn->rb, parent, node); in kernfs_link_sibling()
370 rb_insert_color(&kn->rb, &kn->parent->dir.children); in kernfs_link_sibling()
374 kn->parent->dir.subdirs++; in kernfs_link_sibling()
396 kn->parent->dir.subdirs--; in kernfs_unlink_sibling()
398 rb_erase(&kn->rb, &kn->parent->dir.children); in kernfs_unlink_sibling()
508 struct kernfs_node *parent; in kernfs_put() local
519 parent = kn->parent; in kernfs_put()
523 parent ? parent->name : "", kn->name, atomic_read(&kn->active)); in kernfs_put()
539 kn = parent; in kernfs_put()
570 if (kernfs_dentry_node(dentry->d_parent) != kn->parent) in kernfs_dop_revalidate()
578 if (kn->parent && kernfs_ns_enabled(kn->parent) && in kernfs_dop_revalidate()
614 struct kernfs_node *parent, in __kernfs_new_node() argument
665 if (parent) { in __kernfs_new_node()
666 ret = security_kernfs_init_security(parent, kn); in __kernfs_new_node()
682 struct kernfs_node *kernfs_new_node(struct kernfs_node *parent, in kernfs_new_node() argument
689 kn = __kernfs_new_node(kernfs_root(parent), parent, in kernfs_new_node()
692 kernfs_get(parent); in kernfs_new_node()
693 kn->parent = parent; in kernfs_new_node()
762 struct kernfs_node *parent = kn->parent; in kernfs_add_one() local
770 has_ns = kernfs_ns_enabled(parent); in kernfs_add_one()
772 has_ns ? "required" : "invalid", parent->name, kn->name)) in kernfs_add_one()
775 if (kernfs_type(parent) != KERNFS_DIR) in kernfs_add_one()
779 if (parent->flags & KERNFS_EMPTY_DIR) in kernfs_add_one()
782 if ((parent->flags & KERNFS_ACTIVATED) && !kernfs_active(parent)) in kernfs_add_one()
792 ps_iattr = parent->iattr; in kernfs_add_one()
825 static struct kernfs_node *kernfs_find_ns(struct kernfs_node *parent, in kernfs_find_ns() argument
829 struct rb_node *node = parent->dir.children.rb_node; in kernfs_find_ns()
830 bool has_ns = kernfs_ns_enabled(parent); in kernfs_find_ns()
837 has_ns ? "required" : "invalid", parent->name, name); in kernfs_find_ns()
858 static struct kernfs_node *kernfs_walk_ns(struct kernfs_node *parent, in kernfs_walk_ns() argument
879 while ((name = strsep(&p, "/")) && parent) { in kernfs_walk_ns()
882 parent = kernfs_find_ns(parent, name, ns); in kernfs_walk_ns()
887 return parent; in kernfs_walk_ns()
900 struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, in kernfs_find_and_get_ns() argument
906 kn = kernfs_find_ns(parent, name, ns); in kernfs_find_and_get_ns()
924 struct kernfs_node *kernfs_walk_and_get_ns(struct kernfs_node *parent, in kernfs_walk_and_get_ns() argument
930 kn = kernfs_walk_ns(parent, path, ns); in kernfs_walk_and_get_ns()
1017 struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent, in kernfs_create_dir_ns() argument
1026 kn = kernfs_new_node(parent, name, mode | S_IFDIR, in kernfs_create_dir_ns()
1031 kn->dir.root = parent->dir.root; in kernfs_create_dir_ns()
1051 struct kernfs_node *kernfs_create_empty_dir(struct kernfs_node *parent, in kernfs_create_empty_dir() argument
1058 kn = kernfs_new_node(parent, name, S_IRUGO|S_IXUGO|S_IFDIR, in kernfs_create_empty_dir()
1064 kn->dir.root = parent->dir.root; in kernfs_create_empty_dir()
1082 struct kernfs_node *parent = dir->i_private; in kernfs_iop_lookup() local
1089 if (kernfs_ns_enabled(parent)) in kernfs_iop_lookup()
1092 kn = kernfs_find_ns(parent, dentry->d_name.name, ns); in kernfs_iop_lookup()
1117 struct kernfs_node *parent = dir->i_private; in kernfs_iop_mkdir() local
1118 struct kernfs_syscall_ops *scops = kernfs_root(parent)->syscall_ops; in kernfs_iop_mkdir()
1124 if (!kernfs_get_active(parent)) in kernfs_iop_mkdir()
1127 ret = scops->mkdir(parent, dentry->d_name.name, mode); in kernfs_iop_mkdir()
1129 kernfs_put_active(parent); in kernfs_iop_mkdir()
1245 return pos->parent; in kernfs_next_descendant_post()
1272 WARN_ON_ONCE(pos->parent && RB_EMPTY_NODE(&pos->rb)); in kernfs_activate()
1293 if (!kn || (kn->parent && RB_EMPTY_NODE(&kn->rb))) in __kernfs_remove()
1331 if (!pos->parent || kernfs_unlink_sibling(pos)) { in __kernfs_remove()
1333 pos->parent ? pos->parent->iattr : NULL; in __kernfs_remove()
1501 int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, in kernfs_remove_by_name_ns() argument
1506 if (!parent) { in kernfs_remove_by_name_ns()
1514 kn = kernfs_find_ns(parent, name, ns); in kernfs_remove_by_name_ns()
1541 if (!kn->parent) in kernfs_rename_ns()
1552 if ((kn->parent == new_parent) && (kn->ns == new_ns) && in kernfs_rename_ns()
1579 old_parent = kn->parent; in kernfs_rename_ns()
1580 kn->parent = new_parent; in kernfs_rename_ns()
1615 struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos) in kernfs_dir_pos() argument
1619 pos->parent == parent && hash == pos->hash; in kernfs_dir_pos()
1625 struct rb_node *node = parent->dir.children.rb_node; in kernfs_dir_pos()
1649 struct kernfs_node *parent, ino_t ino, struct kernfs_node *pos) in kernfs_dir_next_pos() argument
1651 pos = kernfs_dir_pos(ns, parent, ino, pos); in kernfs_dir_next_pos()
1667 struct kernfs_node *parent = kernfs_dentry_node(dentry); in kernfs_fop_readdir() local
1675 if (kernfs_ns_enabled(parent)) in kernfs_fop_readdir()
1678 for (pos = kernfs_dir_pos(ns, parent, ctx->pos, pos); in kernfs_fop_readdir()
1680 pos = kernfs_dir_next_pos(ns, parent, ctx->pos, pos)) { in kernfs_fop_readdir()