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