Linux-EROFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] erofs-utils: pass down inode for erofs_prepare_xattr_ibody
       [not found] <20200617072744.7979-1-hsiangkao.ref@aol.com>
@ 2020-06-17  7:27 ` Gao Xiang via Linux-erofs
  2020-06-19 16:34   ` Li GuiFu via Linux-erofs
  0 siblings, 1 reply; 2+ messages in thread
From: Gao Xiang via Linux-erofs @ 2020-06-17  7:27 UTC (permalink / raw)
  To: linux-erofs

From: Gao Xiang <hsiangkao@redhat.com>

Instead of several independent arguments for convenience.
No logic changes.

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
---
 include/erofs/xattr.h | 3 +--
 lib/inode.c           | 4 +---
 lib/xattr.c           | 7 ++++---
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/include/erofs/xattr.h b/include/erofs/xattr.h
index 2e99669..9e2e1ea 100644
--- a/include/erofs/xattr.h
+++ b/include/erofs/xattr.h
@@ -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);
 
diff --git a/lib/inode.c b/lib/inode.c
index dff5f2c..5013184 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -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)) {
diff --git a/lib/xattr.c b/lib/xattr.c
index aa614f6..769ab9c 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -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;
 }
 
-- 
2.24.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] erofs-utils: pass down inode for erofs_prepare_xattr_ibody
  2020-06-17  7:27 ` [PATCH] erofs-utils: pass down inode for erofs_prepare_xattr_ibody Gao Xiang via Linux-erofs
@ 2020-06-19 16:34   ` Li GuiFu via Linux-erofs
  0 siblings, 0 replies; 2+ messages in thread
From: Li GuiFu via Linux-erofs @ 2020-06-19 16:34 UTC (permalink / raw)
  To: linux-erofs, Gao Xiang


On 2020/6/17 15:27, Gao Xiang via Linux-erofs wrote:
> From: Gao Xiang <hsiangkao@redhat.com>
>
> Instead of several independent arguments for convenience.
> No logic changes.
>
> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
> ---
>  
>
> It looks good
>
> Reviewed-by: Li Guifu <bluce.lee@aliyun.com>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200617072744.7979-1-hsiangkao.ref@aol.com>
2020-06-17  7:27 ` [PATCH] erofs-utils: pass down inode for erofs_prepare_xattr_ibody Gao Xiang via Linux-erofs
2020-06-19 16:34   ` Li GuiFu via Linux-erofs

Linux-EROFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-erofs/0 linux-erofs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-erofs linux-erofs/ https://lore.kernel.org/linux-erofs \
		linux-erofs@lists.ozlabs.org linux-erofs@ozlabs.org
	public-inbox-index linux-erofs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linux-erofs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git