• Home
  • Raw
  • Download

Lines Matching refs:parent

44 	return strlcpy(buf, kn->parent ? kn->name : "/", buflen);  in kernfs_name_locked()
65 kn = kn->parent; in kernfs_path_locked()
66 } while (kn && kn->parent); in kernfs_path_locked()
109 kn = kn->parent; in kernfs_path_len()
110 } while (kn && kn->parent); in kernfs_path_len()
190 struct kernfs_node *parent; in kernfs_get_parent() local
194 parent = kn->parent; in kernfs_get_parent()
195 kernfs_get(parent); in kernfs_get_parent()
198 return parent; in kernfs_get_parent()
259 struct rb_node **node = &kn->parent->dir.children.rb_node; in kernfs_link_sibling()
260 struct rb_node *parent = NULL; in kernfs_link_sibling() local
267 parent = *node; in kernfs_link_sibling()
278 rb_link_node(&kn->rb, parent, node); in kernfs_link_sibling()
279 rb_insert_color(&kn->rb, &kn->parent->dir.children); in kernfs_link_sibling()
283 kn->parent->dir.subdirs++; in kernfs_link_sibling()
305 kn->parent->dir.subdirs--; in kernfs_unlink_sibling()
307 rb_erase(&kn->rb, &kn->parent->dir.children); in kernfs_unlink_sibling()
418 struct kernfs_node *parent; in kernfs_put() local
429 parent = kn->parent; in kernfs_put()
433 parent ? parent->name : "", kn->name, atomic_read(&kn->active)); in kernfs_put()
450 kn = parent; in kernfs_put()
481 if (dentry->d_parent->d_fsdata != kn->parent) in kernfs_dop_revalidate()
489 if (kn->parent && kernfs_ns_enabled(kn->parent) && in kernfs_dop_revalidate()
573 struct kernfs_node *kernfs_new_node(struct kernfs_node *parent, in kernfs_new_node() argument
579 kn = __kernfs_new_node(kernfs_root(parent), name, mode, flags); in kernfs_new_node()
581 kernfs_get(parent); in kernfs_new_node()
582 kn->parent = parent; in kernfs_new_node()
601 struct kernfs_node *parent = kn->parent; in kernfs_add_one() local
609 has_ns = kernfs_ns_enabled(parent); in kernfs_add_one()
611 has_ns ? "required" : "invalid", parent->name, kn->name)) in kernfs_add_one()
614 if (kernfs_type(parent) != KERNFS_DIR) in kernfs_add_one()
618 if (parent->flags & KERNFS_EMPTY_DIR) in kernfs_add_one()
621 if ((parent->flags & KERNFS_ACTIVATED) && !kernfs_active(parent)) in kernfs_add_one()
631 ps_iattr = parent->iattr; in kernfs_add_one()
664 static struct kernfs_node *kernfs_find_ns(struct kernfs_node *parent, in kernfs_find_ns() argument
668 struct rb_node *node = parent->dir.children.rb_node; in kernfs_find_ns()
669 bool has_ns = kernfs_ns_enabled(parent); in kernfs_find_ns()
676 has_ns ? "required" : "invalid", parent->name, name); in kernfs_find_ns()
707 struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, in kernfs_find_and_get_ns() argument
713 kn = kernfs_find_ns(parent, name, ns); in kernfs_find_and_get_ns()
787 struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent, in kernfs_create_dir_ns() argument
795 kn = kernfs_new_node(parent, name, mode | S_IFDIR, KERNFS_DIR); in kernfs_create_dir_ns()
799 kn->dir.root = parent->dir.root; in kernfs_create_dir_ns()
819 struct kernfs_node *kernfs_create_empty_dir(struct kernfs_node *parent, in kernfs_create_empty_dir() argument
826 kn = kernfs_new_node(parent, name, S_IRUGO|S_IXUGO|S_IFDIR, KERNFS_DIR); in kernfs_create_empty_dir()
831 kn->dir.root = parent->dir.root; in kernfs_create_empty_dir()
849 struct kernfs_node *parent = dentry->d_parent->d_fsdata; in kernfs_iop_lookup() local
856 if (kernfs_ns_enabled(parent)) in kernfs_iop_lookup()
859 kn = kernfs_find_ns(parent, dentry->d_name.name, ns); in kernfs_iop_lookup()
886 struct kernfs_node *parent = dir->i_private; in kernfs_iop_mkdir() local
887 struct kernfs_syscall_ops *scops = kernfs_root(parent)->syscall_ops; in kernfs_iop_mkdir()
893 if (!kernfs_get_active(parent)) in kernfs_iop_mkdir()
896 ret = scops->mkdir(parent, dentry->d_name.name, mode); in kernfs_iop_mkdir()
898 kernfs_put_active(parent); in kernfs_iop_mkdir()
1013 return pos->parent; in kernfs_next_descendant_post()
1040 WARN_ON_ONCE(pos->parent && RB_EMPTY_NODE(&pos->rb)); in kernfs_activate()
1061 if (!kn || (kn->parent && RB_EMPTY_NODE(&kn->rb))) in __kernfs_remove()
1099 if (!pos->parent || kernfs_unlink_sibling(pos)) { in __kernfs_remove()
1101 pos->parent ? pos->parent->iattr : NULL; in __kernfs_remove()
1269 int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, in kernfs_remove_by_name_ns() argument
1274 if (!parent) { in kernfs_remove_by_name_ns()
1282 kn = kernfs_find_ns(parent, name, ns); in kernfs_remove_by_name_ns()
1309 if (!kn->parent) in kernfs_rename_ns()
1320 if ((kn->parent == new_parent) && (kn->ns == new_ns) && in kernfs_rename_ns()
1347 old_parent = kn->parent; in kernfs_rename_ns()
1348 kn->parent = new_parent; in kernfs_rename_ns()
1383 struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos) in kernfs_dir_pos() argument
1387 pos->parent == parent && hash == pos->hash; in kernfs_dir_pos()
1393 struct rb_node *node = parent->dir.children.rb_node; in kernfs_dir_pos()
1417 struct kernfs_node *parent, ino_t ino, struct kernfs_node *pos) in kernfs_dir_next_pos() argument
1419 pos = kernfs_dir_pos(ns, parent, ino, pos); in kernfs_dir_next_pos()
1435 struct kernfs_node *parent = dentry->d_fsdata; in kernfs_fop_readdir() local
1443 if (kernfs_ns_enabled(parent)) in kernfs_fop_readdir()
1446 for (pos = kernfs_dir_pos(ns, parent, ctx->pos, pos); in kernfs_fop_readdir()
1448 pos = kernfs_dir_next_pos(ns, parent, ctx->pos, pos)) { in kernfs_fop_readdir()