db: stop using xfs_bmbt_rec_32_t
PATCH 1/1 db: stop using xfs_bmbt_rec_32_t
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.
db/check.c +9 -10
@@ -265,7 +265,7 @@ static int ncheck_f(int argc, char **arstatic 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);
db/frag.c +7 -9
@@ -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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
ping?
Quoted 158 lines · Christoph Hellwig
xfs_dbuses thexfs_bmbt_rec_32_ttype to pass around extent information in a few places. But everywhere where we actually use it we use the normalxfs_bmbt_rec_tjust casting from/toxfs_bmbt_rec_32_tto pass it around.Just pass the
xfs_bmbt_rec_tdirectly and thus get rid of the last use ofxfs_bmbt_rec_32_tin xfsprogs.Signed-off-by Christoph Hellwig <[email protected]>Index:
xfsprogs-dev/db/check.c
===================================================================db/check.c +9
-10@@ -265,7 +265,7 @@ static int ncheck_f(int argc, char **arstatic 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
===================================================================db/frag.c +7
-9@@ -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 ; }
Quoted 4 lines
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
---end quoted text---
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 8 lines · Christoph Hellwig
xfs_dbuses thexfs_bmbt_rec_32_ttype to pass around extent information in a few places. But everywhere where we actually use it we use the normalxfs_bmbt_rec_tjust casting from/toxfs_bmbt_rec_32_tto pass it around.Just pass the
xfs_bmbt_rec_tdirectly and thus get rid of the last use ofxfs_bmbt_rec_32_tin xfsprogs.Signed-off-by Christoph Hellwig <[email protected]>
Seems fine.
After this should the db references to xfs_bmbt_rec_64_t be changed to xfs_bmbt_rec_t perhaps?
Quoted 150 lines
Index:
xfsprogs-dev/db/check.c
===================================================================db/check.c +9
-10@@ -265,7 +265,7 @@ static int ncheck_f(int argc, char **arstatic 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
===================================================================db/frag.c +7
-9@@ -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 ; }
Quoted 5 lines
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 8 lines · Eric Sandeen
Quoted 7 lines · Christoph Hellwig
xfs_dbuses thexfs_bmbt_rec_32_ttype to pass around extent information in a few places. But everywhere where we actually use it we use the normalxfs_bmbt_rec_tjust casting from/toxfs_bmbt_rec_32_tto pass it around.Just pass the
xfs_bmbt_rec_tdirectly and thus get rid of the last use ofxfs_bmbt_rec_32_tin xfsprogs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Christoph Hellwig <[email protected]>Seems fine.
After this should the db references to
xfs_bmbt_rec_64_tbe changed toxfs_bmbt_rec_tperhaps?
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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs