xfs
[Top] [All Lists]

[PATCH 01/25] xfs: remove the first extent special case in xfs_bmap_add_

To: xfs@xxxxxxxxxxx
Subject: [PATCH 01/25] xfs: remove the first extent special case in xfs_bmap_add_extent
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 24 Aug 2011 02:04:29 -0400
References: <20110824060428.789245205@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.48-1
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@xxxxxx>

Index: xfs/fs/xfs/xfs_bmap.c
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap.c  2011-07-13 09:14:14.375340664 +0200
+++ xfs/fs/xfs/xfs_bmap.c       2011-07-13 09:16:07.041396967 +0200
@@ -466,26 +466,9 @@ xfs_bmap_add_extent(
        ASSERT(*idx <= nextents);
 
        /*
-        * This is the first extent added to a new/empty file.
-        * Special case this one, so other routines get to assume there are
-        * already extents in the list.
-        */
-       if (nextents == 0) {
-               xfs_iext_insert(ip, *idx, 1, new,
-                               whichfork == XFS_ATTR_FORK ? BMAP_ATTRFORK : 0);
-
-               ASSERT(cur == NULL);
-
-               if (!isnullstartblock(new->br_startblock)) {
-                       XFS_IFORK_NEXT_SET(ip, whichfork, 1);
-                       logflags = XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
-               } else
-                       logflags = 0;
-       }
-       /*
         * Any kind of new delayed allocation goes here.
         */
-       else if (isnullstartblock(new->br_startblock)) {
+       if (isnullstartblock(new->br_startblock)) {
                if (cur)
                        ASSERT((cur->bc_private.b.flags &
                                XFS_BTCUR_BPRV_WASDEL) == 0);

<Prev in Thread] Current Thread [Next in Thread>