Lines Matching refs:ns
389 static struct ucounts *inc_net_namespaces(struct user_namespace *ns) in inc_net_namespaces() argument
391 return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES); in inc_net_namespaces()
444 struct net *ns = p; in net_drop_ns() local
445 if (ns && refcount_dec_and_test(&ns->passive)) in net_drop_ns()
446 net_free(ns); in net_drop_ns()
649 struct ns_common *ns; in get_net_ns_by_fd() local
656 ns = get_proc_ns(file_inode(file)); in get_net_ns_by_fd()
657 if (ns->ops == &netns_operations) in get_net_ns_by_fd()
658 net = get_net(container_of(ns, struct net, ns)); in get_net_ns_by_fd()
699 net->ns.ops = &netns_operations; in net_ns_net_init()
701 return ns_alloc_inum(&net->ns); in net_ns_net_init()
706 ns_free_inum(&net->ns); in net_ns_net_exit()
1345 return net ? &net->ns : NULL; in netns_get()
1348 static inline struct net *to_net_ns(struct ns_common *ns) in to_net_ns() argument
1350 return container_of(ns, struct net, ns); in to_net_ns()
1353 static void netns_put(struct ns_common *ns) in netns_put() argument
1355 put_net(to_net_ns(ns)); in netns_put()
1358 static int netns_install(struct nsproxy *nsproxy, struct ns_common *ns) in netns_install() argument
1360 struct net *net = to_net_ns(ns); in netns_install()
1371 static struct user_namespace *netns_owner(struct ns_common *ns) in netns_owner() argument
1373 return to_net_ns(ns)->user_ns; in netns_owner()