]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - include/linux/quota.h
quota: Ensure qids map to the filesystem
[mirror_ubuntu-zesty-kernel.git] / include / linux / quota.h
index 9dfb6bce8c9eb08f0c45a8d1b76f86b0b489b30e..1db16ee39b318fe2a796669c08bed266b94281e5 100644 (file)
@@ -179,6 +179,16 @@ static inline struct kqid make_kqid_projid(kprojid_t projid)
        return kqid;
 }
 
+/**
+ *     qid_has_mapping - Report if a qid maps into a user namespace.
+ *     @ns:  The user namespace to see if a value maps into.
+ *     @qid: The kernel internal quota identifier to test.
+ */
+static inline bool qid_has_mapping(struct user_namespace *ns, struct kqid qid)
+{
+       return from_kqid(ns, qid) != (qid_t) -1;
+}
+
 
 extern spinlock_t dq_data_lock;