include/linux/posix_acl_xattr.h
Source file repositories/reference/linux-study-clean/include/linux/posix_acl_xattr.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/posix_acl_xattr.h- Extension
.h- Size
- 1999 bytes
- Lines
- 77
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/xattr.huapi/linux/posix_acl_xattr.hlinux/posix_acl.h
Detected Declarations
function Copyrightfunction posix_acl_xattr_countfunction posix_acl_from_xattrfunction posix_acl_type
Annotated Snippet
File: linux/posix_acl_xattr.h
Extended attribute system call representation of Access Control Lists.
Copyright (C) 2000 by Andreas Gruenbacher <a.gruenbacher@computer.org>
Copyright (C) 2002 SGI - Silicon Graphics, Inc <linux-xfs@oss.sgi.com>
*/
#ifndef _POSIX_ACL_XATTR_H
#define _POSIX_ACL_XATTR_H
#include <uapi/linux/xattr.h>
#include <uapi/linux/posix_acl_xattr.h>
#include <linux/posix_acl.h>
static inline size_t
posix_acl_xattr_size(int count)
{
return (sizeof(struct posix_acl_xattr_header) +
(count * sizeof(struct posix_acl_xattr_entry)));
}
static inline int
posix_acl_xattr_count(size_t size)
{
if (size < sizeof(struct posix_acl_xattr_header))
return -1;
size -= sizeof(struct posix_acl_xattr_header);
if (size % sizeof(struct posix_acl_xattr_entry))
return -1;
return size / sizeof(struct posix_acl_xattr_entry);
}
#ifdef CONFIG_FS_POSIX_ACL
struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns,
const void *value, size_t size);
#else
static inline struct posix_acl *
posix_acl_from_xattr(struct user_namespace *user_ns, const void *value,
size_t size)
{
return ERR_PTR(-EOPNOTSUPP);
}
#endif
extern void *posix_acl_to_xattr(struct user_namespace *user_ns, const struct posix_acl *acl,
size_t *sizep, gfp_t gfp);
static inline const char *posix_acl_xattr_name(int type)
{
switch (type) {
case ACL_TYPE_ACCESS:
return XATTR_NAME_POSIX_ACL_ACCESS;
case ACL_TYPE_DEFAULT:
return XATTR_NAME_POSIX_ACL_DEFAULT;
}
return "";
}
static inline int posix_acl_type(const char *name)
{
if (strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) == 0)
return ACL_TYPE_ACCESS;
else if (strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0)
return ACL_TYPE_DEFAULT;
return -1;
}
/* These are legacy handlers. Don't use them for new code. */
extern const struct xattr_handler nop_posix_acl_access;
extern const struct xattr_handler nop_posix_acl_default;
#endif /* _POSIX_ACL_XATTR_H */
Annotation
- Immediate include surface: `uapi/linux/xattr.h`, `uapi/linux/posix_acl_xattr.h`, `linux/posix_acl.h`.
- Detected declarations: `function Copyright`, `function posix_acl_xattr_count`, `function posix_acl_from_xattr`, `function posix_acl_type`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.