From: Gou Hao gouhao@uniontech.com
uniontech inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I40JRR CVE: NA
--------------
Add alloc xattr block interface.
Signed-off-by: Gou Hao gouhao@uniontech.com --- fs/eulerfs/alloc_interface.h | 4 ++++ fs/eulerfs/nvalloc.c | 1 + fs/eulerfs/nvalloc.h | 1 + 3 files changed, 6 insertions(+)
diff --git a/fs/eulerfs/alloc_interface.h b/fs/eulerfs/alloc_interface.h index 22d30c7672e0..23280551918f 100644 --- a/fs/eulerfs/alloc_interface.h +++ b/fs/eulerfs/alloc_interface.h @@ -79,6 +79,10 @@ static __always_inline void *eufs_malloc_inode_ext(struct super_block *sb) { return nvmalloc(sb, PAGE_SIZE, EUFS_PAGE_INODE_EXT, false); } +static __always_inline void *eufs_zalloc_inode_xattr(struct super_block *sb) +{ + return nvzalloc(sb, PAGE_SIZE, EUFS_PAGE_INODE_XATTR, false); +}
static __always_inline void nv_zfree(struct super_block *sb, void *p) { diff --git a/fs/eulerfs/nvalloc.c b/fs/eulerfs/nvalloc.c index 8b60a2494636..c774f7ac8bc5 100644 --- a/fs/eulerfs/nvalloc.c +++ b/fs/eulerfs/nvalloc.c @@ -313,6 +313,7 @@ static void partition(struct super_block *sb, bool init) case EUFS_PAGE_HTABLE: case EUFS_PAGE_SYMLINK: case EUFS_PAGE_INODE_EXT: + case EUFS_PAGE_INODE_XATTR: BUG_ON(init); node->busy = true; node->solid = true; diff --git a/fs/eulerfs/nvalloc.h b/fs/eulerfs/nvalloc.h index a39b81862bfb..abc45443fb35 100644 --- a/fs/eulerfs/nvalloc.h +++ b/fs/eulerfs/nvalloc.h @@ -123,6 +123,7 @@ struct mem_pool { #define EUFS_PAGE_HTABLE (10) #define EUFS_PAGE_SYMLINK (11) #define EUFS_PAGE_INODE_EXT (12) +#define EUFS_PAGE_INODE_XATTR (13)
#define EUFS_LINE4_INODE (4) #define EUFS_LINE_DENTRY (5)