xfs: clean up scrub usage of KM_NOFS
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 May 2018 17:02:00 +0000 (10:02 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 16 May 2018 00:57:05 +0000 (17:57 -0700)
All scrub code runs in transaction context, which means that memory
allocations are automatically run in PF_MEMALLOC_NOFS context.  It's
therefore unnecessary to pass in KM_NOFS to allocation routines, so
clean them all out.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/scrub/agheader.c
fs/xfs/scrub/btree.c
fs/xfs/scrub/refcount.c

index 018aabb..08a1f01 100644 (file)
@@ -797,7 +797,8 @@ xfs_scrub_agfl(
        }
        memset(&sai, 0, sizeof(sai));
        sai.sz_entries = agflcount;
-       sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount, KM_NOFS);
+       sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount,
+                       KM_MAYFAIL);
        if (!sai.entries) {
                error = -ENOMEM;
                goto out;
index 5421816..ea972da 100644 (file)
@@ -442,7 +442,7 @@ xfs_scrub_btree_check_owner(
         */
        if (cur->bc_btnum == XFS_BTNUM_BNO || cur->bc_btnum == XFS_BTNUM_RMAP) {
                co = kmem_alloc(sizeof(struct check_owner),
-                               KM_MAYFAIL | KM_NOFS);
+                               KM_MAYFAIL);
                if (!co)
                        return -ENOMEM;
                co->level = level;
index 400f156..d86526d 100644 (file)
@@ -150,7 +150,7 @@ xfs_scrub_refcountbt_rmap_check(
                 * so we don't need insertion sort here.
                 */
                frag = kmem_alloc(sizeof(struct xfs_scrub_refcnt_frag),
-                               KM_MAYFAIL | KM_NOFS);
+                               KM_MAYFAIL);
                if (!frag)
                        return -ENOMEM;
                memcpy(&frag->rm, rec, sizeof(frag->rm));