~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/erofs/xattr.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 /* Attribute not found */
 14 #define ENOATTR         ENODATA
 15 
 16 #ifdef CONFIG_EROFS_FS_XATTR
 17 extern const struct xattr_handler erofs_xattr_user_handler;
 18 extern const struct xattr_handler erofs_xattr_trusted_handler;
 19 extern const struct xattr_handler erofs_xattr_security_handler;
 20 
 21 static inline const char *erofs_xattr_prefix(unsigned int idx,
 22                                              struct dentry *dentry)
 23 {
 24         const struct xattr_handler *handler = NULL;
 25 
 26         static const struct xattr_handler * const xattr_handler_map[] = {
 27                 [EROFS_XATTR_INDEX_USER] = &erofs_xattr_user_handler,
 28 #ifdef CONFIG_EROFS_FS_POSIX_ACL
 29                 [EROFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &nop_posix_acl_access,
 30                 [EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default,
 31 #endif
 32                 [EROFS_XATTR_INDEX_TRUSTED] = &erofs_xattr_trusted_handler,
 33 #ifdef CONFIG_EROFS_FS_SECURITY
 34                 [EROFS_XATTR_INDEX_SECURITY] = &erofs_xattr_security_handler,
 35 #endif
 36         };
 37 
 38         if (idx && idx < ARRAY_SIZE(xattr_handler_map))
 39                 handler = xattr_handler_map[idx];
 40 
 41         if (!xattr_handler_can_list(handler, dentry))
 42                 return NULL;
 43 
 44         return xattr_prefix(handler);
 45 }
 46 
 47 extern const struct xattr_handler * const erofs_xattr_handlers[];
 48 
 49 int erofs_xattr_prefixes_init(struct super_block *sb);
 50 void erofs_xattr_prefixes_cleanup(struct super_block *sb);
 51 int erofs_getxattr(struct inode *, int, const char *, void *, size_t);
 52 ssize_t erofs_listxattr(struct dentry *, char *, size_t);
 53 #else
 54 static inline int erofs_xattr_prefixes_init(struct super_block *sb) { return 0; }
 55 static inline void erofs_xattr_prefixes_cleanup(struct super_block *sb) {}
 56 static inline int erofs_getxattr(struct inode *inode, int index,
 57                                  const char *name, void *buffer,
 58                                  size_t buffer_size)
 59 {
 60         return -EOPNOTSUPP;
 61 }
 62 
 63 #define erofs_listxattr (NULL)
 64 #define erofs_xattr_handlers (NULL)
 65 #endif  /* !CONFIG_EROFS_FS_XATTR */
 66 
 67 #ifdef CONFIG_EROFS_FS_POSIX_ACL
 68 struct posix_acl *erofs_get_acl(struct inode *inode, int type, bool rcu);
 69 #else
 70 #define erofs_get_acl   (NULL)
 71 #endif
 72 
 73 #endif
 74 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php