All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] db: stop using xfs_bmbt_rec_32_t
@ 2009-11-03 15:50 Christoph Hellwig
  2009-11-25 21:10 ` Christoph Hellwig
  2009-12-02 17:37 ` Eric Sandeen
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2009-11-03 15:50 UTC (permalink / raw)
  To: xfs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] db: stop using xfs_bmbt_rec_32_t
  2009-11-03 15:50 [PATCH] db: stop using xfs_bmbt_rec_32_t Christoph Hellwig
@ 2009-11-25 21:10 ` Christoph Hellwig
  2009-12-02 17:37 ` Eric Sandeen
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2009-11-25 21:10 UTC (permalink / raw)
  To: xfs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] db: stop using xfs_bmbt_rec_32_t
  2009-11-03 15:50 [PATCH] db: stop using xfs_bmbt_rec_32_t Christoph Hellwig
  2009-11-25 21:10 ` Christoph Hellwig
@ 2009-12-02 17:37 ` Eric Sandeen
  2009-12-04 10:04   ` Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2009-12-02 17:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

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>

Seems fine.

After this should the db references to xfs_bmbt_rec_64_t be
changed to xfs_bmbt_rec_t perhaps?

Reviewed-by: Eric Sandeen <sandeen@sandeen.net>

> 
> 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
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] db: stop using xfs_bmbt_rec_32_t
  2009-12-02 17:37 ` Eric Sandeen
@ 2009-12-04 10:04   ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2009-12-04 10:04 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, xfs

On Wed, Dec 02, 2009 at 11:37:44AM -0600, Eric Sandeen wrote:
> 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>
> 
> Seems fine.
> 
> After this should the db references to xfs_bmbt_rec_64_t be
> changed to xfs_bmbt_rec_t perhaps?

Yes, except that we don't actually have the struct type for it yet which
we'll need in at least one place.  I'll do it once I've removed the _32
and _64 types in the kernel and synced over the changes to userspace.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-04 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-03 15:50 [PATCH] db: stop using xfs_bmbt_rec_32_t Christoph Hellwig
2009-11-25 21:10 ` Christoph Hellwig
2009-12-02 17:37 ` Eric Sandeen
2009-12-04 10:04   ` Christoph Hellwig

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.