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

Commit 0b04b6b8 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: trivial xfs_btree_del_cursor cleanups



The error argument to xfs_btree_del_cursor already understands the
"nonzero for error" semantics, so remove pointless error testing in the
callers and pass it directly.

Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 81b549aa
Loading
Loading
Loading
Loading
+8 −16
Original line number Diff line number Diff line
@@ -961,8 +961,7 @@ xfs_bmap_add_attrfork_extents(
					  XFS_DATA_FORK);
	if (cur) {
		cur->bc_private.b.allocated = 0;
		xfs_btree_del_cursor(cur,
			error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
		xfs_btree_del_cursor(cur, error);
	}
	return error;
}
@@ -4447,8 +4446,7 @@ xfs_bmapi_write(
		xfs_trans_log_inode(tp, ip, bma.logflags);

	if (bma.cur) {
		xfs_btree_del_cursor(bma.cur,
			error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
		xfs_btree_del_cursor(bma.cur, error);
	}
	if (!error)
		xfs_bmap_validate_ret(orig_bno, orig_len, orig_flags, orig_mval,
@@ -4542,10 +4540,8 @@ xfs_bmapi_remap(

	if (logflags)
		xfs_trans_log_inode(tp, ip, logflags);
	if (cur) {
		xfs_btree_del_cursor(cur,
				error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
	}
	if (cur)
		xfs_btree_del_cursor(cur, error);
	return error;
}

@@ -5439,8 +5435,7 @@ __xfs_bunmapi(
	if (cur) {
		if (!error)
			cur->bc_private.b.allocated = 0;
		xfs_btree_del_cursor(cur,
			error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
		xfs_btree_del_cursor(cur, error);
	}
	return error;
}
@@ -5700,8 +5695,7 @@ xfs_bmap_collapse_extents(
	*next_fsb = got.br_startoff;
del_cursor:
	if (cur)
		xfs_btree_del_cursor(cur,
			error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
		xfs_btree_del_cursor(cur, error);
	if (logflags)
		xfs_trans_log_inode(tp, ip, logflags);
	return error;
@@ -5828,8 +5822,7 @@ xfs_bmap_insert_extents(
	*next_fsb = got.br_startoff;
del_cursor:
	if (cur)
		xfs_btree_del_cursor(cur,
			error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
		xfs_btree_del_cursor(cur, error);
	if (logflags)
		xfs_trans_log_inode(tp, ip, logflags);
	return error;
@@ -5945,8 +5938,7 @@ xfs_bmap_split_extent_at(
del_cursor:
	if (cur) {
		cur->bc_private.b.allocated = 0;
		xfs_btree_del_cursor(cur,
				error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
		xfs_btree_del_cursor(cur, error);
	}

	if (logflags)
+1 −1
Original line number Diff line number Diff line
@@ -639,7 +639,7 @@ xfs_bmbt_change_owner(
	cur->bc_private.b.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;

	error = xfs_btree_change_owner(cur, new_owner, buffer_list);
	xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
	xfs_btree_del_cursor(cur, error);
	return error;
}

+1 −1
Original line number Diff line number Diff line
@@ -2258,7 +2258,7 @@ xfs_imap_lookup(
	}

	xfs_trans_brelse(tp, agbp);
	xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
	xfs_btree_del_cursor(cur, error);
	if (error)
		return error;

+1 −1
Original line number Diff line number Diff line
@@ -566,7 +566,7 @@ xfs_inobt_count_blocks(

	cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno, btnum);
	error = xfs_btree_count_blocks(cur, tree_blocks);
	xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
	xfs_btree_del_cursor(cur, error);
	xfs_buf_relse(agbp);

	return error;
+1 −1
Original line number Diff line number Diff line
@@ -1067,7 +1067,7 @@ xfs_refcount_finish_one_cleanup(
	if (rcur == NULL)
		return;
	agbp = rcur->bc_private.a.agbp;
	xfs_btree_del_cursor(rcur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
	xfs_btree_del_cursor(rcur, error);
	if (error)
		xfs_trans_brelse(tp, agbp);
}
Loading