#include <linux/rwsem.h>
#include <linux/f2fs_fs.h>
#include <linux/security.h>
#include <linux/posix_acl_xattr.h>
#include "f2fs.h"
#include "xattr.h"
#include "segment.h"
static void *xattr_alloc(struct f2fs_sb_info *sbi, int size, bool *is_inline)
{ … }
static void xattr_free(struct f2fs_sb_info *sbi, void *xattr_addr,
bool is_inline)
{ … }
static int f2fs_xattr_generic_get(const struct xattr_handler *handler,
struct dentry *unused, struct inode *inode,
const char *name, void *buffer, size_t size)
{ … }
static int f2fs_xattr_generic_set(const struct xattr_handler *handler,
struct mnt_idmap *idmap,
struct dentry *unused, struct inode *inode,
const char *name, const void *value,
size_t size, int flags)
{ … }
static bool f2fs_xattr_user_list(struct dentry *dentry)
{ … }
static bool f2fs_xattr_trusted_list(struct dentry *dentry)
{ … }
static int f2fs_xattr_advise_get(const struct xattr_handler *handler,
struct dentry *unused, struct inode *inode,
const char *name, void *buffer, size_t size)
{ … }
static int f2fs_xattr_advise_set(const struct xattr_handler *handler,
struct mnt_idmap *idmap,
struct dentry *unused, struct inode *inode,
const char *name, const void *value,
size_t size, int flags)
{ … }
#ifdef CONFIG_F2FS_FS_SECURITY
static int f2fs_initxattrs(struct inode *inode, const struct xattr *xattr_array,
void *page)
{ … }
int f2fs_init_security(struct inode *inode, struct inode *dir,
const struct qstr *qstr, struct page *ipage)
{ … }
#endif
const struct xattr_handler f2fs_xattr_user_handler = …;
const struct xattr_handler f2fs_xattr_trusted_handler = …;
const struct xattr_handler f2fs_xattr_advise_handler = …;
const struct xattr_handler f2fs_xattr_security_handler = …;
static const struct xattr_handler * const f2fs_xattr_handler_map[] = …;
const struct xattr_handler * const f2fs_xattr_handlers[] = …;
static inline const char *f2fs_xattr_prefix(int index,
struct dentry *dentry)
{ … }
static struct f2fs_xattr_entry *__find_xattr(void *base_addr,
void *last_base_addr, void **last_addr,
int index, size_t len, const char *name)
{ … }
static struct f2fs_xattr_entry *__find_inline_xattr(struct inode *inode,
void *base_addr, void **last_addr, int index,
size_t len, const char *name)
{ … }
static int read_inline_xattr(struct inode *inode, struct page *ipage,
void *txattr_addr)
{ … }
static int read_xattr_block(struct inode *inode, void *txattr_addr)
{ … }
static int lookup_all_xattrs(struct inode *inode, struct page *ipage,
unsigned int index, unsigned int len,
const char *name, struct f2fs_xattr_entry **xe,
void **base_addr, int *base_size,
bool *is_inline)
{ … }
static int read_all_xattrs(struct inode *inode, struct page *ipage,
void **base_addr)
{ … }
static inline int write_all_xattrs(struct inode *inode, __u32 hsize,
void *txattr_addr, struct page *ipage)
{ … }
int f2fs_getxattr(struct inode *inode, int index, const char *name,
void *buffer, size_t buffer_size, struct page *ipage)
{ … }
ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
{ … }
static bool f2fs_xattr_value_same(struct f2fs_xattr_entry *entry,
const void *value, size_t size)
{ … }
static int __f2fs_setxattr(struct inode *inode, int index,
const char *name, const void *value, size_t size,
struct page *ipage, int flags)
{ … }
int f2fs_setxattr(struct inode *inode, int index, const char *name,
const void *value, size_t size,
struct page *ipage, int flags)
{ … }
int f2fs_init_xattr_caches(struct f2fs_sb_info *sbi)
{ … }
void f2fs_destroy_xattr_caches(struct f2fs_sb_info *sbi)
{ … }