diff mbox series

[1/6] btrfs: add function comment to btrfs_lookup_csums_list()

Message ID 6cd95c2965fedf3f2b2d8b5dbf1dcbb072067192.1712933005.git.fdmanana@suse.com (mailing list archive)
State New
Headers show
Series btrfs: some speedup for NOCOW write path and cleanups | expand

Commit Message

Filipe Manana April 12, 2024, 3:03 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

Add a function comment to btrfs_lookup_csums_list() to document it.
With another upcoming change its parameter list and return value will be
less obvious. So add the documentation now so that it can be updated where
needed later.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/file-item.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Qu Wenruo April 13, 2024, 10:11 a.m. UTC | #1
在 2024/4/13 00:33, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> Add a function comment to btrfs_lookup_csums_list() to document it.
> With another upcoming change its parameter list and return value will be
> less obvious. So add the documentation now so that it can be updated where
> needed later.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

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

Thanks,
Qu
> ---
>   fs/btrfs/file-item.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
> index e58fb5347e65..909438540119 100644
> --- a/fs/btrfs/file-item.c
> +++ b/fs/btrfs/file-item.c
> @@ -450,6 +450,19 @@ blk_status_t btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
>   	return ret;
>   }
>
> +/*
> + * Search for checksums for a given logical range.
> + *
> + * @root:		The root where to look for checksums.
> + * @start:		Logical address of target checksum range.
> + * @end:		End offset (inclusive) of the target checksum range.
> + * @list:		List for adding each checksum that was found.
> + * @search_commit:	Indicate if the commit root of the @root should be used
> + *			for the search.
> + * @nowait:		Indicate if the search must be non-blocking or not.
> + *
> + * Return < 0 on error and 0 on success.
> + */
>   int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end,
>   			    struct list_head *list, int search_commit,
>   			    bool nowait)
diff mbox series

Patch

diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index e58fb5347e65..909438540119 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -450,6 +450,19 @@  blk_status_t btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
 	return ret;
 }
 
+/*
+ * Search for checksums for a given logical range.
+ *
+ * @root:		The root where to look for checksums.
+ * @start:		Logical address of target checksum range.
+ * @end:		End offset (inclusive) of the target checksum range.
+ * @list:		List for adding each checksum that was found.
+ * @search_commit:	Indicate if the commit root of the @root should be used
+ *			for the search.
+ * @nowait:		Indicate if the search must be non-blocking or not.
+ *
+ * Return < 0 on error and 0 on success.
+ */
 int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end,
 			    struct list_head *list, int search_commit,
 			    bool nowait)