Lines Matching defs:cap
61 * @cap: The capability to check for
71 int cap)
82 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM;
112 * @cap: The capability to check for
125 int cap, unsigned int opts)
128 int ret = cap_capable_helper(cred, target_ns, cred_ns, cap);
130 trace_cap_capable(cred, target_ns, cred_ns, cap, ret);
385 static bool is_v2header(int size, const struct vfs_cap_data *cap)
389 return sansflags(le32_to_cpu(cap->magic_etc)) == VFS_CAP_REVISION_2;
392 static bool is_v3header(int size, const struct vfs_cap_data *cap)
396 return sansflags(le32_to_cpu(cap->magic_etc)) == VFS_CAP_REVISION_3;
420 struct vfs_cap_data *cap;
439 cap = (struct vfs_cap_data *) tmpbuf;
440 if (is_v2header(size, cap)) {
442 } else if (is_v3header(size, cap)) {
469 magic = le32_to_cpu(cap->magic_etc);
472 memcpy(&nscap->data, &cap->data, sizeof(__le32) * 2 * VFS_CAP_U32);
494 cap = kzalloc(size, GFP_ATOMIC);
495 if (!cap) {
503 memcpy(&cap->data, &nscap->data, sizeof(__le32) * 2 * VFS_CAP_U32);
504 cap->magic_etc = cpu_to_le32(magic);
509 *buffer = cap;
535 static bool validheader(size_t size, const struct vfs_cap_data *cap)
537 return is_v2header(size, cap) || is_v3header(size, cap);
564 const struct vfs_cap_data *cap = *ivalue;
575 if (!validheader(size, cap))
602 magic = le32_to_cpu(cap->magic_etc);
606 memcpy(&nscap->data, &cap->data, sizeof(__le32) * 2 * VFS_CAP_U32);
1264 static int cap_prctl_drop(unsigned long cap)
1270 if (!cap_valid(cap))
1276 cap_lower(new->cap_bset, cap);