Files
u-boot/include/linux/xattr.h
Simon Glass 8558bdc0e2 ext4l: Add xattr_user.c and xattr_hurd.c
Add xattr_user.c and xattr_hurd.c to the ext4l build:

- Update includes to use ext4_uboot.h
- Add d_sb member to struct dentry
- Add XATTR_HURD_PREFIX to linux/xattr.h

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-20 14:09:14 -07:00

61 lines
1.5 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
File: linux/xattr.h
Extended attributes handling.
Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
*/
#ifndef _LINUX_XATTR_H
#define _LINUX_XATTR_H
#include <linux/types.h>
/* XATTR namespace prefixes */
#define XATTR_USER_PREFIX "user."
#define XATTR_USER_PREFIX_LEN 5
#define XATTR_TRUSTED_PREFIX "trusted."
#define XATTR_TRUSTED_PREFIX_LEN 8
#define XATTR_SECURITY_PREFIX "security."
#define XATTR_SECURITY_PREFIX_LEN 9
#define XATTR_SYSTEM_PREFIX "system."
#define XATTR_SYSTEM_PREFIX_LEN 7
#define XATTR_HURD_PREFIX "gnu."
#define XATTR_HURD_PREFIX_LEN 4
/* Maximum size of an xattr value */
#define XATTR_SIZE_MAX 65536
/* Maximum length of an xattr name */
#define XATTR_NAME_MAX 255
/* Maximum size of a listxattr buffer */
#define XATTR_LIST_MAX 65536
struct xattr_handler {
const char *name;
const char *prefix;
int flags;
bool (*list)(struct dentry *dentry);
int (*get)(const struct xattr_handler *handler,
struct dentry *dentry, struct inode *inode,
const char *name, void *buffer, size_t size);
int (*set)(const struct xattr_handler *handler,
struct mnt_idmap *idmap, struct dentry *dentry,
struct inode *inode, const char *name, const void *value,
size_t size, int flags);
};
/* Common flags */
#define XATTR_CREATE 0x1
#define XATTR_REPLACE 0x2
#endif /* _LINUX_XATTR_H */