2024-03-22 06:55:56

by Yang Li

[permalink] [raw]
Subject: [PATCH -next] fs: Add kernel-doc comments to ufs_getfrag_block()

This commit adds kernel-doc style comments with complete parameter
descriptions for the function ufs_getfrag_block.

Signed-off-by: Yang Li <[email protected]>
---
fs/ufs/inode.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index a7bb2e63cdde..4a36feff043f 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -392,6 +392,20 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block,
/**
* ufs_getfrag_block() - `get_block_t' function, interface between UFS and
* read_folio, writepages and so on
+ * @inode: Inode of the file for which the block is being fetched.
+ * @fragment: Logical block number within the file.
+ * @bh_result: The buffer_head to fill in with the block's information.
+ * @create: Flag indicating if the block should be allocated if it doesn't exist.
+ *
+ * This function is responsible for translating a file's logical block number
+ * into its physical block number on disk. If necessary, it can also allocate
+ * blocks to the file, when the 'create' argument is non-zero. It fills the
+ * buffer_head @bh_result with the mapping information.
+ *
+ * Return: 0 on success or if the block is already allocated and @create is zero.
+ * In case of an error, a negative error code is returned. If a new block is
+ * allocated and @create is non-zero, the function also sets the buffer_new
+ * flag on @bh_result.
*/

static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create)
--
2.20.1.7.g153144c