aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-12-12 23:51:48 -0500
committerDave Chinner <david@fromorbit.com>2013-12-12 23:51:48 -0500
commit126cd105d4408ff52437a72d681aecdb29cc80e8 (patch)
tree097c3bf19140a74050661d72bd5c7875af91c586 /fs/xfs
parent0f49efd805229fc747761213ec820c1ba3ab64db (diff)
xfs: get rid of XFS_IALLOC_BLOCKS macros
Get rid of XFS_IALLOC_BLOCKS() marcos, use mp->m_ialloc_blks directly. Signed-off-by: Jie Liu <jeff.liu@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_ialloc.c12
-rw-r--r--fs/xfs/xfs_ialloc.h5
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_log_recover.c4
-rw-r--r--fs/xfs/xfs_trans_resv.c8
-rw-r--r--fs/xfs/xfs_trans_space.h2
6 files changed, 15 insertions, 20 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 3ac5eb6bf856..eacc59c7cb80 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -333,7 +333,7 @@ xfs_ialloc_ag_alloc(
333 if (args.mp->m_maxicount && 333 if (args.mp->m_maxicount &&
334 args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount) 334 args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount)
335 return XFS_ERROR(ENOSPC); 335 return XFS_ERROR(ENOSPC);
336 args.minlen = args.maxlen = XFS_IALLOC_BLOCKS(args.mp); 336 args.minlen = args.maxlen = args.mp->m_ialloc_blks;
337 /* 337 /*
338 * First try to allocate inodes contiguous with the last-allocated 338 * First try to allocate inodes contiguous with the last-allocated
339 * chunk of inodes. If the filesystem is striped, this will fill 339 * chunk of inodes. If the filesystem is striped, this will fill
@@ -343,7 +343,7 @@ xfs_ialloc_ag_alloc(
343 newino = be32_to_cpu(agi->agi_newino); 343 newino = be32_to_cpu(agi->agi_newino);
344 agno = be32_to_cpu(agi->agi_seqno); 344 agno = be32_to_cpu(agi->agi_seqno);
345 args.agbno = XFS_AGINO_TO_AGBNO(args.mp, newino) + 345 args.agbno = XFS_AGINO_TO_AGBNO(args.mp, newino) +
346 XFS_IALLOC_BLOCKS(args.mp); 346 args.mp->m_ialloc_blks;
347 if (likely(newino != NULLAGINO && 347 if (likely(newino != NULLAGINO &&
348 (args.agbno < be32_to_cpu(agi->agi_length)))) { 348 (args.agbno < be32_to_cpu(agi->agi_length)))) {
349 args.fsbno = XFS_AGB_TO_FSB(args.mp, agno, args.agbno); 349 args.fsbno = XFS_AGB_TO_FSB(args.mp, agno, args.agbno);
@@ -585,7 +585,7 @@ xfs_ialloc_ag_select(
585 * Is there enough free space for the file plus a block of 585 * Is there enough free space for the file plus a block of
586 * inodes? (if we need to allocate some)? 586 * inodes? (if we need to allocate some)?
587 */ 587 */
588 ineed = XFS_IALLOC_BLOCKS(mp); 588 ineed = mp->m_ialloc_blks;
589 longest = pag->pagf_longest; 589 longest = pag->pagf_longest;
590 if (!longest) 590 if (!longest)
591 longest = pag->pagf_flcount > 0; 591 longest = pag->pagf_flcount > 0;
@@ -1228,9 +1228,9 @@ xfs_difree(
1228 goto error0; 1228 goto error0;
1229 } 1229 }
1230 1230
1231 xfs_bmap_add_free(XFS_AGB_TO_FSB(mp, 1231 xfs_bmap_add_free(XFS_AGB_TO_FSB(mp, agno,
1232 agno, XFS_AGINO_TO_AGBNO(mp, rec.ir_startino)), 1232 XFS_AGINO_TO_AGBNO(mp, rec.ir_startino)),
1233 XFS_IALLOC_BLOCKS(mp), flist, mp); 1233 mp->m_ialloc_blks, flist, mp);
1234 } else { 1234 } else {
1235 *delete = 0; 1235 *delete = 0;
1236 1236
diff --git a/fs/xfs/xfs_ialloc.h b/fs/xfs/xfs_ialloc.h
index 98ce63e35bd4..d86f8bdc963e 100644
--- a/fs/xfs/xfs_ialloc.h
+++ b/fs/xfs/xfs_ialloc.h
@@ -25,11 +25,6 @@ struct xfs_mount;
25struct xfs_trans; 25struct xfs_trans;
26struct xfs_btree_cur; 26struct xfs_btree_cur;
27 27
28/*
29 * Allocation parameters for inode allocation.
30 */
31#define XFS_IALLOC_BLOCKS(mp) (mp)->m_ialloc_blks
32
33/* Move inodes in clusters of this size */ 28/* Move inodes in clusters of this size */
34#define XFS_INODE_BIG_CLUSTER_SIZE 8192 29#define XFS_INODE_BIG_CLUSTER_SIZE 8192
35 30
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c1642c9a7e66..0c8c334f0f15 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2155,12 +2155,12 @@ xfs_ifree_cluster(
2155 if (mp->m_sb.sb_blocksize >= mp->m_inode_cluster_size) { 2155 if (mp->m_sb.sb_blocksize >= mp->m_inode_cluster_size) {
2156 blks_per_cluster = 1; 2156 blks_per_cluster = 1;
2157 ninodes = mp->m_sb.sb_inopblock; 2157 ninodes = mp->m_sb.sb_inopblock;
2158 nbufs = XFS_IALLOC_BLOCKS(mp); 2158 nbufs = mp->m_ialloc_blks;
2159 } else { 2159 } else {
2160 blks_per_cluster = mp->m_inode_cluster_size / 2160 blks_per_cluster = mp->m_inode_cluster_size /
2161 mp->m_sb.sb_blocksize; 2161 mp->m_sb.sb_blocksize;
2162 ninodes = blks_per_cluster * mp->m_sb.sb_inopblock; 2162 ninodes = blks_per_cluster * mp->m_sb.sb_inopblock;
2163 nbufs = XFS_IALLOC_BLOCKS(mp) / blks_per_cluster; 2163 nbufs = mp->m_ialloc_blks / blks_per_cluster;
2164 } 2164 }
2165 2165
2166 for (j = 0; j < nbufs; j++, inum += ninodes) { 2166 for (j = 0; j < nbufs; j++, inum += ninodes) {
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 42458ab7a336..22b6f35765c1 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3209,9 +3209,9 @@ xlog_recover_do_icreate_pass2(
3209 3209
3210 /* existing allocation is fixed value */ 3210 /* existing allocation is fixed value */
3211 ASSERT(count == mp->m_ialloc_inos); 3211 ASSERT(count == mp->m_ialloc_inos);
3212 ASSERT(length == XFS_IALLOC_BLOCKS(mp)); 3212 ASSERT(length == mp->m_ialloc_blks);
3213 if (count != mp->m_ialloc_inos || 3213 if (count != mp->m_ialloc_inos ||
3214 length != XFS_IALLOC_BLOCKS(mp)) { 3214 length != mp->m_ialloc_blks) {
3215 xfs_warn(log->l_mp, "xlog_recover_do_icreate_trans: bad count 2"); 3215 xfs_warn(log->l_mp, "xlog_recover_do_icreate_trans: bad count 2");
3216 return EINVAL; 3216 return EINVAL;
3217 } 3217 }
diff --git a/fs/xfs/xfs_trans_resv.c b/fs/xfs/xfs_trans_resv.c
index 51c181dde119..2ffd3e331b49 100644
--- a/fs/xfs/xfs_trans_resv.c
+++ b/fs/xfs/xfs_trans_resv.c
@@ -174,7 +174,7 @@ xfs_calc_itruncate_reservation(
174 xfs_calc_buf_res(5, 0) + 174 xfs_calc_buf_res(5, 0) +
175 xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1), 175 xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
176 XFS_FSB_TO_B(mp, 1)) + 176 XFS_FSB_TO_B(mp, 1)) +
177 xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) + 177 xfs_calc_buf_res(2 + mp->m_ialloc_blks +
178 mp->m_in_maxlevels, 0))); 178 mp->m_in_maxlevels, 0)));
179} 179}
180 180
@@ -282,7 +282,7 @@ xfs_calc_create_resv_modify(
282 * For create we can allocate some inodes giving: 282 * For create we can allocate some inodes giving:
283 * the agi and agf of the ag getting the new inodes: 2 * sectorsize 283 * the agi and agf of the ag getting the new inodes: 2 * sectorsize
284 * the superblock for the nlink flag: sector size 284 * the superblock for the nlink flag: sector size
285 * the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize 285 * the inode blocks allocated: mp->m_ialloc_blks * blocksize
286 * the inode btree: max depth * blocksize 286 * the inode btree: max depth * blocksize
287 * the allocation btrees: 2 trees * (max depth - 1) * block size 287 * the allocation btrees: 2 trees * (max depth - 1) * block size
288 */ 288 */
@@ -292,7 +292,7 @@ xfs_calc_create_resv_alloc(
292{ 292{
293 return xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) + 293 return xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
294 mp->m_sb.sb_sectsize + 294 mp->m_sb.sb_sectsize +
295 xfs_calc_buf_res(XFS_IALLOC_BLOCKS(mp), XFS_FSB_TO_B(mp, 1)) + 295 xfs_calc_buf_res(mp->m_ialloc_blks, XFS_FSB_TO_B(mp, 1)) +
296 xfs_calc_buf_res(mp->m_in_maxlevels, XFS_FSB_TO_B(mp, 1)) + 296 xfs_calc_buf_res(mp->m_in_maxlevels, XFS_FSB_TO_B(mp, 1)) +
297 xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1), 297 xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
298 XFS_FSB_TO_B(mp, 1)); 298 XFS_FSB_TO_B(mp, 1));
@@ -387,7 +387,7 @@ xfs_calc_ifree_reservation(
387 xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) + 387 xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) +
388 max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size) + 388 max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size) +
389 xfs_calc_buf_res(1, 0) + 389 xfs_calc_buf_res(1, 0) +
390 xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) + 390 xfs_calc_buf_res(2 + mp->m_ialloc_blks +
391 mp->m_in_maxlevels, 0) + 391 mp->m_in_maxlevels, 0) +
392 xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1), 392 xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
393 XFS_FSB_TO_B(mp, 1)); 393 XFS_FSB_TO_B(mp, 1));
diff --git a/fs/xfs/xfs_trans_space.h b/fs/xfs/xfs_trans_space.h
index 7d2c920dfb9c..af5dbe06cb65 100644
--- a/fs/xfs/xfs_trans_space.h
+++ b/fs/xfs/xfs_trans_space.h
@@ -47,7 +47,7 @@
47#define XFS_DIRREMOVE_SPACE_RES(mp) \ 47#define XFS_DIRREMOVE_SPACE_RES(mp) \
48 XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK) 48 XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)
49#define XFS_IALLOC_SPACE_RES(mp) \ 49#define XFS_IALLOC_SPACE_RES(mp) \
50 (XFS_IALLOC_BLOCKS(mp) + (mp)->m_in_maxlevels - 1) 50 ((mp)->m_ialloc_blks + (mp)->m_in_maxlevels - 1)
51 51
52/* 52/*
53 * Space reservation values for various transactions. 53 * Space reservation values for various transactions.