iommu: dma-iommu: export common_iommu_{setup|teardown}_dma_ops
[firefly-linux-kernel-4.4.55.git] / include / linux / capability.h
index d9a4f7f40f329b22c81f86e31c72b259d4acb4bf..af9f0b9e80e61060420d3ff968856fd8da9e78c4 100644 (file)
@@ -78,8 +78,11 @@ extern const kernel_cap_t __cap_init_eff_set;
 # error Fix up hand-coded capability macro initializers
 #else /* HAND-CODED capability initializers */
 
+#define CAP_LAST_U32                   ((_KERNEL_CAPABILITY_U32S) - 1)
+#define CAP_LAST_U32_VALID_MASK                (CAP_TO_MASK(CAP_LAST_CAP + 1) -1)
+
 # define CAP_EMPTY_SET    ((kernel_cap_t){{ 0, 0 }})
-# define CAP_FULL_SET     ((kernel_cap_t){{ ~0, ~0 }})
+# define CAP_FULL_SET     ((kernel_cap_t){{ ~0, CAP_LAST_U32_VALID_MASK }})
 # define CAP_FS_SET       ((kernel_cap_t){{ CAP_FS_MASK_B0 \
                                    | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \
                                    CAP_FS_MASK_B1 } })
@@ -202,6 +205,7 @@ static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
                           cap_intersect(permitted, __cap_nfsd_set));
 }
 
+#ifdef CONFIG_MULTIUSER
 extern bool has_capability(struct task_struct *t, int cap);
 extern bool has_ns_capability(struct task_struct *t,
                              struct user_namespace *ns, int cap);
@@ -210,8 +214,35 @@ extern bool has_ns_capability_noaudit(struct task_struct *t,
                                      struct user_namespace *ns, int cap);
 extern bool capable(int cap);
 extern bool ns_capable(struct user_namespace *ns, int cap);
-extern bool nsown_capable(int cap);
-extern bool inode_capable(const struct inode *inode, int cap);
+#else
+static inline bool has_capability(struct task_struct *t, int cap)
+{
+       return true;
+}
+static inline bool has_ns_capability(struct task_struct *t,
+                             struct user_namespace *ns, int cap)
+{
+       return true;
+}
+static inline bool has_capability_noaudit(struct task_struct *t, int cap)
+{
+       return true;
+}
+static inline bool has_ns_capability_noaudit(struct task_struct *t,
+                                     struct user_namespace *ns, int cap)
+{
+       return true;
+}
+static inline bool capable(int cap)
+{
+       return true;
+}
+static inline bool ns_capable(struct user_namespace *ns, int cap)
+{
+       return true;
+}
+#endif /* CONFIG_MULTIUSER */
+extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
 extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
 
 /* audit system wants to get cap info from files as well */