Skip to content

Commit

Permalink
xfs: clean up scrub usage of KM_NOFS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Darrick J. Wong committed May 16, 2018
1 parent eb41c93 commit 631fc95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion fs/xfs/scrub/agheader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/scrub/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/scrub/refcount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 631fc95

Please sign in to comment.