From: Christoph Hellwig <hch@infradead.org>
To: xfs@oss.sgi.com
Subject: Re: [PATCH] db: stop using xfs_bmbt_rec_32_t
Date: Wed, 25 Nov 2009 16:10:38 -0500 [thread overview]
Message-ID: <20091125211038.GA12720@infradead.org> (raw)
In-Reply-To: <20091103155019.GA28991@infradead.org>
ping?
On Tue, Nov 03, 2009 at 10:50:19AM -0500, Christoph Hellwig wrote:
> xfs_db uses the xfs_bmbt_rec_32_t type to pass around extent information in a
> few places. But everywhere where we actually use it we use the normal
> xfs_bmbt_rec_t just casting from/to xfs_bmbt_rec_32_t to pass it around.
>
> Just pass the xfs_bmbt_rec_t directly and thus get rid of the last use
> of xfs_bmbt_rec_32_t in xfsprogs.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: xfsprogs-dev/db/check.c
> ===================================================================
> --- xfsprogs-dev.orig/db/check.c 2009-10-11 03:16:17.350004081 +0200
> +++ xfsprogs-dev/db/check.c 2009-11-03 16:46:56.067277983 +0100
> @@ -265,7 +265,7 @@ static int ncheck_f(int argc, char **ar
> static char *prepend_path(char *oldpath, char *parent);
> static xfs_ino_t process_block_dir_v2(blkmap_t *blkmap, int *dot,
> int *dotdot, inodata_t *id);
> -static void process_bmbt_reclist(xfs_bmbt_rec_32_t *rp, int numrecs,
> +static void process_bmbt_reclist(xfs_bmbt_rec_t *rp, int numrecs,
> dbm_t type, inodata_t *id,
> xfs_drfsbno_t *tot,
> blkmap_t **blkmapp);
> @@ -2012,7 +2012,7 @@ process_block_dir_v2(
>
> static void
> process_bmbt_reclist(
> - xfs_bmbt_rec_32_t *rp,
> + xfs_bmbt_rec_t *rp,
> int numrecs,
> dbm_t type,
> inodata_t *id,
> @@ -2038,7 +2038,7 @@ process_bmbt_reclist(
> iagno = XFS_INO_TO_AGNO(mp, id->ino);
> iagbno = XFS_INO_TO_AGBNO(mp, id->ino);
> for (i = 0; i < numrecs; i++, rp++) {
> - convert_extent((xfs_bmbt_rec_64_t *)rp, &o, &s, &c, &f);
> + convert_extent(rp, &o, &s, &c, &f);
> if (v)
> dbprintf(_("inode %lld extent [%lld,%lld,%lld,%d]\n"),
> id->ino, o, s, c, f);
> @@ -2120,7 +2120,6 @@ process_btinode(
> xfs_bmdr_block_t *dib;
> int i;
> xfs_bmbt_ptr_t *pp;
> - xfs_bmbt_rec_32_t *rp;
>
> dib = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
> if (be16_to_cpu(dib->bb_level) >= XFS_BM_MAXLEVELS(mp, whichfork)) {
> @@ -2146,7 +2145,7 @@ process_btinode(
> return;
> }
> if (be16_to_cpu(dib->bb_level) == 0) {
> - rp = (xfs_bmbt_rec_32_t *)XFS_BMDR_REC_ADDR(dib, 1);
> + xfs_bmbt_rec_t *rp = XFS_BMDR_REC_ADDR(dib, 1);
> process_bmbt_reclist(rp, be16_to_cpu(dib->bb_numrecs), type,
> id, totd, blkmapp);
> *nex += be16_to_cpu(dib->bb_numrecs);
> @@ -2579,12 +2578,12 @@ process_exinode(
> blkmap_t **blkmapp,
> int whichfork)
> {
> - xfs_bmbt_rec_32_t *rp;
> + xfs_bmbt_rec_t *rp;
>
> - rp = (xfs_bmbt_rec_32_t *)XFS_DFORK_PTR(dip, whichfork);
> + rp = (xfs_bmbt_rec_t *)XFS_DFORK_PTR(dip, whichfork);
> *nex = XFS_DFORK_NEXTENTS(dip, whichfork);
> if (*nex < 0 || *nex > XFS_DFORK_SIZE(dip, mp, whichfork) /
> - sizeof(xfs_bmbt_rec_32_t)) {
> + sizeof(xfs_bmbt_rec_t)) {
> if (!sflag || id->ilist)
> dbprintf(_("bad number of extents %d for inode %lld\n"),
> *nex, id->ino);
> @@ -4207,7 +4206,7 @@ scanfunc_bmap(
> xfs_agnumber_t agno;
> int i;
> xfs_bmbt_ptr_t *pp;
> - xfs_bmbt_rec_32_t *rp;
> + xfs_bmbt_rec_t *rp;
>
> agno = XFS_FSB_TO_AGNO(mp, bno);
> agbno = XFS_FSB_TO_AGBNO(mp, bno);
> @@ -4240,7 +4239,7 @@ scanfunc_bmap(
> error++;
> return;
> }
> - rp = (xfs_bmbt_rec_32_t *)XFS_BMBT_REC_ADDR(mp, block, 1);
> + rp = XFS_BMBT_REC_ADDR(mp, block, 1);
> *nex += be16_to_cpu(block->bb_numrecs);
> process_bmbt_reclist(rp, be16_to_cpu(block->bb_numrecs), type, id, totd,
> blkmapp);
> Index: xfsprogs-dev/db/frag.c
> ===================================================================
> --- xfsprogs-dev.orig/db/frag.c 2009-10-11 03:16:17.364007469 +0200
> +++ xfsprogs-dev/db/frag.c 2009-11-03 16:46:56.068277413 +0100
> @@ -66,7 +66,7 @@ static void extmap_set_ext(extmap_t **e
> xfs_extlen_t c);
> static int frag_f(int argc, char **argv);
> static int init(int argc, char **argv);
> -static void process_bmbt_reclist(xfs_bmbt_rec_32_t *rp, int numrecs,
> +static void process_bmbt_reclist(xfs_bmbt_rec_t *rp, int numrecs,
> extmap_t **extmapp);
> static void process_btinode(xfs_dinode_t *dip, extmap_t **extmapp,
> int whichfork);
> @@ -223,7 +223,7 @@ init(
>
> static void
> process_bmbt_reclist(
> - xfs_bmbt_rec_32_t *rp,
> + xfs_bmbt_rec_t *rp,
> int numrecs,
> extmap_t **extmapp)
> {
> @@ -234,7 +234,7 @@ process_bmbt_reclist(
> xfs_dfsbno_t s;
>
> for (i = 0; i < numrecs; i++, rp++) {
> - convert_extent((xfs_bmbt_rec_64_t *)rp, &o, &s, &c, &f);
> + convert_extent(rp, &o, &s, &c, &f);
> extmap_set_ext(extmapp, (xfs_fileoff_t)o, (xfs_extlen_t)c);
> }
> }
> @@ -248,11 +248,10 @@ process_btinode(
> xfs_bmdr_block_t *dib;
> int i;
> xfs_bmbt_ptr_t *pp;
> - xfs_bmbt_rec_32_t *rp;
>
> dib = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
> if (be16_to_cpu(dib->bb_level) == 0) {
> - rp = (xfs_bmbt_rec_32_t *)XFS_BMDR_REC_ADDR(dib, 1);
> + xfs_bmbt_rec_t *rp = XFS_BMDR_REC_ADDR(dib, 1);
> process_bmbt_reclist(rp, be16_to_cpu(dib->bb_numrecs), extmapp);
> return;
> }
> @@ -270,9 +269,9 @@ process_exinode(
> extmap_t **extmapp,
> int whichfork)
> {
> - xfs_bmbt_rec_32_t *rp;
> + xfs_bmbt_rec_t *rp;
>
> - rp = (xfs_bmbt_rec_32_t *)XFS_DFORK_PTR(dip, whichfork);
> + rp = (xfs_bmbt_rec_t *)XFS_DFORK_PTR(dip, whichfork);
> process_bmbt_reclist(rp, XFS_DFORK_NEXTENTS(dip, whichfork), extmapp);
> }
>
> @@ -448,8 +447,7 @@ scanfunc_bmap(
> return;
> }
> rp = XFS_BMBT_REC_ADDR(mp, block, 1);
> - process_bmbt_reclist((xfs_bmbt_rec_32_t *)rp,
> - nrecs, extmapp);
> + process_bmbt_reclist(rp, nrecs, extmapp);
> return;
> }
>
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
---end quoted text---
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2009-11-25 21:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-03 15:50 [PATCH] db: stop using xfs_bmbt_rec_32_t Christoph Hellwig
2009-11-25 21:10 ` Christoph Hellwig [this message]
2009-12-02 17:37 ` Eric Sandeen
2009-12-04 10:04 ` Christoph Hellwig
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=20091125211038.GA12720@infradead.org \
--to=hch@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox