Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 631fc955 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: clean up scrub usage of KM_NOFS



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: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent eb41c93f
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -797,7 +797,8 @@ xfs_scrub_agfl(
	}
	}
	memset(&sai, 0, sizeof(sai));
	memset(&sai, 0, sizeof(sai));
	sai.sz_entries = agflcount;
	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) {
	if (!sai.entries) {
		error = -ENOMEM;
		error = -ENOMEM;
		goto out;
		goto out;
+1 −1
Original line number Original line Diff line number Diff line
@@ -442,7 +442,7 @@ xfs_scrub_btree_check_owner(
	 */
	 */
	if (cur->bc_btnum == XFS_BTNUM_BNO || cur->bc_btnum == XFS_BTNUM_RMAP) {
	if (cur->bc_btnum == XFS_BTNUM_BNO || cur->bc_btnum == XFS_BTNUM_RMAP) {
		co = kmem_alloc(sizeof(struct check_owner),
		co = kmem_alloc(sizeof(struct check_owner),
				KM_MAYFAIL | KM_NOFS);
				KM_MAYFAIL);
		if (!co)
		if (!co)
			return -ENOMEM;
			return -ENOMEM;
		co->level = level;
		co->level = level;
+1 −1
Original line number Original line Diff line number Diff line
@@ -150,7 +150,7 @@ xfs_scrub_refcountbt_rmap_check(
		 * so we don't need insertion sort here.
		 * so we don't need insertion sort here.
		 */
		 */
		frag = kmem_alloc(sizeof(struct xfs_scrub_refcnt_frag),
		frag = kmem_alloc(sizeof(struct xfs_scrub_refcnt_frag),
				KM_MAYFAIL | KM_NOFS);
				KM_MAYFAIL);
		if (!frag)
		if (!frag)
			return -ENOMEM;
			return -ENOMEM;
		memcpy(&frag->rm, rec, sizeof(frag->rm));
		memcpy(&frag->rm, rec, sizeof(frag->rm));