xfsprogs: get rid of XFS_IALLOC_BLOCKS macros
PATCH 3/6 xfsprogs: get rid of XFS_IALLOC_BLOCKS macros
From: Jie Liu <[email protected]>
Get rid of XFS_IALLOC_BLOCKS() macros, use mp->m_ialloc_blks directly.
--- db/check.c | 2 +- db/frag.c | 2 +- db/metadump.c | 2 +- include/xfs_ialloc.h | 5 ----- include/xfs_trans_space.h | 2 +- libxfs/xfs_ialloc.c | 8 ++++---- libxfs/xfs_trans_resv.c | 8 ++++---- mkfs/proto.c | 2 +- repair/dino_chunks.c | 24 ++++++++++++------------ repair/prefetch.c | 2 +- repair/xfs_repair.c | 4 ++-- 11 files changed, 28 insertions(+), 33 deletions(-)
db/check.c +1 -1
@@ -4223,7 +4223,7 @@ scanfunc_ino(set_cur (&typtab[TYP_INODE ],XFS_AGB_TO_DADDR (mp, seqno,XFS_AGINO_TO_AGBNO (mp, agino)), - (int )XFS_FSB_TO_BB (mp,XFS_IALLOC_BLOCKS (mp)), + (int )XFS_FSB_TO_BB (mp, mp->m_ialloc_blks),DB_RING_IGN ,NULL );if (iocur_top->data ==NULL ) {if (!sflag)
db/frag.c +1 -1
@@ -484,7 +484,7 @@ scanfunc_ino(set_cur (&typtab[TYP_INODE ],XFS_AGB_TO_DADDR (mp, seqno,XFS_AGINO_TO_AGBNO (mp, agino)), -XFS_FSB_TO_BB (mp,XFS_IALLOC_BLOCKS (mp)), +XFS_FSB_TO_BB (mp, mp->m_ialloc_blks),DB_RING_IGN ,NULL );if (iocur_top->data ==NULL ) { dbprintf(_("can't read inode block %u/%u\n"),
db/metadump.c +1 -1
@@ -1848,7 +1848,7 @@ copy_inode_chunk(push_cur ();set_cur (&typtab[TYP_INODE ],XFS_AGB_TO_DADDR (mp, agno, agbno), -XFS_FSB_TO_BB (mp,XFS_IALLOC_BLOCKS (mp)), +XFS_FSB_TO_BB (mp, mp->m_ialloc_blks),DB_RING_IGN ,NULL );if (iocur_top->data ==NULL ) {print_warning ("cannot read inode block %u/%u" , agno, agbno);
include/xfs_ialloc.h +0 -5
@@ -26,11 +26,6 @@ struct xfs_trans;struct xfs_btree_cur ;/* -* Allocation parameters for inode allocation. -*/ -#define XFS_IALLOC_BLOCKS (mp) (mp)->m_ialloc_blks - -/* * Move inodes in clusters of this size. */ #define XFS_INODE_BIG_CLUSTER_SIZE 8192
include/xfs_trans_space.h +1 -1
@@ -47,7 +47,7 @@#define XFS_DIRREMOVE_SPACE_RES (mp) \ XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)#define XFS_IALLOC_SPACE_RES (mp) \ - (XFS_IALLOC_BLOCKS(mp) + (mp)->m_in_maxlevels - 1) + ((mp)->m_ialloc_blks + (mp)->m_in_maxlevels - 1)/* * Space reservation values for various transactions.
libxfs/xfs_ialloc.c +4 -4
@@ -309,7 +309,7 @@ xfs_ialloc_ag_alloc(if (args.mp->m_maxicount && args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount)return XFS_ERROR (ENOSPC ); - args.minlen = args.maxlen =XFS_IALLOC_BLOCKS (args.mp); + args.minlen = args.maxlen = args.mp->m_ialloc_blks;/* * First try to allocate inodes contiguous with the last-allocated * chunk of inodes. If the filesystem is striped, this will fill
@@ -319,7 +319,7 @@ xfs_ialloc_ag_alloc( newino =be32_to_cpu (agi->agi_newino); agno =be32_to_cpu (agi->agi_seqno); args.agbno =XFS_AGINO_TO_AGBNO (args.mp, newino) + -XFS_IALLOC_BLOCKS (args.mp); + args.mp->m_ialloc_blks;if (likely (newino !=NULLAGINO && (args.agbno <be32_to_cpu (agi->agi_length)))) { args.fsbno =XFS_AGB_TO_FSB (args.mp, agno, args.agbno);
@@ -561,7 +561,7 @@ xfs_ialloc_ag_select(* Is there enough free space for the file plus a block of * inodes? (if we need to allocate some)? */ - ineed =XFS_IALLOC_BLOCKS (mp); + ineed = mp->m_ialloc_blks; longest = pag->pagf_longest;if (!longest) longest = pag->pagf_flcount >0 ;
@@ -1206,7 +1206,7 @@ xfs_difree(xfs_bmap_add_free (XFS_AGB_TO_FSB (mp, agno,XFS_INO_TO_AGBNO (mp,rec.ir_startino)), -XFS_IALLOC_BLOCKS (mp), flist, mp); + mp->m_ialloc_blks, flist, mp); }else { *delete =0 ;
libxfs/xfs_trans_resv.c +4 -4
@@ -157,7 +157,7 @@ xfs_calc_itruncate_reservation(xfs_calc_buf_res (5 ,0 ) +xfs_calc_buf_res (XFS_ALLOCFREE_LOG_COUNT (mp,1 ),XFS_FSB_TO_B (mp,1 )) + -xfs_calc_buf_res (2 +XFS_IALLOC_BLOCKS (mp) + +xfs_calc_buf_res (2 + mp->m_ialloc_blks + mp->m_in_maxlevels, 0))); }
@@ -265,7 +265,7 @@ xfs_calc_create_resv_modify(* For create we can allocate some inodes giving: * the agi and agf of the ag getting the new inodes: 2 * sectorsize * the superblock for the nlink flag: sector size -* the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize +* the inode blocks allocated: mp->m_ialloc_blks * blocksize * the inode btree: max depth * blocksize * the allocation btrees: 2 trees * (max depth - 1) * block size */
@@ -275,7 +275,7 @@ xfs_calc_create_resv_alloc( {return xfs_calc_buf_res (2 , mp->m_sb.sb_sectsize) + mp->m_sb.sb_sectsize + -xfs_calc_buf_res (XFS_IALLOC_BLOCKS (mp),XFS_FSB_TO_B (mp,1 )) + +xfs_calc_buf_res (mp->m_ialloc_blks,XFS_FSB_TO_B (mp,1 )) +xfs_calc_buf_res (mp->m_in_maxlevels,XFS_FSB_TO_B (mp,1 )) +xfs_calc_buf_res (XFS_ALLOCFREE_LOG_COUNT (mp,1 ),XFS_FSB_TO_B (mp,1 ));
@@ -371,7 +371,7 @@ xfs_calc_ifree_reservation(MAX ((__uint16_t )XFS_FSB_TO_B (mp,1 ), mp->m_inode_cluster_size) +xfs_calc_buf_res (1 ,0 ) + -xfs_calc_buf_res (2 +XFS_IALLOC_BLOCKS (mp) + +xfs_calc_buf_res (2 + mp->m_ialloc_blks + mp->m_in_maxlevels,0 ) +xfs_calc_buf_res (XFS_ALLOCFREE_LOG_COUNT (mp,1 ),XFS_FSB_TO_B (mp,1 ));
mkfs/proto.c +1 -1
@@ -39,7 +39,7 @@ static long filesize(int fd);* (basically no fragmentation). */ #define MKFS_BLOCKRES_INODE \ - ((uint)(XFS_IALLOC_BLOCKS(mp) + ((mp)->m_in_maxlevels - 1))) + ((uint)(mp->m_ialloc_blks + ((mp)->m_in_maxlevels - 1)))#define MKFS_BLOCKRES (rb) \ ((uint)(MKFS_BLOCKRES_INODE + XFS_DA_NODE_MAXDEPTH + \ (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1) + (rb)))
repair/dino_chunks.c +12 -12
@@ -117,7 +117,7 @@ verify_inode_chunk(xfs_mount_t *mp, agbno =XFS_INO_TO_AGBNO (mp, ino); *start_ino =NULLFSINO ; -ASSERT (XFS_IALLOC_BLOCKS (mp) >0 ); +ASSERT (mp->m_ialloc_blks >0 );if (agno == mp->m_sb.sb_agcount -1 ) max_agbno = mp->m_sb.sb_dblocks -
@@ -135,7 +135,7 @@ verify_inode_chunk(xfs_mount_t *mp,* check for the easy case, inodes per block >= XFS_INODES_PER_CHUNK * (multiple chunks per block) */ -if (XFS_IALLOC_BLOCKS (mp) ==1 ) { +if (mp->m_ialloc_blks ==1 ) {if (agbno > max_agbno)return 0 ;if (check_aginode_block (mp, agno, agino) ==0 )
@@ -208,7 +208,7 @@ verify_inode_chunk(xfs_mount_t *mp,*/ start_agbno =rounddown (XFS_INO_TO_AGBNO (mp, ino), fs_ino_alignment); - end_agbno = start_agbno +XFS_IALLOC_BLOCKS (mp); + end_agbno = start_agbno + mp->m_ialloc_blks;/* * if this fs has aligned inodes but the end of the
@@ -266,14 +266,14 @@ verify_inode_chunk(xfs_mount_t *mp,* a discovered inode chunk completely within that range * would include the inode passed into us. */ -if (XFS_IALLOC_BLOCKS (mp) >1 ) { +if (mp->m_ialloc_blks >1 ) {if (agino > mp->m_ialloc_inos) - start_agbno = agbno -XFS_IALLOC_BLOCKS (mp) +1 ; + start_agbno = agbno - mp->m_ialloc_blks +1 ;else start_agbno =1 ; } - end_agbno = agbno +XFS_IALLOC_BLOCKS (mp); + end_agbno = agbno + mp->m_ialloc_blks;if (end_agbno > max_agbno) end_agbno = max_agbno;
@@ -328,7 +328,7 @@ verify_inode_chunk(xfs_mount_t *mp, start_agbno =XFS_AGINO_TO_AGBNO (mp, irec_p->ino_startnum) + -XFS_IALLOC_BLOCKS (mp); + mp->m_ialloc_blks;/* * we know that the inode we're trying to verify isn't
@@ -351,7 +351,7 @@ verify_inode_chunk(xfs_mount_t *mp,* the inode in question and that the space between them * is too small for a legal inode chunk */ -if (end_agbno - start_agbno <XFS_IALLOC_BLOCKS (mp)) +if (end_agbno - start_agbno < mp->m_ialloc_blks)return (0 );/*
@@ -395,7 +395,7 @@ verify_inode_chunk(xfs_mount_t *mp, num_blks = chunk_stop_agbno - chunk_start_agbno; -if (num_blks <XFS_IALLOC_BLOCKS (mp) || ino_cnt ==0 ) +if (num_blks < mp->m_ialloc_blks || ino_cnt ==0 )return (0 );/*
@@ -411,8 +411,8 @@ verify_inode_chunk(xfs_mount_t *mp,* the chunk */ -if (num_blks %XFS_IALLOC_BLOCKS (mp) !=0 ) { - num_blks =rounddown (num_blks,XFS_IALLOC_BLOCKS (mp)); +if (num_blks % mp->m_ialloc_blks !=0 ) { + num_blks =rounddown (num_blks, mp->m_ialloc_blks); chunk_stop_agbno = chunk_start_agbno + num_blks; }
@@ -596,7 +596,7 @@ process_inode_chunk(ASSERT (XFS_AGINO_TO_OFFSET (mp, first_irec->ino_startnum) ==0 ); *bogus =0 ; -ASSERT (XFS_IALLOC_BLOCKS (mp) >0 ); +ASSERT (mp->m_ialloc_blks >0 ); blks_per_cluster = mp->m_inode_cluster_size >> mp->m_sb.sb_blocklog;if (blks_per_cluster ==0 )
repair/prefetch.c +1 -1
@@ -846,7 +846,7 @@ start_inode_prefetch( max_queue = libxfs_bcache->c_maxcount / thread_count /8 ;if (mp->m_inode_cluster_size > mp->m_sb.sb_blocksize) max_queue = max_queue * (mp->m_inode_cluster_size >> - mp->m_sb.sb_blocklog) /XFS_IALLOC_BLOCKS (mp); + mp->m_sb.sb_blocklog) / mp->m_ialloc_blks;sem_init (&args->ra_count,0 , max_queue);
repair/xfs_repair.c +2 -2
@@ -441,9 +441,9 @@ calc_mkfs(xfs_mount_t *mp) first_prealloc_ino =XFS_OFFBNO_TO_AGINO (mp, fino_bno,0 ); } -ASSERT (XFS_IALLOC_BLOCKS (mp) >0 ); +ASSERT (mp->m_ialloc_blks >0 ); -if (XFS_IALLOC_BLOCKS (mp) >1 ) +if (mp->m_ialloc_blks >1 ) last_prealloc_ino = first_prealloc_ino +XFS_INODES_PER_CHUNK ;else last_prealloc_ino =XFS_OFFBNO_TO_AGINO (mp, fino_bno +1 ,0 );
Signature · 6 lines
1.8.3.2 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 172 lines · Jeff Liu
From: Jie Liu <[email protected]>
Get rid of
XFS_IALLOC_BLOCKS()macros, usemp->m_ialloc_blksdirectly.Signed-off-by Jie Liu <[email protected]>--- db/check.c | 2 +- db/frag.c | 2 +- db/metadump.c | 2 +- include/xfs_ialloc.h | 5 ----- include/xfs_trans_space.h | 2 +- libxfs/xfs_ialloc.c | 8 ++++---- libxfs/xfs_trans_resv.c | 8 ++++---- mkfs/proto.c | 2 +- repair/dino_chunks.c | 24 ++++++++++++------------ repair/prefetch.c | 2 +- repair/xfs_repair.c | 4 ++-- 11 files changed, 28 insertions(+), 33 deletions(-)db/check.c +1
-1@@ -4223,7 +4223,7 @@ scanfunc_ino(set_cur (&typtab[TYP_INODE ],XFS_AGB_TO_DADDR (mp, seqno,XFS_AGINO_TO_AGBNO (mp, agino)), - (int )XFS_FSB_TO_BB (mp,XFS_IALLOC_BLOCKS (mp)), + (int )XFS_FSB_TO_BB (mp, mp->m_ialloc_blks),DB_RING_IGN ,NULL );if (iocur_top->data ==NULL ) {if (!sflag)db/frag.c +1
-1@@ -484,7 +484,7 @@ scanfunc_ino(set_cur (&typtab[TYP_INODE ],XFS_AGB_TO_DADDR (mp, seqno,XFS_AGINO_TO_AGBNO (mp, agino)), -XFS_FSB_TO_BB (mp,XFS_IALLOC_BLOCKS (mp)), +XFS_FSB_TO_BB (mp, mp->m_ialloc_blks),DB_RING_IGN ,NULL );if (iocur_top->data ==NULL ) { dbprintf(_("can't read inode block %u/%u\n"),db/metadump.c +1
-1@@ -1848,7 +1848,7 @@ copy_inode_chunk(push_cur ();set_cur (&typtab[TYP_INODE ],XFS_AGB_TO_DADDR (mp, agno, agbno), -XFS_FSB_TO_BB (mp,XFS_IALLOC_BLOCKS (mp)), +XFS_FSB_TO_BB (mp, mp->m_ialloc_blks),DB_RING_IGN ,NULL );if (iocur_top->data ==NULL ) {print_warning ("cannot read inode block %u/%u" , agno, agbno);include/xfs_ialloc.h +0
-5@@ -26,11 +26,6 @@ struct xfs_trans;struct xfs_btree_cur ;/* -* Allocation parameters for inode allocation. -*/ -#define XFS_IALLOC_BLOCKS (mp) (mp)->m_ialloc_blks - -/* * Move inodes in clusters of this size. */ #define XFS_INODE_BIG_CLUSTER_SIZE 8192include/xfs_trans_space.h +1
-1@@ -47,7 +47,7 @@#define XFS_DIRREMOVE_SPACE_RES (mp) \ XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)#define XFS_IALLOC_SPACE_RES (mp) \ - (XFS_IALLOC_BLOCKS(mp) + (mp)->m_in_maxlevels - 1) + ((mp)->m_ialloc_blks + (mp)->m_in_maxlevels - 1)/* * Space reservation values for various transactions. libxfs/xfs_ialloc.c +4
-4@@ -309,7 +309,7 @@ xfs_ialloc_ag_alloc(if (args.mp->m_maxicount && args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount)return XFS_ERROR (ENOSPC ); - args.minlen = args.maxlen =XFS_IALLOC_BLOCKS (args.mp); + args.minlen = args.maxlen = args.mp->m_ialloc_blks;/* * First try to allocate inodes contiguous with the last-allocated * chunk of inodes. If the filesystem is striped, this will fill @@ -319,7 +319,7 @@ xfs_ialloc_ag_alloc( newino =be32_to_cpu (agi->agi_newino); agno =be32_to_cpu (agi->agi_seqno); args.agbno =XFS_AGINO_TO_AGBNO (args.mp, newino) + -XFS_IALLOC_BLOCKS (args.mp); + args.mp->m_ialloc_blks;if (likely (newino !=NULLAGINO && (args.agbno <be32_to_cpu (agi->agi_length)))) { args.fsbno =XFS_AGB_TO_FSB (args.mp, agno, args.agbno);@@ -561,7 +561,7 @@ xfs_ialloc_ag_select(* Is there enough free space for the file plus a block of * inodes? (if we need to allocate some)? */ - ineed =XFS_IALLOC_BLOCKS (mp); + ineed = mp->m_ialloc_blks; longest = pag->pagf_longest;if (!longest) longest = pag->pagf_flcount >0 ;@@ -1206,7 +1206,7 @@ xfs_difree(xfs_bmap_add_free (XFS_AGB_TO_FSB (mp, agno,XFS_INO_TO_AGBNO (mp,rec.ir_startino)), -XFS_IALLOC_BLOCKS (mp), flist, mp); + mp->m_ialloc_blks, flist, mp); }else { *delete =0 ;libxfs/xfs_trans_resv.c +4
-4@@ -157,7 +157,7 @@ xfs_calc_itruncate_reservation(xfs_calc_buf_res (5 ,0 ) +xfs_calc_buf_res (XFS_ALLOCFREE_LOG_COUNT (mp,1 ),XFS_FSB_TO_B (mp,1 )) + -xfs_calc_buf_res (2 +XFS_IALLOC_BLOCKS (mp) + +xfs_calc_buf_res (2 + mp->m_ialloc_blks + mp->m_in_maxlevels, 0))); }@@ -265,7 +265,7 @@ xfs_calc_create_resv_modify(* For create we can allocate some inodes giving: * the agi and agf of the ag getting the new inodes: 2 * sectorsize * the superblock for the nlink flag: sector size -* the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize +* the inode blocks allocated: mp->m_ialloc_blks * blocksize * the inode btree: max depth * blocksize * the allocation btrees: 2 trees * (max depth - 1) * block size */ @@ -275,7 +275,7 @@ xfs_calc_create_resv_alloc( {return xfs_calc_buf_res (2 , mp->m_sb.sb_sectsize) + mp->m_sb.sb_sectsize + -xfs_calc_buf_res (XFS_IALLOC_BLOCKS (mp),XFS_FSB_TO_B (mp,1 )) + +xfs_calc_buf_res (mp->m_ialloc_blks,XFS_FSB_TO_B (mp,1 )) +xfs_calc_buf_res (mp->m_in_maxlevels,XFS_FSB_TO_B (mp,1 )) +xfs_calc_buf_res (XFS_ALLOCFREE_LOG_COUNT (mp,1 ),XFS_FSB_TO_B (mp,1 ));@@ -371,7 +371,7 @@ xfs_calc_ifree_reservation(MAX ((__uint16_t )XFS_FSB_TO_B (mp,1 ), mp->m_inode_cluster_size) +xfs_calc_buf_res (1 ,0 ) + -xfs_calc_buf_res (2 +XFS_IALLOC_BLOCKS (mp) + +xfs_calc_buf_res (2 + mp->m_ialloc_blks + mp->m_in_maxlevels,0 ) +xfs_calc_buf_res (XFS_ALLOCFREE_LOG_COUNT (mp,1 ),XFS_FSB_TO_B (mp,1 ));mkfs/proto.c +0
-0
mkfs/proto.c static long filesize(int fd); · line 42
Quoted 5 lines
mkfs/proto.c +1
-1@@ -39,7 +39,7 @@ static long filesize(int fd);* (basically no fragmentation). */ #define MKFS_BLOCKRES_INODE \ - ((uint)(XFS_IALLOC_BLOCKS(mp) + ((mp)->m_in_maxlevels - 1))) + ((uint)(mp->m_ialloc_blks + ((mp)->m_in_maxlevels - 1)))
Nit: (mp)
Probably not necessary here anyways...
Quoted 135 lines
mkfs/proto.c +0
-0#define MKFS_BLOCKRES (rb) \ ((uint)(MKFS_BLOCKRES_INODE + XFS_DA_NODE_MAXDEPTH + \ (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1) + (rb)))repair/dino_chunks.c +12
-12@@ -117,7 +117,7 @@ verify_inode_chunk(xfs_mount_t *mp, agbno =XFS_INO_TO_AGBNO (mp, ino); *start_ino =NULLFSINO ; -ASSERT (XFS_IALLOC_BLOCKS (mp) >0 ); +ASSERT (mp->m_ialloc_blks >0 );if (agno == mp->m_sb.sb_agcount -1 ) max_agbno = mp->m_sb.sb_dblocks -@@ -135,7 +135,7 @@ verify_inode_chunk(xfs_mount_t *mp,* check for the easy case, inodes per block >= XFS_INODES_PER_CHUNK * (multiple chunks per block) */ -if (XFS_IALLOC_BLOCKS (mp) ==1 ) { +if (mp->m_ialloc_blks ==1 ) {if (agbno > max_agbno)return 0 ;if (check_aginode_block (mp, agno, agino) ==0 )@@ -208,7 +208,7 @@ verify_inode_chunk(xfs_mount_t *mp,*/ start_agbno =rounddown (XFS_INO_TO_AGBNO (mp, ino), fs_ino_alignment); - end_agbno = start_agbno +XFS_IALLOC_BLOCKS (mp); + end_agbno = start_agbno + mp->m_ialloc_blks;/* * if this fs has aligned inodes but the end of the @@ -266,14 +266,14 @@ verify_inode_chunk(xfs_mount_t *mp,* a discovered inode chunk completely within that range * would include the inode passed into us. */ -if (XFS_IALLOC_BLOCKS (mp) >1 ) { +if (mp->m_ialloc_blks >1 ) {if (agino > mp->m_ialloc_inos) - start_agbno = agbno -XFS_IALLOC_BLOCKS (mp) +1 ; + start_agbno = agbno - mp->m_ialloc_blks +1 ;else start_agbno =1 ; } - end_agbno = agbno +XFS_IALLOC_BLOCKS (mp); + end_agbno = agbno + mp->m_ialloc_blks;if (end_agbno > max_agbno) end_agbno = max_agbno;@@ -328,7 +328,7 @@ verify_inode_chunk(xfs_mount_t *mp, start_agbno =XFS_AGINO_TO_AGBNO (mp, irec_p->ino_startnum) + -XFS_IALLOC_BLOCKS (mp); + mp->m_ialloc_blks;/* * we know that the inode we're trying to verify isn't @@ -351,7 +351,7 @@ verify_inode_chunk(xfs_mount_t *mp,* the inode in question and that the space between them * is too small for a legal inode chunk */ -if (end_agbno - start_agbno <XFS_IALLOC_BLOCKS (mp)) +if (end_agbno - start_agbno < mp->m_ialloc_blks)return (0 );/* @@ -395,7 +395,7 @@ verify_inode_chunk(xfs_mount_t *mp, num_blks = chunk_stop_agbno - chunk_start_agbno; -if (num_blks <XFS_IALLOC_BLOCKS (mp) || ino_cnt ==0 ) +if (num_blks < mp->m_ialloc_blks || ino_cnt ==0 )return (0 );/* @@ -411,8 +411,8 @@ verify_inode_chunk(xfs_mount_t *mp,* the chunk */ -if (num_blks %XFS_IALLOC_BLOCKS (mp) !=0 ) { - num_blks =rounddown (num_blks,XFS_IALLOC_BLOCKS (mp)); +if (num_blks % mp->m_ialloc_blks !=0 ) { + num_blks =rounddown (num_blks, mp->m_ialloc_blks); chunk_stop_agbno = chunk_start_agbno + num_blks; }@@ -596,7 +596,7 @@ process_inode_chunk(ASSERT (XFS_AGINO_TO_OFFSET (mp, first_irec->ino_startnum) ==0 ); *bogus =0 ; -ASSERT (XFS_IALLOC_BLOCKS (mp) >0 ); +ASSERT (mp->m_ialloc_blks >0 ); blks_per_cluster = mp->m_inode_cluster_size >> mp->m_sb.sb_blocklog;if (blks_per_cluster ==0 )repair/prefetch.c +1
-1@@ -846,7 +846,7 @@ start_inode_prefetch( max_queue = libxfs_bcache->c_maxcount / thread_count /8 ;if (mp->m_inode_cluster_size > mp->m_sb.sb_blocksize) max_queue = max_queue * (mp->m_inode_cluster_size >> - mp->m_sb.sb_blocklog) /XFS_IALLOC_BLOCKS (mp); + mp->m_sb.sb_blocklog) / mp->m_ialloc_blks;sem_init (&args->ra_count,0 , max_queue);repair/xfs_repair.c +2
-2@@ -441,9 +441,9 @@ calc_mkfs(xfs_mount_t *mp) first_prealloc_ino =XFS_OFFBNO_TO_AGINO (mp, fino_bno,0 ); } -ASSERT (XFS_IALLOC_BLOCKS (mp) >0 ); +ASSERT (mp->m_ialloc_blks >0 ); -if (XFS_IALLOC_BLOCKS (mp) >1 ) +if (mp->m_ialloc_blks >1 ) last_prealloc_ino = first_prealloc_ino +XFS_INODES_PER_CHUNK ;else last_prealloc_ino =XFS_OFFBNO_TO_AGINO (mp, fino_bno +1 ,0 );Signature · 6 lines
1.8.3.2 _______________________________________________ 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 20 lines · Brian Foster
Quoted 19 lines · Jeff Liu
From: Jie Liu <[email protected]>
Get rid of
XFS_IALLOC_BLOCKS()macros, usemp->m_ialloc_blksdirectly.Signed-off-by Jie Liu <[email protected]>--- db/check.c | 2 +- db/frag.c | 2 +- db/metadump.c | 2 +- include/xfs_ialloc.h | 5 ----- include/xfs_trans_space.h | 2 +- libxfs/xfs_ialloc.c | 8 ++++---- libxfs/xfs_trans_resv.c | 8 ++++---- mkfs/proto.c | 2 +- repair/dino_chunks.c | 24 ++++++++++++------------ repair/prefetch.c | 2 +- repair/xfs_repair.c | 4 ++-- 11 files changed, 28 insertions(+), 33 deletions(-)
<snip>
Quoted 12 lines
mkfs/proto.c static long filesize(int fd); · line 42
Quoted 10 lines
mkfs/proto.c +1
-1@@ -39,7 +39,7 @@ static long filesize(int fd);* (basically no fragmentation). */ #define MKFS_BLOCKRES_INODE \ - ((uint)(XFS_IALLOC_BLOCKS(mp) + ((mp)->m_in_maxlevels - 1))) + ((uint)(mp->m_ialloc_blks + ((mp)->m_in_maxlevels - 1)))Nit: (mp)
Quoted 1 line
Probably not necessary here anyways...
Nice catch, thanks for your review.
Cheers,
-Jeff
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs