Lines Matching refs:ns

317 	if (refcount_read(&net->ns.count) == 0)  in peernet2id_alloc()
403 refcount_set(&net->ns.count, 1); in preinit_net()
459 static struct ucounts *inc_net_namespaces(struct user_namespace *ns) in inc_net_namespaces() argument
461 return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES); in inc_net_namespaces()
739 struct ns_common *get_net_ns(struct ns_common *ns) in get_net_ns() argument
743 net = maybe_get_net(container_of(ns, struct net, ns)); in get_net_ns()
745 return &net->ns; in get_net_ns()
758 struct ns_common *ns = get_proc_ns(file_inode(fd_file(f))); in get_net_ns_by_fd() local
759 if (ns->ops == &netns_operations) in get_net_ns_by_fd()
760 return get_net(container_of(ns, struct net, ns)); in get_net_ns_by_fd()
794 net->net_cookie, net->ns.inum); in net_ns_net_debugfs()
796 net->net_cookie, net->ns.inum); in net_ns_net_debugfs()
816 net->ns.ops = &netns_operations; in net_ns_net_init()
818 net->ns.inum = PROC_NET_INIT_INO; in net_ns_net_init()
820 int ret = ns_alloc_inum(&net->ns); in net_ns_net_init()
834 ns_free_inum(&net->ns); in net_ns_net_exit()
1517 return net ? &net->ns : NULL; in netns_get()
1520 static inline struct net *to_net_ns(struct ns_common *ns) in to_net_ns() argument
1522 return container_of(ns, struct net, ns); in to_net_ns()
1525 static void netns_put(struct ns_common *ns) in netns_put() argument
1527 put_net(to_net_ns(ns)); in netns_put()
1530 static int netns_install(struct nsset *nsset, struct ns_common *ns) in netns_install() argument
1533 struct net *net = to_net_ns(ns); in netns_install()
1544 static struct user_namespace *netns_owner(struct ns_common *ns) in netns_owner() argument
1546 return to_net_ns(ns)->user_ns; in netns_owner()