diff options
author | Pratik Shinde <pratikshinde320@gmail.com> | 2019-08-14 02:08:40 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-15 14:20:31 +0200 |
commit | a72553505f11d507ef8d86ea9cb94da68011f417 (patch) | |
tree | dfee7d34f78d21f779149010a5bfe0a8d3603199 | |
parent | c391818a10def7f5aa989842892a4306e75c917d (diff) |
staging: erofs: removing an extra call to iloc() in fill_inode()
in fill_inode() we call iloc() twice.Avoiding the extra call by
storing the result.
Signed-off-by: Pratik Shinde <pratikshinde320@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Cc: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190813203840.13782-1-pratikshinde320@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/erofs/inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index 286729143365..05de0236aa88 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -161,11 +161,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); |