aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-06-20 21:53:28 -0400
committerDave Chinner <david@fromorbit.com>2016-06-20 21:53:28 -0400
commit59bad075bd135979b2a484c30f6bcf28d17b8689 (patch)
tree782e4cf436d8867d500173357514b6c4e5311b4c
parent128f24d5d9def3c47b6b659b2454f0426a347144 (diff)
xfs: rearrange xfs_bmap_add_free parameters
This is already in xfsprogs' libxfs, so port it to the kernel. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c12
-rw-r--r--fs/xfs/libxfs/xfs_bmap.h4
-rw-r--r--fs/xfs/libxfs/xfs_bmap_btree.c2
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c9
4 files changed, 13 insertions, 14 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 932381caef1b..8847496f7ccb 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -570,10 +570,10 @@ xfs_bmap_validate_ret(
570 */ 570 */
571void 571void
572xfs_bmap_add_free( 572xfs_bmap_add_free(
573 struct xfs_mount *mp, /* mount point structure */
574 struct xfs_bmap_free *flist, /* list of extents */
573 xfs_fsblock_t bno, /* fs block number of extent */ 575 xfs_fsblock_t bno, /* fs block number of extent */
574 xfs_filblks_t len, /* length of extent */ 576 xfs_filblks_t len) /* length of extent */
575 xfs_bmap_free_t *flist, /* list of extents */
576 xfs_mount_t *mp) /* mount point structure */
577{ 577{
578 xfs_bmap_free_item_t *cur; /* current (next) element */ 578 xfs_bmap_free_item_t *cur; /* current (next) element */
579 xfs_bmap_free_item_t *new; /* new element */ 579 xfs_bmap_free_item_t *new; /* new element */
@@ -699,7 +699,7 @@ xfs_bmap_btree_to_extents(
699 cblock = XFS_BUF_TO_BLOCK(cbp); 699 cblock = XFS_BUF_TO_BLOCK(cbp);
700 if ((error = xfs_btree_check_block(cur, cblock, 0, cbp))) 700 if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
701 return error; 701 return error;
702 xfs_bmap_add_free(cbno, 1, cur->bc_private.b.flist, mp); 702 xfs_bmap_add_free(mp, cur->bc_private.b.flist, cbno, 1);
703 ip->i_d.di_nblocks--; 703 ip->i_d.di_nblocks--;
704 xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L); 704 xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L);
705 xfs_trans_binval(tp, cbp); 705 xfs_trans_binval(tp, cbp);
@@ -5073,8 +5073,8 @@ xfs_bmap_del_extent(
5073 * If we need to, add to list of extents to delete. 5073 * If we need to, add to list of extents to delete.
5074 */ 5074 */
5075 if (do_fx) 5075 if (do_fx)
5076 xfs_bmap_add_free(del->br_startblock, del->br_blockcount, flist, 5076 xfs_bmap_add_free(mp, flist, del->br_startblock,
5077 mp); 5077 del->br_blockcount);
5078 /* 5078 /*
5079 * Adjust inode # blocks in the file. 5079 * Adjust inode # blocks in the file.
5080 */ 5080 */
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
index 423a34e832bd..e081c7694fae 100644
--- a/fs/xfs/libxfs/xfs_bmap.h
+++ b/fs/xfs/libxfs/xfs_bmap.h
@@ -191,8 +191,8 @@ void xfs_bmap_trace_exlist(struct xfs_inode *ip, xfs_extnum_t cnt,
191 191
192int xfs_bmap_add_attrfork(struct xfs_inode *ip, int size, int rsvd); 192int xfs_bmap_add_attrfork(struct xfs_inode *ip, int size, int rsvd);
193void xfs_bmap_local_to_extents_empty(struct xfs_inode *ip, int whichfork); 193void xfs_bmap_local_to_extents_empty(struct xfs_inode *ip, int whichfork);
194void xfs_bmap_add_free(xfs_fsblock_t bno, xfs_filblks_t len, 194void xfs_bmap_add_free(struct xfs_mount *mp, struct xfs_bmap_free *flist,
195 struct xfs_bmap_free *flist, struct xfs_mount *mp); 195 xfs_fsblock_t bno, xfs_filblks_t len);
196void xfs_bmap_cancel(struct xfs_bmap_free *flist); 196void xfs_bmap_cancel(struct xfs_bmap_free *flist);
197int xfs_bmap_finish(struct xfs_trans **tp, struct xfs_bmap_free *flist, 197int xfs_bmap_finish(struct xfs_trans **tp, struct xfs_bmap_free *flist,
198 struct xfs_inode *ip); 198 struct xfs_inode *ip);
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index 6282f6e708af..db0c71e470c9 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -526,7 +526,7 @@ xfs_bmbt_free_block(
526 struct xfs_trans *tp = cur->bc_tp; 526 struct xfs_trans *tp = cur->bc_tp;
527 xfs_fsblock_t fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp)); 527 xfs_fsblock_t fsbno = XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp));
528 528
529 xfs_bmap_add_free(fsbno, 1, cur->bc_private.b.flist, mp); 529 xfs_bmap_add_free(mp, cur->bc_private.b.flist, fsbno, 1);
530 ip->i_d.di_nblocks--; 530 ip->i_d.di_nblocks--;
531 531
532 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 532 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 22297f9b0fd5..e3c0af73cf94 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -1828,9 +1828,8 @@ xfs_difree_inode_chunk(
1828 1828
1829 if (!xfs_inobt_issparse(rec->ir_holemask)) { 1829 if (!xfs_inobt_issparse(rec->ir_holemask)) {
1830 /* not sparse, calculate extent info directly */ 1830 /* not sparse, calculate extent info directly */
1831 xfs_bmap_add_free(XFS_AGB_TO_FSB(mp, agno, 1831 xfs_bmap_add_free(mp, flist, XFS_AGB_TO_FSB(mp, agno, sagbno),
1832 XFS_AGINO_TO_AGBNO(mp, rec->ir_startino)), 1832 mp->m_ialloc_blks);
1833 mp->m_ialloc_blks, flist, mp);
1834 return; 1833 return;
1835 } 1834 }
1836 1835
@@ -1873,8 +1872,8 @@ xfs_difree_inode_chunk(
1873 1872
1874 ASSERT(agbno % mp->m_sb.sb_spino_align == 0); 1873 ASSERT(agbno % mp->m_sb.sb_spino_align == 0);
1875 ASSERT(contigblk % mp->m_sb.sb_spino_align == 0); 1874 ASSERT(contigblk % mp->m_sb.sb_spino_align == 0);
1876 xfs_bmap_add_free(XFS_AGB_TO_FSB(mp, agno, agbno), contigblk, 1875 xfs_bmap_add_free(mp, flist, XFS_AGB_TO_FSB(mp, agno, agbno),
1877 flist, mp); 1876 contigblk);
1878 1877
1879 /* reset range to current bit and carry on... */ 1878 /* reset range to current bit and carry on... */
1880 startidx = endidx = nextbit; 1879 startidx = endidx = nextbit;