mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Jingbo Xu <jefflexu@linux.alibaba.com>,
	chao@kernel.org, huyue2@coolpad.com,
	linux-erofs@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 1/5] erofs: use absolute position in xattr iterator
Date: Fri, 9 Jun 2023 11:31:19 +0800	[thread overview]
Message-ID: <7b0ac912-6606-0a76-608d-59f8e2b113ea@linux.alibaba.com> (raw)
In-Reply-To: <20230608113020.66626-2-jefflexu@linux.alibaba.com>



On 2023/6/8 19:30, Jingbo Xu wrote:
> Replace blkaddr/ofs with pos in 'struct erofs_xattr_iter'.
> 
> After erofs_bread() is introduced to replace raw page cache APIs for
> metadata I/Os handling, xattr_iter_fixup() is no longer needed anymore.
> 
> In addition, it is also unnecessary to check if the iterated position is
> span over the block boundary as absolute offset is used instead of
> blkaddr + offset pairs.
> 
> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>

...

>   
> @@ -399,9 +365,10 @@ static int shared_getxattr(struct inode *inode, struct getxattr_iter *it)
>   
>   	for (i = 0; i < vi->xattr_shared_count; ++i) {
>   		xsid = vi->xattr_shared_xattrs[i];
> -		it->it.blkaddr = erofs_xattr_blkaddr(sb, xsid);
> -		it->it.ofs = erofs_xattr_blkoff(sb, xsid);
> -		it->it.kaddr = erofs_bread(&it->it.buf, it->it.blkaddr, EROFS_KMAP);
> +		it->it.pos = erofs_pos(sb, EROFS_SB(sb)->xattr_blkaddr) +
> +				       xsid * sizeof(__u32);

					^ sizeof(__le32); ?

> +		it->it.kaddr = erofs_bread(&it->it.buf,
> +				erofs_blknr(sb, it->it.pos), EROFS_KMAP);
>   		if (IS_ERR(it->it.kaddr))
>   			return PTR_ERR(it->it.kaddr);
>   
> @@ -604,9 +571,10 @@ static int shared_listxattr(struct listxattr_iter *it)
>   
>   	for (i = 0; i < vi->xattr_shared_count; ++i) {
>   		xsid = vi->xattr_shared_xattrs[i];
> -		it->it.blkaddr = erofs_xattr_blkaddr(sb, xsid);
> -		it->it.ofs = erofs_xattr_blkoff(sb, xsid);
> -		it->it.kaddr = erofs_bread(&it->it.buf, it->it.blkaddr, EROFS_KMAP);
> +		it->it.pos = erofs_pos(sb, EROFS_SB(sb)->xattr_blkaddr) +
> +				       xsid * sizeof(__u32);

					^ sizeof(__le32); ?


Otherwise it looks good to me.

Thanks,
Gao Xiang

  reply	other threads:[~2023-06-09  3:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 11:30 [PATCH v6 0/5] erofs: cleanup of xattr handling Jingbo Xu
2023-06-08 11:30 ` [PATCH v6 1/5] erofs: use absolute position in xattr iterator Jingbo Xu
2023-06-09  3:31   ` Gao Xiang [this message]
2023-06-08 11:30 ` [PATCH v6 2/5] erofs: unify xattr_iter structures Jingbo Xu
2023-06-08 11:30 ` [PATCH v6 3/5] erofs: make the size of read data stored in buffer_ofs Jingbo Xu
2023-06-08 11:30 ` [PATCH v6 4/5] erofs: unify inline/share xattr iterators for listxattr/getxattr Jingbo Xu
2023-06-12  3:01   ` Gao Xiang
2023-06-08 11:30 ` [PATCH v6 5/5] erofs: use separate xattr parsers " Jingbo Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b0ac912-6606-0a76-608d-59f8e2b113ea@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=huyue2@coolpad.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®