All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Cc: jeffm@suse.com
Subject: Re: [PATCH 2/3] btrfs: Document __btrfs_inc_extent_ref
Date: Tue, 19 Jun 2018 13:28:07 +0800	[thread overview]
Message-ID: <8bf1fbd7-9c0e-5c64-944f-73c5b9f63901@gmx.com> (raw)
In-Reply-To: <1529323166-29931-3-git-send-email-nborisov@suse.com>



On 2018年06月18日 19:59, Nikolay Borisov wrote:
> Here is a doc-only patch which tires to deobfuscate the terra-incognita
> that arguments for delayed refs are.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

> ---
>  fs/btrfs/extent-tree.c | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 59645ced6fbc..39d0652bf3f3 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -2207,6 +2207,40 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
>  	return ret;
>  }
>  
> +/*
> + * __btrfs_inc_extent_ref - insert backreference for a given extent
> + *
> + * @trans:	    Handle of transaction
> + *
> + * @node:	    The delayed ref node used to get the bytenr/length for
> + *		    extent whose references are incremented.
> + *
> + * @parent:	    If this is a shared extent (BTRFS_SHARED_DATA_REF_KEY/
> + *		    BTRFS_SHARED_BLOCK_REF_KEY) then it holds the logical
> + *		    bytenr of the parent block. Since new extents are always
> + *		    created with indirect references, this will only be the case
> + *		    when relocating a shared extent. In that case, root_objectid
> + *		    will be BTRFS_TREE_RELOC_OBJECTID. Otheriwse, parent must
> + *		    be 0
> + *
> + * @root_objectid:  The id of the root where this modification has originated,
> + *		    this can be either one of the well-known metadata trees or
> + *		    the subvolume id which references this extent.
> + *
> + * @owner:	    For data extents it is the inode number of the owning file.
> + *		    For metadata extents this parameter holds the level in the
> + *		    tree of the extent.

@owner the naming itself is a little confusing, but it's the necessary evil.
Or we will have too many parameters.

Thanks,
Qu

> + *
> + * @offset:	    For metadata extents the offset is ignored and is currently
> + *		    always passed as 0. For data extents it is the fileoffset
> + *		    this extent belongs to.
> + *
> + * @refs_to_add     Number of references to add
> + *
> + * @extent_op       Pointer to a structure, holding information necessary when
> + *                  updating a tree block's flags
> + *
> + */
>  static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
>  				  struct btrfs_delayed_ref_node *node,
>  				  u64 parent, u64 root_objectid,
> 

  reply	other threads:[~2018-06-19  5:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 11:59 [PATCH 0/3] Cleanups around extent increment Nikolay Borisov
2018-06-18 11:59 ` [PATCH 1/3] btrfs: Remove fs_info argument from __btrfs_inc_extent_ref Nikolay Borisov
2018-06-19  5:24   ` Qu Wenruo
2018-06-19 13:01   ` Nikolay Borisov
2018-06-19 19:31   ` Jeff Mahoney
2018-06-19 22:36     ` Nikolay Borisov
2018-06-18 11:59 ` [PATCH 2/3] btrfs: Document __btrfs_inc_extent_ref Nikolay Borisov
2018-06-19  5:28   ` Qu Wenruo [this message]
2018-06-18 11:59 ` [PATCH 3/3] btrfs: Fix comment in lookup_inline_extent_backref Nikolay Borisov
2018-06-19 13:35 ` [PATCH 0/3] Cleanups around extent increment David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bf1fbd7-9c0e-5c64-944f-73c5b9f63901@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=jeffm@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.