Lines Matching refs:ns
695 struct mnt_namespace *ns = current->nsproxy->mnt_ns; in __is_local_mountpoint() local
703 list_for_each_entry(mnt, &ns->list, mnt_list) { in __is_local_mountpoint()
798 static void touch_mnt_namespace(struct mnt_namespace *ns) in touch_mnt_namespace() argument
800 if (ns) { in touch_mnt_namespace()
801 ns->event = ++event; in touch_mnt_namespace()
802 wake_up_interruptible(&ns->poll); in touch_mnt_namespace()
809 static void __touch_mnt_namespace(struct mnt_namespace *ns) in __touch_mnt_namespace() argument
811 if (ns && ns->event != event) { in __touch_mnt_namespace()
812 ns->event = event; in __touch_mnt_namespace()
813 wake_up_interruptible(&ns->poll); in __touch_mnt_namespace()
1299 if (p->cached_event == p->ns->event) { in m_start()
1304 v = seq_list_next(v, &p->ns->list, &p->cached_index); in m_start()
1309 p->cached_event = p->ns->event; in m_start()
1310 p->cached_mount = seq_list_start(&p->ns->list, *pos); in m_start()
1319 p->cached_mount = seq_list_next(v, &p->ns->list, pos); in m_next()
1489 struct mnt_namespace *ns; in umount_tree() local
1494 ns = p->mnt_ns; in umount_tree()
1495 if (ns) { in umount_tree()
1496 ns->mounts--; in umount_tree()
1497 __touch_mnt_namespace(ns); in umount_tree()
1735 struct mnt_namespace *to_mnt_ns(struct ns_common *ns) in to_mnt_ns() argument
1737 return container_of(ns, struct mnt_namespace, ns); in to_mnt_ns()
1907 int count_mounts(struct mnt_namespace *ns, struct mount *mnt) in count_mounts() argument
1916 old = ns->mounts; in count_mounts()
1917 pending = ns->pending_mounts; in count_mounts()
1925 ns->pending_mounts = pending + mounts; in count_mounts()
1998 struct mnt_namespace *ns = dest_mnt->mnt_ns; in attach_recursive_mnt() local
2013 err = count_mounts(ns, source_mnt); in attach_recursive_mnt()
2063 ns->pending_mounts = 0; in attach_recursive_mnt()
2842 static struct ucounts *inc_mnt_namespaces(struct user_namespace *ns) in inc_mnt_namespaces() argument
2844 return inc_ucount(ns, current_euid(), UCOUNT_MNT_NAMESPACES); in inc_mnt_namespaces()
2852 static void free_mnt_ns(struct mnt_namespace *ns) in free_mnt_ns() argument
2854 ns_free_inum(&ns->ns); in free_mnt_ns()
2855 dec_mnt_namespaces(ns->ucounts); in free_mnt_ns()
2856 put_user_ns(ns->user_ns); in free_mnt_ns()
2857 kfree(ns); in free_mnt_ns()
2884 ret = ns_alloc_inum(&new_ns->ns); in alloc_mnt_ns()
2890 new_ns->ns.ops = &mntns_operations; in alloc_mnt_ns()
2905 struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns, in copy_mnt_ns() argument
2915 BUG_ON(!ns); in copy_mnt_ns()
2918 get_mnt_ns(ns); in copy_mnt_ns()
2919 return ns; in copy_mnt_ns()
2922 old = ns->root; in copy_mnt_ns()
2931 if (user_ns != ns->user_ns) in copy_mnt_ns()
3000 struct mnt_namespace *ns; in mount_subtree() local
3005 ns = create_mnt_ns(mnt); in mount_subtree()
3006 if (IS_ERR(ns)) in mount_subtree()
3007 return ERR_CAST(ns); in mount_subtree()
3012 put_mnt_ns(ns); in mount_subtree()
3213 struct mnt_namespace *ns; in init_mount_tree() local
3225 ns = create_mnt_ns(mnt); in init_mount_tree()
3226 if (IS_ERR(ns)) in init_mount_tree()
3229 init_task.nsproxy->mnt_ns = ns; in init_mount_tree()
3230 get_mnt_ns(ns); in init_mount_tree()
3280 void put_mnt_ns(struct mnt_namespace *ns) in put_mnt_ns() argument
3282 if (!atomic_dec_and_test(&ns->count)) in put_mnt_ns()
3284 drop_collected_mounts(&ns->root->mnt); in put_mnt_ns()
3285 free_mnt_ns(ns); in put_mnt_ns()
3343 static bool mnt_already_visible(struct mnt_namespace *ns, struct vfsmount *new, in mnt_already_visible() argument
3351 list_for_each_entry(mnt, &ns->list, mnt_list) { in mnt_already_visible()
3409 struct mnt_namespace *ns = current->nsproxy->mnt_ns; in mount_too_revealing() local
3412 if (ns->user_ns == &init_user_ns) in mount_too_revealing()
3426 return !mnt_already_visible(ns, mnt, new_mnt_flags); in mount_too_revealing()
3444 struct ns_common *ns = NULL; in mntns_get() local
3450 ns = &nsproxy->mnt_ns->ns; in mntns_get()
3451 get_mnt_ns(to_mnt_ns(ns)); in mntns_get()
3455 return ns; in mntns_get()
3458 static void mntns_put(struct ns_common *ns) in mntns_put() argument
3460 put_mnt_ns(to_mnt_ns(ns)); in mntns_put()
3463 static int mntns_install(struct nsproxy *nsproxy, struct ns_common *ns) in mntns_install() argument
3466 struct mnt_namespace *mnt_ns = to_mnt_ns(ns); in mntns_install()
3496 static struct user_namespace *mntns_owner(struct ns_common *ns) in mntns_owner() argument
3498 return to_mnt_ns(ns)->user_ns; in mntns_owner()