]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: xfs_bunmapi() does not need XFS_BMAPI_METADATA flag
authorDave Chinner <dchinner@redhat.com>
Wed, 29 Jul 2015 01:51:01 +0000 (11:51 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 24 Aug 2015 01:52:45 +0000 (11:52 +1000)
xfs_bunmapi() doesn't care what type of extent is being freed and
does not look at the XFS_BMAPI_METADATA flag at all. As such we can
remove the XFS_BMAPI_METADATA from all callers that use it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_attr_remote.c
libxfs/xfs_da_btree.c
libxfs/xfs_dir2.c

index 5feaf55d65e8e007318944b053b3d73daa0a5715..3fb03f8f249583a09bbc149e8156e8f43462649b 100644 (file)
@@ -589,9 +589,8 @@ xfs_attr_rmtval_remove(
 
                xfs_bmap_init(args->flist, args->firstblock);
                error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
-                                   XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
-                                   1, args->firstblock, args->flist,
-                                   &done);
+                                   XFS_BMAPI_ATTRFORK, 1, args->firstblock,
+                                   args->flist, &done);
                if (!error) {
                        error = xfs_bmap_finish(&args->trans, args->flist,
                                                &committed);
index 3de4cd3030c2a0b11ab29419a5253ed23e7b65ab..c874164fa8214df2484e464db50ce29e376d2412 100644 (file)
@@ -2347,8 +2347,8 @@ xfs_da_shrink_inode(
                 * the last block to the place we want to kill.
                 */
                error = xfs_bunmapi(tp, dp, dead_blkno, count,
-                                   xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
-                                   0, args->firstblock, args->flist, &done);
+                                   xfs_bmapi_aflag(w), 0, args->firstblock,
+                                   args->flist, &done);
                if (error == -ENOSPC) {
                        if (w != XFS_DATA_FORK)
                                break;
index 2a42317ab2f192cc697e2098961db3b9a1070ee9..4a19b76641f906eae97c892da8c39db4b038def1 100644 (file)
@@ -672,25 +672,22 @@ xfs_dir2_shrink_inode(
        mp = dp->i_mount;
        tp = args->trans;
        da = xfs_dir2_db_to_da(args->geo, db);
-       /*
-        * Unmap the fsblock(s).
-        */
-       if ((error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount,
-                       XFS_BMAPI_METADATA, 0, args->firstblock, args->flist,
-                       &done))) {
+
+       /* Unmap the fsblock(s). */
+       error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0,
+                           args->firstblock, args->flist, &done);
+       if (error) {
                /*
-                * ENOSPC actually can happen if we're in a removename with
-                * no space reservation, and the resulting block removal
-                * would cause a bmap btree split or conversion from extents
-                * to btree.  This can only happen for un-fragmented
-                * directory blocks, since you need to be punching out
-                * the middle of an extent.
-                * In this case we need to leave the block in the file,
-                * and not binval it.
-                * So the block has to be in a consistent empty state
-                * and appropriately logged.
-                * We don't free up the buffer, the caller can tell it
-                * hasn't happened since it got an error back.
+                * ENOSPC actually can happen if we're in a removename with no
+                * space reservation, and the resulting block removal would
+                * cause a bmap btree split or conversion from extents to btree.
+                * This can only happen for un-fragmented directory blocks,
+                * since you need to be punching out the middle of an extent.
+                * In this case we need to leave the block in the file, and not
+                * binval it.  So the block has to be in a consistent empty
+                * state and appropriately logged.  We don't free up the buffer,
+                * the caller can tell it hasn't happened since it got an error
+                * back.
                 */
                return error;
        }