Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: gaoxiang25@huawei.com (Gao Xiang)
Subject: [PATCH] staging: erofs: removing an extra call to iloc() in fill_inode()
Date: Wed, 14 Aug 2019 09:59:44 +0800	[thread overview]
Message-ID: <20190814015944.GA11254@138> (raw)
In-Reply-To: <20190813203840.13782-1-pratikshinde320@gmail.com>

Hi Pratik,

On Wed, Aug 14, 2019@02:08:40AM +0530, Pratik Shinde wrote:
> in fill_inode() we call iloc() twice.Avoiding the extra call by
> storing the result.
> 
> Signed-off-by: Pratik Shinde <pratikshinde320 at gmail.com>

I have no objection of this patch, but I'd like to
hear Chao/Greg's idea about this...

Thanks,
Gao Xiang

> ---
>  drivers/staging/erofs/inode.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
> index 4c3d8bf..d82ba6c 100644
> --- a/drivers/staging/erofs/inode.c
> +++ b/drivers/staging/erofs/inode.c
> @@ -167,11 +167,12 @@ static int fill_inode(struct inode *inode, int isdir)
>  	int err;
>  	erofs_blk_t blkaddr;
>  	unsigned int ofs;
> +	erofs_off_t inode_loc;
>  
>  	trace_erofs_fill_inode(inode, isdir);
> -
> -	blkaddr = erofs_blknr(iloc(sbi, vi->nid));
> -	ofs = erofs_blkoff(iloc(sbi, vi->nid));
> +	inode_loc = iloc(sbi, vi->nid);
> +	blkaddr = erofs_blknr(inode_loc);
> +	ofs = erofs_blkoff(inode_loc);
>  
>  	debugln("%s, reading inode nid %llu at %u of blkaddr %u",
>  		__func__, vi->nid, ofs, blkaddr);
> -- 
> 2.9.3
> 

  reply	other threads:[~2019-08-14  1:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 20:38 [PATCH] staging: erofs: removing an extra call to iloc() in fill_inode() Pratik Shinde
2019-08-14  1:59 ` Gao Xiang [this message]
2019-08-14  1:56   ` Chao Yu
2019-08-14  2:24     ` Gao Xiang
2019-08-14  3:52       ` Pratik Shinde
2019-08-14  6:36         ` Chao Yu
2019-08-14  8:02         ` Gao Xiang

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=20190814015944.GA11254@138 \
    --to=gaoxiang25@huawei.com \
    /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