| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
/* |
| 3 |
* Copyright (C) 2017-2018 HUAWEI, Inc. |
| 4 |
* https://www.huawei.com/ |
| 5 |
*/ |
| 6 |
#ifndef __EROFS_XATTR_H |
| 7 |
#define __EROFS_XATTR_H |
| 8 |
|
| 9 |
#include "internal.h" |
| 10 |
#include <linux/posix_acl_xattr.h> |
| 11 |
#include <linux/xattr.h> |
| 12 |
|
| 13 |
#ifdef CONFIG_EROFS_FS_XATTR |
| 14 |
extern const struct xattr_handler * const erofs_xattr_handlers[]; |
| 15 |
|
| 16 |
int erofs_xattr_prefixes_init(struct super_block *sb); |
| 17 |
void erofs_xattr_prefixes_cleanup(struct super_block *sb); |
| 18 |
ssize_t erofs_listxattr(struct dentry *, char *, size_t); |
| 19 |
#else |
| 20 |
static inline int erofs_xattr_prefixes_init(struct super_block *sb) { return 0; } |
| 21 |
static inline void erofs_xattr_prefixes_cleanup(struct super_block *sb) {} |
| 22 |
|
| 23 |
#define erofs_listxattr (NULL) |
| 24 |
#define erofs_xattr_handlers (NULL) |
| 25 |
#endif /* !CONFIG_EROFS_FS_XATTR */ |
| 26 |
|
| 27 |
#ifdef CONFIG_EROFS_FS_POSIX_ACL |
| 28 |
struct posix_acl *erofs_get_acl(struct inode *inode, int type, bool rcu); |
| 29 |
#else |
| 30 |
#define erofs_get_acl (NULL) |
| 31 |
#endif |
| 32 |
|
| 33 |
int erofs_xattr_fill_inode_fingerprint(struct erofs_inode_fingerprint *fp, |
| 34 |
struct inode *inode, const char *domain_id); |
| 35 |
bool erofs_inode_has_noacl(struct inode *inode, void *kaddr, unsigned int ofs); |
| 36 |
#endif |