aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-09-18 16:40:41 -0400
committerAlex Elder <aelder@sgi.com>2011-10-11 22:15:03 -0400
commite7455e02e5effcdd49bb28e7dfface2d3473de52 (patch)
tree575d3f79215d575f2baf62b1279a7bfc567521e5
parented32201e65e15f3e6955cb84cbb544b08f81e5a5 (diff)
xfs: remove the first extent special case in xfs_bmap_add_extent
Both xfs_bmap_add_extent_hole_delay and xfs_bmap_add_extent_hole_real already contain code to handle the case where there is no extent to merge with, which is effectively the same as the code duplicated here. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
-rw-r--r--fs/xfs/xfs_bmap.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index a6075c0f8456..927e5454a43c 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -466,26 +466,9 @@ xfs_bmap_add_extent(
466 ASSERT(*idx <= nextents); 466 ASSERT(*idx <= nextents);
467 467
468 /* 468 /*
469 * This is the first extent added to a new/empty file.
470 * Special case this one, so other routines get to assume there are
471 * already extents in the list.
472 */
473 if (nextents == 0) {
474 xfs_iext_insert(ip, *idx, 1, new,
475 whichfork == XFS_ATTR_FORK ? BMAP_ATTRFORK : 0);
476
477 ASSERT(cur == NULL);
478
479 if (!isnullstartblock(new->br_startblock)) {
480 XFS_IFORK_NEXT_SET(ip, whichfork, 1);
481 logflags = XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
482 } else
483 logflags = 0;
484 }
485 /*
486 * Any kind of new delayed allocation goes here. 469 * Any kind of new delayed allocation goes here.
487 */ 470 */
488 else if (isnullstartblock(new->br_startblock)) { 471 if (isnullstartblock(new->br_startblock)) {
489 if (cur) 472 if (cur)
490 ASSERT((cur->bc_private.b.flags & 473 ASSERT((cur->bc_private.b.flags &
491 XFS_BTCUR_BPRV_WASDEL) == 0); 474 XFS_BTCUR_BPRV_WASDEL) == 0);