Commit 2e984bad authored by Joseph Qi's avatar Joseph Qi Committed by Darrick J. Wong
Browse files

xfs: remove unneeded return value check for *init_cursor()



Since *init_cursor() can always return a valid cursor, the NULL check
in caller is unneeded. So clean them up.
This also keeps the behavior consistent with other callers.

Signed-off-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 7bc1fea9
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -639,8 +639,6 @@ xfs_bmbt_change_owner(
	ASSERT(XFS_IFORK_PTR(ip, whichfork)->if_format == XFS_DINODE_FMT_BTREE);

	cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
	if (!cur)
		return -ENOMEM;
	cur->bc_ino.flags |= XFS_BTCUR_BMBT_INVALID_OWNER;

	error = xfs_btree_change_owner(cur, new_owner, buffer_list);
+0 −5
Original line number Diff line number Diff line
@@ -672,11 +672,6 @@ xfs_inobt_cur(
		return error;

	cur = xfs_inobt_init_cursor(mp, tp, *agi_bpp, agno, which);
	if (!cur) {
		xfs_trans_brelse(tp, *agi_bpp);
		*agi_bpp = NULL;
		return -ENOMEM;
	}
	*curpp = cur;
	return 0;
}
+0 −9
Original line number Diff line number Diff line
@@ -1179,10 +1179,6 @@ xfs_refcount_finish_one(
			return error;

		rcur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno);
		if (!rcur) {
			error = -ENOMEM;
			goto out_cur;
		}
		rcur->bc_ag.refc.nr_ops = nr_ops;
		rcur->bc_ag.refc.shape_changes = shape_changes;
	}
@@ -1217,11 +1213,6 @@ xfs_refcount_finish_one(
		trace_xfs_refcount_finish_one_leftover(mp, agno, type,
				bno, blockcount, new_agbno, *new_len);
	return error;

out_cur:
	xfs_trans_brelse(tp, agbp);

	return error;
}

/*
+0 −9
Original line number Diff line number Diff line
@@ -2404,10 +2404,6 @@ xfs_rmap_finish_one(
			return -EFSCORRUPTED;

		rcur = xfs_rmapbt_init_cursor(mp, tp, agbp, agno);
		if (!rcur) {
			error = -ENOMEM;
			goto out_cur;
		}
	}
	*pcur = rcur;

@@ -2446,11 +2442,6 @@ xfs_rmap_finish_one(
		error = -EFSCORRUPTED;
	}
	return error;

out_cur:
	xfs_trans_brelse(tp, agbp);

	return error;
}

/*
+0 −2
Original line number Diff line number Diff line
@@ -829,8 +829,6 @@ xrep_agi_calc_from_btrees(

		cur = xfs_inobt_init_cursor(mp, sc->tp, agi_bp, sc->sa.agno,
				XFS_BTNUM_FINO);
		if (error)
			goto err;
		error = xfs_btree_count_blocks(cur, &blocks);
		if (error)
			goto err;
Loading