Merge tag 'xfs-6.9-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[sfrench/cifs-2.6.git] / fs / xfs / xfs_bmap_util.c
index c2531c28905c09e938028e829107e626e05356f0..19e11d1da66074a61f464a8300fc56bb4b186277 100644 (file)
@@ -66,7 +66,7 @@ xfs_zero_extent(
        return blkdev_issue_zeroout(target->bt_bdev,
                block << (mp->m_super->s_blocksize_bits - 9),
                count_fsb << (mp->m_super->s_blocksize_bits - 9),
-               GFP_NOFS, 0);
+               GFP_KERNEL, 0);
 }
 
 /*
@@ -508,8 +508,8 @@ xfs_can_free_eofblocks(
         * Caller must either hold the exclusive io lock; or be inactivating
         * the inode, which guarantees there are no other users of the inode.
         */
-       ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL) ||
-              (VFS_I(ip)->i_state & I_FREEING));
+       if (!(VFS_I(ip)->i_state & I_FREEING))
+               xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL);
 
        /* prealloc/delalloc exists only on regular files */
        if (!S_ISREG(VFS_I(ip)->i_mode))
@@ -965,8 +965,7 @@ xfs_collapse_file_space(
        xfs_fileoff_t           shift_fsb = XFS_B_TO_FSB(mp, len);
        bool                    done = false;
 
-       ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
-       ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL));
+       xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
 
        trace_xfs_collapse_file_space(ip);
 
@@ -1035,8 +1034,7 @@ xfs_insert_file_space(
        xfs_fileoff_t           shift_fsb = XFS_B_TO_FSB(mp, len);
        bool                    done = false;
 
-       ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
-       ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL));
+       xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL);
 
        trace_xfs_insert_file_space(ip);
 
@@ -1307,16 +1305,16 @@ xfs_swap_extent_rmap(
                        }
 
                        /* Remove the mapping from the donor file. */
-                       xfs_bmap_unmap_extent(tp, tip, &uirec);
+                       xfs_bmap_unmap_extent(tp, tip, XFS_DATA_FORK, &uirec);
 
                        /* Remove the mapping from the source file. */
-                       xfs_bmap_unmap_extent(tp, ip, &irec);
+                       xfs_bmap_unmap_extent(tp, ip, XFS_DATA_FORK, &irec);
 
                        /* Map the donor file's blocks into the source file. */
-                       xfs_bmap_map_extent(tp, ip, &uirec);
+                       xfs_bmap_map_extent(tp, ip, XFS_DATA_FORK, &uirec);
 
                        /* Map the source file's blocks into the donor file. */
-                       xfs_bmap_map_extent(tp, tip, &irec);
+                       xfs_bmap_map_extent(tp, tip, XFS_DATA_FORK, &irec);
 
                        error = xfs_defer_finish(tpp);
                        tp = *tpp;