]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
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 018aabbd939452590b3467c5d17b6356ef6f761a..08a1f013d92c0b76e342cda341822a294645fe5e 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 54218168c8f969f06f26acb6520647a6621fb1b8..ea972dab1485263603da602c658bd27d19474317 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 400f1561cd3db5ec9975b4db15dd188450aaa622..d86526d2932c1a237ca3a6304e8d91d7a598865f 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));