Skip to content

Commit e4a99d4

Browse files
konisakpm00
authored andcommitted
nilfs2: correct return value kernel-doc descriptions for bmap functions
Similar to the previous patch to fix the ioctl return value descriptions, this fixes the format of the return value descriptions for bmap (and btree)-related functions, which was causing the kernel-doc script to emit a number of warnings. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ryusuke Konishi <[email protected]> Cc: "Brian G ." <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 17c46a4 commit e4a99d4

File tree

2 files changed

+56
-75
lines changed

2 files changed

+56
-75
lines changed

fs/nilfs2/bmap.c

Lines changed: 53 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,14 @@ static int nilfs_bmap_convert_error(struct nilfs_bmap *bmap,
4747
* @ptrp: place to store the value associated to @key
4848
*
4949
* Description: nilfs_bmap_lookup_at_level() finds a record whose key
50-
* matches @key in the block at @level of the bmap.
51-
*
52-
* Return Value: On success, 0 is returned and the record associated with @key
53-
* is stored in the place pointed by @ptrp. On error, one of the following
54-
* negative error codes is returned.
55-
*
56-
* %-EIO - I/O error.
57-
*
58-
* %-ENOMEM - Insufficient amount of memory available.
59-
*
60-
* %-ENOENT - A record associated with @key does not exist.
50+
* matches @key in the block at @level of the bmap. The record associated
51+
* with @key is stored in the place pointed to by @ptrp.
52+
*
53+
* Return: 0 on success, or one of the following negative error codes on
54+
* failure:
55+
* * %-EIO - I/O error (including metadata corruption).
56+
* * %-ENOENT - A record associated with @key does not exist.
57+
* * %-ENOMEM - Insufficient memory available.
6158
*/
6259
int nilfs_bmap_lookup_at_level(struct nilfs_bmap *bmap, __u64 key, int level,
6360
__u64 *ptrp)
@@ -138,14 +135,11 @@ static int nilfs_bmap_do_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr)
138135
* Description: nilfs_bmap_insert() inserts the new key-record pair specified
139136
* by @key and @rec into @bmap.
140137
*
141-
* Return Value: On success, 0 is returned. On error, one of the following
142-
* negative error codes is returned.
143-
*
144-
* %-EIO - I/O error.
145-
*
146-
* %-ENOMEM - Insufficient amount of memory available.
147-
*
148-
* %-EEXIST - A record associated with @key already exist.
138+
* Return: 0 on success, or one of the following negative error codes on
139+
* failure:
140+
* * %-EEXIST - A record associated with @key already exists.
141+
* * %-EIO - I/O error (including metadata corruption).
142+
* * %-ENOMEM - Insufficient memory available.
149143
*/
150144
int nilfs_bmap_insert(struct nilfs_bmap *bmap, __u64 key, unsigned long rec)
151145
{
@@ -193,14 +187,11 @@ static int nilfs_bmap_do_delete(struct nilfs_bmap *bmap, __u64 key)
193187
* Description: nilfs_bmap_seek_key() seeks a valid key on @bmap
194188
* starting from @start, and stores it to @keyp if found.
195189
*
196-
* Return Value: On success, 0 is returned. On error, one of the following
197-
* negative error codes is returned.
198-
*
199-
* %-EIO - I/O error.
200-
*
201-
* %-ENOMEM - Insufficient amount of memory available.
202-
*
203-
* %-ENOENT - No valid entry was found
190+
* Return: 0 on success, or one of the following negative error codes on
191+
* failure:
192+
* * %-EIO - I/O error (including metadata corruption).
193+
* * %-ENOENT - No valid entry was found.
194+
* * %-ENOMEM - Insufficient memory available.
204195
*/
205196
int nilfs_bmap_seek_key(struct nilfs_bmap *bmap, __u64 start, __u64 *keyp)
206197
{
@@ -236,14 +227,11 @@ int nilfs_bmap_last_key(struct nilfs_bmap *bmap, __u64 *keyp)
236227
* Description: nilfs_bmap_delete() deletes the key-record pair specified by
237228
* @key from @bmap.
238229
*
239-
* Return Value: On success, 0 is returned. On error, one of the following
240-
* negative error codes is returned.
241-
*
242-
* %-EIO - I/O error.
243-
*
244-
* %-ENOMEM - Insufficient amount of memory available.
245-
*
246-
* %-ENOENT - A record associated with @key does not exist.
230+
* Return: 0 on success, or one of the following negative error codes on
231+
* failure:
232+
* * %-EIO - I/O error (including metadata corruption).
233+
* * %-ENOENT - A record associated with @key does not exist.
234+
* * %-ENOMEM - Insufficient memory available.
247235
*/
248236
int nilfs_bmap_delete(struct nilfs_bmap *bmap, __u64 key)
249237
{
@@ -290,12 +278,10 @@ static int nilfs_bmap_do_truncate(struct nilfs_bmap *bmap, __u64 key)
290278
* Description: nilfs_bmap_truncate() removes key-record pairs whose keys are
291279
* greater than or equal to @key from @bmap.
292280
*
293-
* Return Value: On success, 0 is returned. On error, one of the following
294-
* negative error codes is returned.
295-
*
296-
* %-EIO - I/O error.
297-
*
298-
* %-ENOMEM - Insufficient amount of memory available.
281+
* Return: 0 on success, or one of the following negative error codes on
282+
* failure:
283+
* * %-EIO - I/O error (including metadata corruption).
284+
* * %-ENOMEM - Insufficient memory available.
299285
*/
300286
int nilfs_bmap_truncate(struct nilfs_bmap *bmap, __u64 key)
301287
{
@@ -330,12 +316,10 @@ void nilfs_bmap_clear(struct nilfs_bmap *bmap)
330316
* Description: nilfs_bmap_propagate() marks the buffers that directly or
331317
* indirectly refer to the block specified by @bh dirty.
332318
*
333-
* Return Value: On success, 0 is returned. On error, one of the following
334-
* negative error codes is returned.
335-
*
336-
* %-EIO - I/O error.
337-
*
338-
* %-ENOMEM - Insufficient amount of memory available.
319+
* Return: 0 on success, or one of the following negative error codes on
320+
* failure:
321+
* * %-EIO - I/O error (including metadata corruption).
322+
* * %-ENOMEM - Insufficient memory available.
339323
*/
340324
int nilfs_bmap_propagate(struct nilfs_bmap *bmap, struct buffer_head *bh)
341325
{
@@ -362,22 +346,22 @@ void nilfs_bmap_lookup_dirty_buffers(struct nilfs_bmap *bmap,
362346

363347
/**
364348
* nilfs_bmap_assign - assign a new block number to a block
365-
* @bmap: bmap
366-
* @bh: pointer to buffer head
349+
* @bmap: bmap
350+
* @bh: place to store a pointer to the buffer head to which a block
351+
* address is assigned (in/out)
367352
* @blocknr: block number
368-
* @binfo: block information
353+
* @binfo: block information
369354
*
370355
* Description: nilfs_bmap_assign() assigns the block number @blocknr to the
371-
* buffer specified by @bh.
372-
*
373-
* Return Value: On success, 0 is returned and the buffer head of a newly
374-
* create buffer and the block information associated with the buffer are
375-
* stored in the place pointed by @bh and @binfo, respectively. On error, one
376-
* of the following negative error codes is returned.
377-
*
378-
* %-EIO - I/O error.
379-
*
380-
* %-ENOMEM - Insufficient amount of memory available.
356+
* buffer specified by @bh. The block information is stored in the memory
357+
* pointed to by @binfo, and the buffer head may be replaced as a block
358+
* address is assigned, in which case a pointer to the new buffer head is
359+
* stored in the memory pointed to by @bh.
360+
*
361+
* Return: 0 on success, or one of the following negative error codes on
362+
* failure:
363+
* * %-EIO - I/O error (including metadata corruption).
364+
* * %-ENOMEM - Insufficient memory available.
381365
*/
382366
int nilfs_bmap_assign(struct nilfs_bmap *bmap,
383367
struct buffer_head **bh,
@@ -402,12 +386,10 @@ int nilfs_bmap_assign(struct nilfs_bmap *bmap,
402386
* Description: nilfs_bmap_mark() marks the block specified by @key and @level
403387
* as dirty.
404388
*
405-
* Return Value: On success, 0 is returned. On error, one of the following
406-
* negative error codes is returned.
407-
*
408-
* %-EIO - I/O error.
409-
*
410-
* %-ENOMEM - Insufficient amount of memory available.
389+
* Return: 0 on success, or one of the following negative error codes on
390+
* failure:
391+
* * %-EIO - I/O error (including metadata corruption).
392+
* * %-ENOMEM - Insufficient memory available.
411393
*/
412394
int nilfs_bmap_mark(struct nilfs_bmap *bmap, __u64 key, int level)
413395
{
@@ -430,7 +412,7 @@ int nilfs_bmap_mark(struct nilfs_bmap *bmap, __u64 key, int level)
430412
* Description: nilfs_test_and_clear() is the atomic operation to test and
431413
* clear the dirty state of @bmap.
432414
*
433-
* Return Value: 1 is returned if @bmap is dirty, or 0 if clear.
415+
* Return: 1 if @bmap is dirty, or 0 if clear.
434416
*/
435417
int nilfs_bmap_test_and_clear_dirty(struct nilfs_bmap *bmap)
436418
{
@@ -490,10 +472,10 @@ static struct lock_class_key nilfs_bmap_mdt_lock_key;
490472
*
491473
* Description: nilfs_bmap_read() initializes the bmap @bmap.
492474
*
493-
* Return Value: On success, 0 is returned. On error, the following negative
494-
* error code is returned.
495-
*
496-
* %-ENOMEM - Insufficient amount of memory available.
475+
* Return: 0 on success, or one of the following negative error codes on
476+
* failure:
477+
* * %-EIO - I/O error (corrupted bmap).
478+
* * %-ENOMEM - Insufficient memory available.
497479
*/
498480
int nilfs_bmap_read(struct nilfs_bmap *bmap, struct nilfs_inode *raw_inode)
499481
{

fs/nilfs2/btree.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static int nilfs_btree_node_lookup(const struct nilfs_btree_node *node,
334334
* @inode: host inode of btree
335335
* @blocknr: block number
336336
*
337-
* Return Value: If node is broken, 1 is returned. Otherwise, 0 is returned.
337+
* Return: 0 if normal, 1 if the node is broken.
338338
*/
339339
static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,
340340
size_t size, struct inode *inode,
@@ -366,7 +366,7 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,
366366
* @node: btree root node to be examined
367367
* @inode: host inode of btree
368368
*
369-
* Return Value: If node is broken, 1 is returned. Otherwise, 0 is returned.
369+
* Return: 0 if normal, 1 if the root node is broken.
370370
*/
371371
static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
372372
struct inode *inode)
@@ -652,8 +652,7 @@ static int nilfs_btree_do_lookup_last(const struct nilfs_bmap *btree,
652652
* @minlevel: start level
653653
* @nextkey: place to store the next valid key
654654
*
655-
* Return Value: If a next key was found, 0 is returned. Otherwise,
656-
* -ENOENT is returned.
655+
* Return: 0 if the next key was found, %-ENOENT if not found.
657656
*/
658657
static int nilfs_btree_get_next_key(const struct nilfs_bmap *btree,
659658
const struct nilfs_btree_path *path,

0 commit comments

Comments
 (0)