xfs
[Top] [All Lists]

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

To: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Subject: Re: [PATCH 07/24] xfs: add refcount btree operations
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 30 Jul 2015 10:51:54 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20150729223343.17414.27263.stgit@xxxxxxxxxxxxxxxx>
References: <20150729223258.17414.91354.stgit@xxxxxxxxxxxxxxxx> <20150729223343.17414.27263.stgit@xxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>