aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 87795188cedf..b1ea26e40aaf 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -130,7 +130,6 @@ STATIC int /* error */
130xfs_bmap_add_extent_hole_delay( 130xfs_bmap_add_extent_hole_delay(
131 xfs_inode_t *ip, /* incore inode pointer */ 131 xfs_inode_t *ip, /* incore inode pointer */
132 xfs_extnum_t idx, /* extent number to update/insert */ 132 xfs_extnum_t idx, /* extent number to update/insert */
133 xfs_btree_cur_t *cur, /* if null, not a btree */
134 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 133 xfs_bmbt_irec_t *new, /* new data to add to file extents */
135 int *logflagsp,/* inode logging flags */ 134 int *logflagsp,/* inode logging flags */
136 xfs_extdelta_t *delta, /* Change made to incore extents */ 135 xfs_extdelta_t *delta, /* Change made to incore extents */
@@ -399,7 +398,6 @@ xfs_bmap_count_leaves(
399 398
400STATIC int 399STATIC int
401xfs_bmap_disk_count_leaves( 400xfs_bmap_disk_count_leaves(
402 xfs_ifork_t *ifp,
403 xfs_extnum_t idx, 401 xfs_extnum_t idx,
404 xfs_bmbt_block_t *block, 402 xfs_bmbt_block_t *block,
405 int numrecs, 403 int numrecs,
@@ -580,7 +578,7 @@ xfs_bmap_add_extent(
580 if (cur) 578 if (cur)
581 ASSERT((cur->bc_private.b.flags & 579 ASSERT((cur->bc_private.b.flags &
582 XFS_BTCUR_BPRV_WASDEL) == 0); 580 XFS_BTCUR_BPRV_WASDEL) == 0);
583 if ((error = xfs_bmap_add_extent_hole_delay(ip, idx, cur, new, 581 if ((error = xfs_bmap_add_extent_hole_delay(ip, idx, new,
584 &logflags, delta, rsvd))) 582 &logflags, delta, rsvd)))
585 goto done; 583 goto done;
586 } 584 }
@@ -1841,7 +1839,6 @@ STATIC int /* error */
1841xfs_bmap_add_extent_hole_delay( 1839xfs_bmap_add_extent_hole_delay(
1842 xfs_inode_t *ip, /* incore inode pointer */ 1840 xfs_inode_t *ip, /* incore inode pointer */
1843 xfs_extnum_t idx, /* extent number to update/insert */ 1841 xfs_extnum_t idx, /* extent number to update/insert */
1844 xfs_btree_cur_t *cur, /* if null, not a btree */
1845 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 1842 xfs_bmbt_irec_t *new, /* new data to add to file extents */
1846 int *logflagsp, /* inode logging flags */ 1843 int *logflagsp, /* inode logging flags */
1847 xfs_extdelta_t *delta, /* Change made to incore extents */ 1844 xfs_extdelta_t *delta, /* Change made to incore extents */
@@ -4071,7 +4068,7 @@ xfs_bmap_add_attrfork(
4071 } 4068 }
4072 if ((error = xfs_bmap_finish(&tp, &flist, &committed))) 4069 if ((error = xfs_bmap_finish(&tp, &flist, &committed)))
4073 goto error2; 4070 goto error2;
4074 error = xfs_trans_commit(tp, XFS_TRANS_PERM_LOG_RES, NULL); 4071 error = xfs_trans_commit(tp, XFS_TRANS_PERM_LOG_RES);
4075 ASSERT(ip->i_df.if_ext_max == 4072 ASSERT(ip->i_df.if_ext_max ==
4076 XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t)); 4073 XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t));
4077 return error; 4074 return error;
@@ -4227,7 +4224,7 @@ xfs_bmap_finish(
4227 logres = ntp->t_log_res; 4224 logres = ntp->t_log_res;
4228 logcount = ntp->t_log_count; 4225 logcount = ntp->t_log_count;
4229 ntp = xfs_trans_dup(*tp); 4226 ntp = xfs_trans_dup(*tp);
4230 error = xfs_trans_commit(*tp, 0, NULL); 4227 error = xfs_trans_commit(*tp, 0);
4231 *tp = ntp; 4228 *tp = ntp;
4232 *committed = 1; 4229 *committed = 1;
4233 /* 4230 /*
@@ -4447,8 +4444,11 @@ xfs_bmap_one_block(
4447 xfs_bmbt_irec_t s; /* internal version of extent */ 4444 xfs_bmbt_irec_t s; /* internal version of extent */
4448 4445
4449#ifndef DEBUG 4446#ifndef DEBUG
4450 if (whichfork == XFS_DATA_FORK) 4447 if (whichfork == XFS_DATA_FORK) {
4451 return ip->i_d.di_size == ip->i_mount->m_sb.sb_blocksize; 4448 return ((ip->i_d.di_mode & S_IFMT) == S_IFREG) ?
4449 (ip->i_size == ip->i_mount->m_sb.sb_blocksize) :
4450 (ip->i_d.di_size == ip->i_mount->m_sb.sb_blocksize);
4451 }
4452#endif /* !DEBUG */ 4452#endif /* !DEBUG */
4453 if (XFS_IFORK_NEXTENTS(ip, whichfork) != 1) 4453 if (XFS_IFORK_NEXTENTS(ip, whichfork) != 1)
4454 return 0; 4454 return 0;
@@ -4460,7 +4460,7 @@ xfs_bmap_one_block(
4460 xfs_bmbt_get_all(ep, &s); 4460 xfs_bmbt_get_all(ep, &s);
4461 rval = s.br_startoff == 0 && s.br_blockcount == 1; 4461 rval = s.br_startoff == 0 && s.br_blockcount == 1;
4462 if (rval && whichfork == XFS_DATA_FORK) 4462 if (rval && whichfork == XFS_DATA_FORK)
4463 ASSERT(ip->i_d.di_size == ip->i_mount->m_sb.sb_blocksize); 4463 ASSERT(ip->i_size == ip->i_mount->m_sb.sb_blocksize);
4464 return rval; 4464 return rval;
4465} 4465}
4466 4466
@@ -5820,7 +5820,7 @@ xfs_getbmap(
5820 fixlen = XFS_MAXIOFFSET(mp); 5820 fixlen = XFS_MAXIOFFSET(mp);
5821 } else { 5821 } else {
5822 prealloced = 0; 5822 prealloced = 0;
5823 fixlen = ip->i_d.di_size; 5823 fixlen = ip->i_size;
5824 } 5824 }
5825 } else { 5825 } else {
5826 prealloced = 0; 5826 prealloced = 0;
@@ -5844,7 +5844,8 @@ xfs_getbmap(
5844 5844
5845 xfs_ilock(ip, XFS_IOLOCK_SHARED); 5845 xfs_ilock(ip, XFS_IOLOCK_SHARED);
5846 5846
5847 if (whichfork == XFS_DATA_FORK && ip->i_delayed_blks) { 5847 if (whichfork == XFS_DATA_FORK &&
5848 (ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) {
5848 /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */ 5849 /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */
5849 error = bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF); 5850 error = bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
5850 } 5851 }
@@ -6425,8 +6426,8 @@ xfs_bmap_count_tree(
6425 for (;;) { 6426 for (;;) {
6426 nextbno = be64_to_cpu(block->bb_rightsib); 6427 nextbno = be64_to_cpu(block->bb_rightsib);
6427 numrecs = be16_to_cpu(block->bb_numrecs); 6428 numrecs = be16_to_cpu(block->bb_numrecs);
6428 if (unlikely(xfs_bmap_disk_count_leaves(ifp, 6429 if (unlikely(xfs_bmap_disk_count_leaves(0,
6429 0, block, numrecs, count) < 0)) { 6430 block, numrecs, count) < 0)) {
6430 xfs_trans_brelse(tp, bp); 6431 xfs_trans_brelse(tp, bp);
6431 XFS_ERROR_REPORT("xfs_bmap_count_tree(2)", 6432 XFS_ERROR_REPORT("xfs_bmap_count_tree(2)",
6432 XFS_ERRLEVEL_LOW, mp); 6433 XFS_ERRLEVEL_LOW, mp);
@@ -6472,7 +6473,6 @@ xfs_bmap_count_leaves(
6472 */ 6473 */
6473int 6474int
6474xfs_bmap_disk_count_leaves( 6475xfs_bmap_disk_count_leaves(
6475 xfs_ifork_t *ifp,
6476 xfs_extnum_t idx, 6476 xfs_extnum_t idx,
6477 xfs_bmbt_block_t *block, 6477 xfs_bmbt_block_t *block,
6478 int numrecs, 6478 int numrecs,