VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
f51667685749e (Theodore Ts'o               2017-12-17 22:00:59 -0500   1) // SPDX-License-Identifier: GPL-2.0
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700   2) /*
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700   3)   File: fs/ext4/xattr.h
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700   4) 
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700   5)   On-disk format of extended attributes for the ext4 filesystem.
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700   6) 
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700   7)   (C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org>
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700   8) */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700   9) 
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  10) #include <linux/xattr.h>
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  11) 
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  12) /* Magic value in attribute blocks */
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  13) #define EXT4_XATTR_MAGIC		0xEA020000
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  14) 
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  15) /* Maximum number of references to one attribute block */
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  16) #define EXT4_XATTR_REFCOUNT_MAX		1024
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  17) 
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  18) /* Name indexes */
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  19) #define EXT4_XATTR_INDEX_USER			1
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  20) #define EXT4_XATTR_INDEX_POSIX_ACL_ACCESS	2
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  21) #define EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT	3
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  22) #define EXT4_XATTR_INDEX_TRUSTED		4
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  23) #define	EXT4_XATTR_INDEX_LUSTRE			5
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  24) #define EXT4_XATTR_INDEX_SECURITY	        6
67cf5b09a46f7 (Tao Ma                      2012-12-10 14:04:46 -0500  25) #define EXT4_XATTR_INDEX_SYSTEM			7
fd03d8daf417f (Theodore Ts'o               2013-04-18 14:53:15 -0400  26) #define EXT4_XATTR_INDEX_RICHACL		8
887e2c452255f (Michael Halcrow             2015-04-11 07:47:00 -0400  27) #define EXT4_XATTR_INDEX_ENCRYPTION		9
3980bd3b406ad (Theodore Ts'o               2016-07-31 23:38:36 -0400  28) #define EXT4_XATTR_INDEX_HURD			10 /* Reserved for Hurd */
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  29) 
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  30) struct ext4_xattr_header {
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  31) 	__le32	h_magic;	/* magic number for identification */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  32) 	__le32	h_refcount;	/* reference count */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  33) 	__le32	h_blocks;	/* number of disk blocks used */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  34) 	__le32	h_hash;		/* hash value of all attributes */
e615391896064 (Darrick J. Wong             2012-04-29 18:23:10 -0400  35) 	__le32	h_checksum;	/* crc32c(uuid+id+xattrblock) */
e615391896064 (Darrick J. Wong             2012-04-29 18:23:10 -0400  36) 				/* id = inum if refcount=1, blknum otherwise */
e615391896064 (Darrick J. Wong             2012-04-29 18:23:10 -0400  37) 	__u32	h_reserved[3];	/* zero right now */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  38) };
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  39) 
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  40) struct ext4_xattr_ibody_header {
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  41) 	__le32	h_magic;	/* magic number for identification */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  42) };
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  43) 
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  44) struct ext4_xattr_entry {
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  45) 	__u8	e_name_len;	/* length of name */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  46) 	__u8	e_name_index;	/* attribute name index */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  47) 	__le16	e_value_offs;	/* offset in disk block of value */
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  48) 	__le32	e_value_inum;	/* inode in which the value is stored */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  49) 	__le32	e_value_size;	/* size of attribute value */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  50) 	__le32	e_hash;		/* hash value of name and value */
47b1030612f43 (Gustavo A. R. Silva         2020-03-09 13:08:13 -0500  51) 	char	e_name[];	/* attribute name */
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  52) };
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  53) 
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  54) #define EXT4_XATTR_PAD_BITS		2
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  55) #define EXT4_XATTR_PAD		(1<<EXT4_XATTR_PAD_BITS)
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  56) #define EXT4_XATTR_ROUND		(EXT4_XATTR_PAD-1)
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  57) #define EXT4_XATTR_LEN(name_len) \
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  58) 	(((name_len) + EXT4_XATTR_ROUND + \
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  59) 	sizeof(struct ext4_xattr_entry)) & ~EXT4_XATTR_ROUND)
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  60) #define EXT4_XATTR_NEXT(entry) \
af5bc92dded4d (Theodore Ts'o               2008-09-08 22:25:24 -0400  61) 	((struct ext4_xattr_entry *)( \
af5bc92dded4d (Theodore Ts'o               2008-09-08 22:25:24 -0400  62) 	 (char *)(entry) + EXT4_XATTR_LEN((entry)->e_name_len)))
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  63) #define EXT4_XATTR_SIZE(size) \
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700  64) 	(((size) + EXT4_XATTR_ROUND) & ~EXT4_XATTR_ROUND)
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700  65) 
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400  66) #define IHDR(inode, raw_inode) \
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400  67) 	((struct ext4_xattr_ibody_header *) \
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400  68) 		((void *)raw_inode + \
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400  69) 		EXT4_GOOD_OLD_INODE_SIZE + \
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400  70) 		EXT4_I(inode)->i_extra_isize))
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400  71) #define IFIRST(hdr) ((struct ext4_xattr_entry *)((hdr)+1))
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400  72) 
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  73) /*
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  74)  * XATTR_SIZE_MAX is currently 64k, but for the purposes of checking
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  75)  * for file system consistency errors, we use a somewhat bigger value.
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  76)  * This allows XATTR_SIZE_MAX to grow in the future, but by using this
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  77)  * instead of INT_MAX for certain consistency checks, we don't need to
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  78)  * worry about arithmetic overflows.  (Actually XATTR_SIZE_MAX is
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  79)  * defined in include/uapi/linux/limits.h, so changing it is going
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  80)  * not going to be trivial....)
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  81)  */
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  82) #define EXT4_XATTR_SIZE_MAX (1 << 24)
54dd0e0a1b255 (Theodore Ts'o               2018-03-30 20:04:11 -0400  83) 
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  84) /*
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  85)  * The minimum size of EA value when you start storing it in an external inode
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  86)  * size of block - size of header - size of 1 entry - 4 null bytes
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  87) */
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  88) #define EXT4_XATTR_MIN_LARGE_EA_SIZE(b)					\
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  89) 	((b) - EXT4_XATTR_LEN(3) - sizeof(struct ext4_xattr_header) - 4)
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400  90) 
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  91) #define BHDR(bh) ((struct ext4_xattr_header *)((bh)->b_data))
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  92) #define ENTRY(ptr) ((struct ext4_xattr_entry *)(ptr))
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  93) #define BFIRST(bh) ENTRY(BHDR(bh)+1)
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  94) #define IS_LAST_ENTRY(entry) (*(__u32 *)(entry) == 0)
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  95) 
bd9926e80330d (Theodore Ts'o               2012-12-11 03:31:49 -0500  96) #define EXT4_ZERO_XATTR_VALUE ((void *)-1)
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  97) 
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  98) struct ext4_xattr_info {
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500  99) 	const char *name;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 100) 	const void *value;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 101) 	size_t value_len;
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400 102) 	int name_index;
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400 103) 	int in_inode;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 104) };
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 105) 
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 106) struct ext4_xattr_search {
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 107) 	struct ext4_xattr_entry *first;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 108) 	void *base;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 109) 	void *end;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 110) 	struct ext4_xattr_entry *here;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 111) 	int not_found;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 112) };
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 113) 
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 114) struct ext4_xattr_ibody_find {
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 115) 	struct ext4_xattr_search s;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 116) 	struct ext4_iloc iloc;
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 117) };
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 118) 
b6d9029df083c (Tahsin Erdogan              2017-06-22 10:28:38 -0400 119) struct ext4_xattr_inode_array {
b6d9029df083c (Tahsin Erdogan              2017-06-22 10:28:38 -0400 120) 	unsigned int count;		/* # of used items in the array */
47b1030612f43 (Gustavo A. R. Silva         2020-03-09 13:08:13 -0500 121) 	struct inode *inodes[];
b6d9029df083c (Tahsin Erdogan              2017-06-22 10:28:38 -0400 122) };
b6d9029df083c (Tahsin Erdogan              2017-06-22 10:28:38 -0400 123) 
11e27528076e7 (Stephen Hemminger           2010-05-13 17:53:18 -0700 124) extern const struct xattr_handler ext4_xattr_user_handler;
11e27528076e7 (Stephen Hemminger           2010-05-13 17:53:18 -0700 125) extern const struct xattr_handler ext4_xattr_trusted_handler;
11e27528076e7 (Stephen Hemminger           2010-05-13 17:53:18 -0700 126) extern const struct xattr_handler ext4_xattr_security_handler;
88ee9d571b6d8 (Jan (janneke) Nieuwenhuizen 2020-05-25 21:39:40 +0200 127) extern const struct xattr_handler ext4_xattr_hurd_handler;
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 128) 
887e2c452255f (Michael Halcrow             2015-04-11 07:47:00 -0400 129) #define EXT4_XATTR_NAME_ENCRYPTION_CONTEXT "c"
887e2c452255f (Michael Halcrow             2015-04-11 07:47:00 -0400 130) 
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 131) /*
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 132)  * The EXT4_STATE_NO_EXPAND is overloaded and used for two purposes.
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 133)  * The first is to signal that there the inline xattrs and data are
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 134)  * taking up so much space that we might as well not keep trying to
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 135)  * expand it.  The second is that xattr_sem is taken for writing, so
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 136)  * we shouldn't try to recurse into the inode expansion.  For this
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 137)  * second case, we need to make sure that we take save and restore the
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 138)  * NO_EXPAND state flag appropriately.
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 139)  */
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 140) static inline void ext4_write_lock_xattr(struct inode *inode, int *save)
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 141) {
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 142) 	down_write(&EXT4_I(inode)->xattr_sem);
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 143) 	*save = ext4_test_inode_state(inode, EXT4_STATE_NO_EXPAND);
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 144) 	ext4_set_inode_state(inode, EXT4_STATE_NO_EXPAND);
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 145) }
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 146) 
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 147) static inline int ext4_write_trylock_xattr(struct inode *inode, int *save)
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 148) {
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 149) 	if (down_write_trylock(&EXT4_I(inode)->xattr_sem) == 0)
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 150) 		return 0;
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 151) 	*save = ext4_test_inode_state(inode, EXT4_STATE_NO_EXPAND);
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 152) 	ext4_set_inode_state(inode, EXT4_STATE_NO_EXPAND);
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 153) 	return 1;
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 154) }
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 155) 
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 156) static inline void ext4_write_unlock_xattr(struct inode *inode, int *save)
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 157) {
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 158) 	if (*save == 0)
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 159) 		ext4_clear_inode_state(inode, EXT4_STATE_NO_EXPAND);
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 160) 	up_write(&EXT4_I(inode)->xattr_sem);
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 161) }
c755e251357a0 (Theodore Ts'o               2017-01-11 21:50:46 -0500 162) 
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700 163) extern ssize_t ext4_listxattr(struct dentry *, char *, size_t);
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 164) 
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700 165) extern int ext4_xattr_get(struct inode *, int, const char *, void *, size_t);
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700 166) extern int ext4_xattr_set(struct inode *, int, const char *, const void *, size_t, int);
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700 167) extern int ext4_xattr_set_handle(handle_t *, struct inode *, int, const char *, const void *, size_t, int);
dec214d00e0d7 (Tahsin Erdogan              2017-06-22 11:44:55 -0400 168) extern int ext4_xattr_set_credits(struct inode *inode, size_t value_len,
af65207c76ce8 (Tahsin Erdogan              2017-07-06 00:01:59 -0400 169) 				  bool is_create, int *credits);
af65207c76ce8 (Tahsin Erdogan              2017-07-06 00:01:59 -0400 170) extern int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode,
af65207c76ce8 (Tahsin Erdogan              2017-07-06 00:01:59 -0400 171) 				struct buffer_head *block_bh, size_t value_len,
af65207c76ce8 (Tahsin Erdogan              2017-07-06 00:01:59 -0400 172) 				bool is_create);
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 173) 
e50e5129f384a (Andreas Dilger              2017-06-21 21:10:32 -0400 174) extern int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,
30a7eb970c3aa (Tahsin Erdogan              2017-06-22 11:42:09 -0400 175) 				   struct ext4_xattr_inode_array **array,
30a7eb970c3aa (Tahsin Erdogan              2017-06-22 11:42:09 -0400 176) 				   int extra_credits);
0421a189bc8cd (Tahsin Erdogan              2017-06-22 10:26:31 -0400 177) extern void ext4_xattr_inode_array_free(struct ext4_xattr_inode_array *array);
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 178) 
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400 179) extern int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400 180) 			    struct ext4_inode *raw_inode, handle_t *handle);
6dd4ee7cab7e3 (Kalpak Shah                 2007-07-18 09:19:57 -0400 181) 
11e27528076e7 (Stephen Hemminger           2010-05-13 17:53:18 -0700 182) extern const struct xattr_handler *ext4_xattr_handlers[];
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 183) 
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 184) extern int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 185) 				 struct ext4_xattr_ibody_find *is);
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 186) extern int ext4_xattr_ibody_get(struct inode *inode, int name_index,
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 187) 				const char *name,
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 188) 				void *buffer, size_t buffer_size);
0d812f77b36c1 (Tao Ma                      2012-12-10 14:06:02 -0500 189) extern int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
0d812f77b36c1 (Tao Ma                      2012-12-10 14:06:02 -0500 190) 				       struct ext4_xattr_info *i,
0d812f77b36c1 (Tao Ma                      2012-12-10 14:06:02 -0500 191) 				       struct ext4_xattr_ibody_find *is);
879b38257bf2b (Tao Ma                      2012-12-05 10:28:46 -0500 192) 
7a2508e1b657c (Jan Kara                    2016-02-22 22:35:22 -0500 193) extern struct mb_cache *ext4_xattr_create_cache(void);
7a2508e1b657c (Jan Kara                    2016-02-22 22:35:22 -0500 194) extern void ext4_xattr_destroy_cache(struct mb_cache *);
9c191f701ce9f (T Makphaibulchoke           2014-03-18 19:24:49 -0400 195) 
03010a3350301 (Theodore Ts'o               2008-10-10 20:02:48 -0400 196) #ifdef CONFIG_EXT4_FS_SECURITY
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700 197) extern int ext4_init_security(handle_t *handle, struct inode *inode,
2a7dba391e562 (Eric Paris                  2011-02-01 11:05:39 -0500 198) 			      struct inode *dir, const struct qstr *qstr);
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 199) #else
617ba13b31fbf (Mingming Cao                2006-10-11 01:20:53 -0700 200) static inline int ext4_init_security(handle_t *handle, struct inode *inode,
2a7dba391e562 (Eric Paris                  2011-02-01 11:05:39 -0500 201) 				     struct inode *dir, const struct qstr *qstr)
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 202) {
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 203) 	return 0;
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 204) }
ac27a0ec112a0 (Dave Kleikamp               2006-10-11 01:20:50 -0700 205) #endif
33d201e0277b2 (Tahsin Erdogan              2017-06-21 21:17:10 -0400 206) 
33d201e0277b2 (Tahsin Erdogan              2017-06-21 21:17:10 -0400 207) #ifdef CONFIG_LOCKDEP
33d201e0277b2 (Tahsin Erdogan              2017-06-21 21:17:10 -0400 208) extern void ext4_xattr_inode_set_class(struct inode *ea_inode);
33d201e0277b2 (Tahsin Erdogan              2017-06-21 21:17:10 -0400 209) #else
33d201e0277b2 (Tahsin Erdogan              2017-06-21 21:17:10 -0400 210) static inline void ext4_xattr_inode_set_class(struct inode *ea_inode) { }
33d201e0277b2 (Tahsin Erdogan              2017-06-21 21:17:10 -0400 211) #endif
7a9ca53aea10a (Tahsin Erdogan              2017-06-22 11:46:48 -0400 212) 
7a9ca53aea10a (Tahsin Erdogan              2017-06-22 11:46:48 -0400 213) extern int ext4_get_inode_usage(struct inode *inode, qsize_t *usage);