Lines Matching defs:kls
6209 static ssize_t do_listmount(struct klistmount *kls, bool reverse)
6211 struct mnt_namespace *ns = kls->ns;
6212 u64 mnt_parent_id = kls->mnt_parent_id;
6213 u64 last_mnt_id = kls->last_mnt_id;
6214 u64 *mnt_ids = kls->kmnt_ids;
6215 size_t nr_mnt_ids = kls->nr_mnt_ids;
6222 ret = grab_requested_root(ns, &kls->root);
6227 orig = kls->root;
6239 if (!is_path_reachable(real_mount(orig.mnt), orig.dentry, &kls->root) &&
6272 static void __free_klistmount_free(const struct klistmount *kls)
6274 path_put(&kls->root);
6275 kvfree(kls->kmnt_ids);
6276 mnt_ns_release(kls->ns);
6279 static inline int prepare_klistmount(struct klistmount *kls, struct mnt_id_req *kreq,
6289 kls->last_mnt_id = last_mnt_id;
6291 kls->nr_mnt_ids = nr_mnt_ids;
6292 kls->kmnt_ids = kvmalloc_array(nr_mnt_ids, sizeof(*kls->kmnt_ids),
6294 if (!kls->kmnt_ids)
6300 kls->ns = ns;
6302 kls->mnt_parent_id = kreq->mnt_id;
6309 struct klistmount kls __free(klistmount_free) = {};
6332 ret = prepare_klistmount(&kls, &kreq, nr_mnt_ids);
6336 if (kreq.mnt_ns_id && (kls.ns != current->nsproxy->mnt_ns) &&
6337 !ns_capable_noaudit(kls.ns->user_ns, CAP_SYS_ADMIN))
6345 ret = do_listmount(&kls, (flags & LISTMOUNT_REVERSE));
6349 if (copy_to_user(mnt_ids, kls.kmnt_ids, ret * sizeof(*mnt_ids)))