From: Hou Tao <houtao1@huawei.com>
To: xfs@oss.sgi.com
Cc: miaoxie@huawei.com, fangwei1@huawei.com
Subject: [PATCH] xfs: simplify the calculation of tpp at xfs_bmdr_to_bmbt
Date: Fri, 24 Jun 2016 13:39:20 +0800 [thread overview]
Message-ID: <1466746760-155962-1-git-send-email-houtao1@huawei.com> (raw)
remove the usage of rblocklen at xfs_bmdr_to_bmbt, and
use be16_to_cpu(dblock->bb_numrecs) instead. It also
reduces an extra calculation.
Signed-off-by: Hou Tao <houtao1@huawei.com>
---
fs/xfs/libxfs/xfs_bmap_btree.c | 5 ++---
fs/xfs/libxfs/xfs_bmap_btree.h | 2 +-
fs/xfs/libxfs/xfs_inode_fork.c | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index 6282f6e..452cad9 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -59,8 +59,7 @@ xfs_bmdr_to_bmbt(
struct xfs_inode *ip,
xfs_bmdr_block_t *dblock,
int dblocklen,
- struct xfs_btree_block *rblock,
- int rblocklen)
+ struct xfs_btree_block *rblock)
{
struct xfs_mount *mp = ip->i_mount;
int dmxr;
@@ -85,8 +84,8 @@ xfs_bmdr_to_bmbt(
fkp = XFS_BMDR_KEY_ADDR(dblock, 1);
tkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1);
fpp = XFS_BMDR_PTR_ADDR(dblock, 1, dmxr);
- tpp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, rblocklen);
dmxr = be16_to_cpu(dblock->bb_numrecs);
+ tpp = XFS_BMBT_PTR_ADDR(mp, rblock, 1, dmxr);
memcpy(tkp, fkp, sizeof(*fkp) * dmxr);
memcpy(tpp, fpp, sizeof(*fpp) * dmxr);
}
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.h b/fs/xfs/libxfs/xfs_bmap_btree.h
index 819a8a4..b1d30f7 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.h
+++ b/fs/xfs/libxfs/xfs_bmap_btree.h
@@ -105,7 +105,7 @@ struct xfs_trans;
* Prototypes for xfs_bmap.c to call.
*/
extern void xfs_bmdr_to_bmbt(struct xfs_inode *, xfs_bmdr_block_t *, int,
- struct xfs_btree_block *, int);
+ struct xfs_btree_block *);
extern void xfs_bmbt_get_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s);
extern xfs_filblks_t xfs_bmbt_get_blockcount(xfs_bmbt_rec_host_t *r);
extern xfs_fsblock_t xfs_bmbt_get_startblock(xfs_bmbt_rec_host_t *r);
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
index bbcc8c7..23967aa 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.c
+++ b/fs/xfs/libxfs/xfs_inode_fork.c
@@ -433,7 +433,7 @@ xfs_iformat_btree(
* to the in-memory structure.
*/
xfs_bmdr_to_bmbt(ip, dfp, XFS_DFORK_SIZE(dip, ip->i_mount, whichfork),
- ifp->if_broot, size);
+ ifp->if_broot);
ifp->if_flags &= ~XFS_IFEXTENTS;
ifp->if_flags |= XFS_IFBROOT;
--
2.5.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2016-06-24 5:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-24 5:39 Hou Tao [this message]
2016-06-24 6:38 ` [PATCH] xfs: simplify the calculation of tpp at xfs_bmdr_to_bmbt Dave Chinner
2016-06-24 7:01 ` Hou Tao
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=1466746760-155962-1-git-send-email-houtao1@huawei.com \
--to=houtao1@huawei.com \
--cc=fangwei1@huawei.com \
--cc=miaoxie@huawei.com \
--cc=xfs@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.