All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <quwenruo@cn.fujitsu.com>,
	linux-btrfs@vger.kernel.org, stephane_btrfs@lesimple.fr
Subject: Re: [PATCH 1/2] btrfs: Add support to do stack item key operation
Date: Fri, 2 Oct 2015 09:08:13 +0800	[thread overview]
Message-ID: <560DD8FD.5020502@gmx.com> (raw)
In-Reply-To: <20151001164643.GH5885@twin.jikos.cz>



在 2015年10月02日 00:46, David Sterba 写道:
> On Fri, Sep 25, 2015 at 10:38:00AM +0800, Qu Wenruo wrote:
>> +static inline void btrfs_stack_item_key(char *stack_leaf,
>> +					struct btrfs_disk_key *disk_key,
>> +					int nr)
>
>> +static inline void btrfs_stack_item_key_to_cpu(char *stack_leaf,
>> +					       struct btrfs_key *key,
>> +					       int nr)
>
> The functions do not follow the pattern of btrfs_stack_*,

The extent buffer version is btrfs_item_key() and btrfs_item_key_to_cpu()
So I don't see the problem with the naming.
Would you please pointing out what's wrong with the naming?

> also passing
> 'char *' is not right, it should be 'struct extent_buffer *'.

The problem is, extent_buffer is not some thing we can operate directly 
in memory.
It uses page pointer to do read/write.

So we read out the real extent buffer content and do operation.

I can change the struct name to btrfs_header, but not extent_buffer.

>
> IOW the manually created structure accessors must match the prototypes
> that would result from BTRFS_STACK_FUNCS and BTRFS_SETGET_STACK_FUNCS.

Unfortunately, the original btrfs_item_key() and its variants are not 
from BTRFS_STACK_FCUNS.

Thanks,
Qu

> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2015-10-02  1:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25  2:37 [PATCH 0/2] Btrfs: Fix a insane extent_buffer copy behavior for qgroup Qu Wenruo
2015-09-25  2:38 ` [PATCH 1/2] btrfs: Add support to do stack item key operation Qu Wenruo
2015-10-01 16:46   ` David Sterba
2015-10-02  1:08     ` Qu Wenruo [this message]
2015-09-25  2:38 ` [PATCH 2/2] btrfs: qgroup: Don't copy extent buffer to do qgroup rescan Qu Wenruo
2015-09-25 22:35 ` [PATCH 0/2] Btrfs: Fix a insane extent_buffer copy behavior for qgroup Stéphane Lesimple

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=560DD8FD.5020502@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    --cc=stephane_btrfs@lesimple.fr \
    /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.