erofs-utils: pass down inode for erofs_prepare_xattr_ibody
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 erofs-utils: pass down inode for erofs_prepare_xattr_ibody
From: Gao Xiang <[email protected]>
Instead of several independent arguments for convenience. No logic changes.
Signed-off-by Gao Xiang <[email protected]>
--- include/erofs/xattr.h | 3 +-- lib/inode.c | 4 +--- lib/xattr.c | 7 ++++--- 3 files changed, 6 insertions(+), 8 deletions(-)
include/erofs/xattr.h +1 -2
@@ -42,8 +42,7 @@#define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default"#endif -int erofs_prepare_xattr_ibody (const char *path,mode_t mode, -struct list_head *ixattrs); +int erofs_prepare_xattr_ibody (struct erofs_inode *inode);char *erofs_export_xattr_ibody (struct list_head *ixattrs,unsigned int size);int erofs_build_shared_xattrs_from_path (const char *path);
lib/inode.c +1 -3
@@ -827,11 +827,9 @@ struct erofs_inode *erofs_mkfs_build_tree(struct erofs_inode *dir)struct dirent *dp;struct erofs_dentry *d; - ret =erofs_prepare_xattr_ibody (dir->i_srcpath, - dir->i_mode, &dir->i_xattrs); + ret =erofs_prepare_xattr_ibody (dir);if (ret <0 )return ERR_PTR (ret); - dir->xattr_isize = ret;if (!S_ISDIR (dir->i_mode)) {if (S_ISLNK (dir->i_mode)) {
lib/xattr.c +4 -3
@@ -352,17 +352,17 @@ err:return ret; } -int erofs_prepare_xattr_ibody (const char *path,mode_t mode, -struct list_head *ixattrs) +int erofs_prepare_xattr_ibody (struct erofs_inode *inode) {int ret;struct inode_xattr_node *node; +struct list_head *ixattrs = &inode->i_xattrs;/* check if xattr is disabled */ if (cfg.c_inline_xattr_tolerance <0 )return 0 ; - ret =read_xattrs_from_file (path, mode, ixattrs); + ret =read_xattrs_from_file (inode->i_srcpath, inode->i_mode, ixattrs);if (ret <0 )return ret;
@@ -381,6 +381,7 @@ int erofs_prepare_xattr_ibody(const char *path, mode_t mode, ret +=sizeof (struct erofs_xattr_entry ); ret =EROFS_XATTR_ALIGN (ret + item->len[0 ] + item->len[1 ]); } + inode->xattr_isize = ret;return ret; }
Signature · 1 line
2.24.0
Quoted 13 lines · Gao Xiang via Linux-erofs
From: Gao Xiang <[email protected]>
Instead of several independent arguments for convenience. No logic changes.
Signed-off-by Gao Xiang <[email protected]>---
It looks good
Reviewed-by Li Guifu <[email protected]>