Re: [PATCH 1/8] fs: btrfs: Introduce btrfs_for_each_slot
From: David Sterba <hidden>
Date: 2021-08-31 11:06:27
From: David Sterba <hidden>
Date: 2021-08-31 11:06:27
On Mon, Aug 30, 2021 at 03:37:03PM +0300, Nikolay Borisov wrote:
On 26.08.21 г. 19:40, Marcos Paulo de Souza wrote:quoted
+/* Search for a valid slot for the given path. + * @root: The root node of the tree. + * @key: Will contain a valid item if found. + * @path: The start point to validate the slot. + * + * Return 0 if the item is valid, 1 if not found and < 0 if error. + */ +int btrfs_valid_slot(struct btrfs_root *root, struct btrfs_key *key,nit: The name of this function is a bit misleading since it's not really a predicate, more like a function that returns the value and if it can't return the current value pointed to by path it gets the next leaf. I guess a more apt name would be "btrfs_get_next_valid_item" or some such.
Yeah the function name is confusing, like a predicate. The suggested name sounds good to me.