Re: [PATCH 07/24] xfs: add refcount btree operations

Dave Chinner
2015-07-30T00:52:01Z

On Wed, Jul 29, 2015 at 03:33:43PM -0700, Darrick J. Wong wrote:
> Implement the generic btree operations required to manipulate refcount
> btree blocks. The implementation is similar to the bmapbt, though it
> will only allocate and free blocks from the AG.
....
> +
> +/*
> + * Remove the record referred to by cur, then set the pointer to the spot
> + * where the record could be re-inserted, in case we want to increment or
> + * decrement the cursor.
> + * This either works (return 0) or gets an EFSCORRUPTED error.
> + */
> +STATIC int
> +xfs_refcountbt_delete(
> + struct xfs_btree_cur *cur,
> + int *i)
> +{
> + struct xfs_refcount_irec irec;
> + int found_rec;
> + int error;
> +
> + error = xfs_refcountbt_get_rec(cur, &irec, &found_rec);
> + if (error)
> + return error;
> + XFS_WANT_CORRUPTED_GOTO(cur->bc_mp, found_rec == 1, out_error);
> + trace_xfs_refcountbt_delete(cur->bc_mp, cur->bc_private.a.agno, &irec);
> + error = xfs_btree_delete(cur, i);
> + if (error)
> + return error;

Need another XFS_WANT_CORRUPTED_GOTO() here, too.

> + */
> +#ifndef __XFS_REFCOUNT_H__
> +#define __XFS_REFCOUNT_H__

whitespace.

Cheers,

Dave.

--
Dave Chinner
david@fromorbit.com