Skip to content

Commit b826850

Browse files
konisakpm00
authored andcommitted
nilfs2: correct return value kernel-doc descriptions for metadata files
Similar to the previous changes to fix return value descriptions, this fixes the format of the return value descriptions for metadata file functions other than sufile. 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 d33544a commit b826850

File tree

4 files changed

+77
-105
lines changed

4 files changed

+77
-105
lines changed

fs/nilfs2/cpfile.c

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,11 @@ static inline int nilfs_cpfile_get_checkpoint_block(struct inode *cpfile,
191191
* @cnop: place to store the next checkpoint number
192192
* @bhp: place to store a pointer to buffer_head struct
193193
*
194-
* Return Value: On success, it returns 0. On error, the following negative
195-
* error code is returned.
196-
*
197-
* %-ENOMEM - Insufficient memory available.
198-
*
199-
* %-EIO - I/O error
200-
*
201-
* %-ENOENT - no block exists in the range.
194+
* Return: 0 on success, or one of the following negative error codes on
195+
* failure:
196+
* * %-EIO - I/O error (including metadata corruption).
197+
* * %-ENOENT - no block exists in the range.
198+
* * %-ENOMEM - Insufficient memory available.
202199
*/
203200
static int nilfs_cpfile_find_checkpoint_block(struct inode *cpfile,
204201
__u64 start_cno, __u64 end_cno,
@@ -447,14 +444,11 @@ int nilfs_cpfile_finalize_checkpoint(struct inode *cpfile, __u64 cno,
447444
* the period from @start to @end, excluding @end itself. The checkpoints
448445
* which have been already deleted are ignored.
449446
*
450-
* Return Value: On success, 0 is returned. On error, one of the following
451-
* negative error codes is returned.
452-
*
453-
* %-EIO - I/O error.
454-
*
455-
* %-ENOMEM - Insufficient amount of memory available.
456-
*
457-
* %-EINVAL - invalid checkpoints.
447+
* Return: 0 on success, or one of the following negative error codes on
448+
* failure:
449+
* * %-EINVAL - Invalid checkpoints.
450+
* * %-EIO - I/O error (including metadata corruption).
451+
* * %-ENOMEM - Insufficient memory available.
458452
*/
459453
int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
460454
__u64 start,
@@ -1058,14 +1052,11 @@ int nilfs_cpfile_is_snapshot(struct inode *cpfile, __u64 cno)
10581052
* Description: nilfs_change_cpmode() changes the mode of the checkpoint
10591053
* specified by @cno. The mode @mode is NILFS_CHECKPOINT or NILFS_SNAPSHOT.
10601054
*
1061-
* Return Value: On success, 0 is returned. On error, one of the following
1062-
* negative error codes is returned.
1063-
*
1064-
* %-EIO - I/O error.
1065-
*
1066-
* %-ENOMEM - Insufficient amount of memory available.
1067-
*
1068-
* %-ENOENT - No such checkpoint.
1055+
* Return: 0 on success, or one of the following negative error codes on
1056+
* failure:
1057+
* * %-EIO - I/O error (including metadata corruption).
1058+
* * %-ENOENT - No such checkpoint.
1059+
* * %-ENOMEM - Insufficient memory available.
10691060
*/
10701061
int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode)
10711062
{
@@ -1097,14 +1088,12 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode)
10971088
* @cpstat: pointer to a structure of checkpoint statistics
10981089
*
10991090
* Description: nilfs_cpfile_get_stat() returns information about checkpoints.
1091+
* The checkpoint statistics are stored in the location pointed to by @cpstat.
11001092
*
1101-
* Return Value: On success, 0 is returned, and checkpoints information is
1102-
* stored in the place pointed by @cpstat. On error, one of the following
1103-
* negative error codes is returned.
1104-
*
1105-
* %-EIO - I/O error.
1106-
*
1107-
* %-ENOMEM - Insufficient amount of memory available.
1093+
* Return: 0 on success, or one of the following negative error codes on
1094+
* failure:
1095+
* * %-EIO - I/O error (including metadata corruption).
1096+
* * %-ENOMEM - Insufficient memory available.
11081097
*/
11091098
int nilfs_cpfile_get_stat(struct inode *cpfile, struct nilfs_cpstat *cpstat)
11101099
{

fs/nilfs2/dat.c

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,11 @@ int nilfs_dat_mark_dirty(struct inode *dat, __u64 vblocknr)
302302
* Description: nilfs_dat_freev() frees the virtual block numbers specified by
303303
* @vblocknrs and @nitems.
304304
*
305-
* Return Value: On success, 0 is returned. On error, one of the following
306-
* negative error codes is returned.
307-
*
308-
* %-EIO - I/O error.
309-
*
310-
* %-ENOMEM - Insufficient amount of memory available.
311-
*
312-
* %-ENOENT - The virtual block number have not been allocated.
305+
* Return: 0 on success, or one of the following negative error codes on
306+
* failure:
307+
* * %-EIO - I/O error (including metadata corruption).
308+
* * %-ENOENT - The virtual block number have not been allocated.
309+
* * %-ENOMEM - Insufficient memory available.
313310
*/
314311
int nilfs_dat_freev(struct inode *dat, __u64 *vblocknrs, size_t nitems)
315312
{
@@ -325,12 +322,10 @@ int nilfs_dat_freev(struct inode *dat, __u64 *vblocknrs, size_t nitems)
325322
* Description: nilfs_dat_move() changes the block number associated with
326323
* @vblocknr to @blocknr.
327324
*
328-
* Return Value: On success, 0 is returned. On error, one of the following
329-
* negative error codes is returned.
330-
*
331-
* %-EIO - I/O error.
332-
*
333-
* %-ENOMEM - Insufficient amount of memory available.
325+
* Return: 0 on success, or one of the following negative error codes on
326+
* failure:
327+
* * %-EIO - I/O error (including metadata corruption).
328+
* * %-ENOMEM - Insufficient memory available.
334329
*/
335330
int nilfs_dat_move(struct inode *dat, __u64 vblocknr, sector_t blocknr)
336331
{
@@ -390,17 +385,14 @@ int nilfs_dat_move(struct inode *dat, __u64 vblocknr, sector_t blocknr)
390385
* @blocknrp: pointer to a block number
391386
*
392387
* Description: nilfs_dat_translate() maps the virtual block number @vblocknr
393-
* to the corresponding block number.
394-
*
395-
* Return Value: On success, 0 is returned and the block number associated
396-
* with @vblocknr is stored in the place pointed by @blocknrp. On error, one
397-
* of the following negative error codes is returned.
398-
*
399-
* %-EIO - I/O error.
388+
* to the corresponding block number. The block number associated with
389+
* @vblocknr is stored in the place pointed to by @blocknrp.
400390
*
401-
* %-ENOMEM - Insufficient amount of memory available.
402-
*
403-
* %-ENOENT - A block number associated with @vblocknr does not exist.
391+
* Return: 0 on success, or one of the following negative error codes on
392+
* failure:
393+
* * %-EIO - I/O error (including metadata corruption).
394+
* * %-ENOENT - A block number associated with @vblocknr does not exist.
395+
* * %-ENOMEM - Insufficient memory available.
404396
*/
405397
int nilfs_dat_translate(struct inode *dat, __u64 vblocknr, sector_t *blocknrp)
406398
{

fs/nilfs2/ifile.c

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,16 @@ static inline struct nilfs_ifile_info *NILFS_IFILE_I(struct inode *ifile)
3838
* @out_ino: pointer to a variable to store inode number
3939
* @out_bh: buffer_head contains newly allocated disk inode
4040
*
41-
* Return Value: On success, 0 is returned and the newly allocated inode
42-
* number is stored in the place pointed by @ino, and buffer_head pointer
43-
* that contains newly allocated disk inode structure is stored in the
44-
* place pointed by @out_bh
45-
* On error, one of the following negative error codes is returned.
41+
* nilfs_ifile_create_inode() allocates a new inode in the ifile metadata
42+
* file and stores the inode number in the variable pointed to by @out_ino,
43+
* as well as storing the ifile's buffer with the disk inode in the location
44+
* pointed to by @out_bh.
4645
*
47-
* %-EIO - I/O error.
48-
*
49-
* %-ENOMEM - Insufficient amount of memory available.
50-
*
51-
* %-ENOSPC - No inode left.
46+
* Return: 0 on success, or one of the following negative error codes on
47+
* failure:
48+
* * %-EIO - I/O error (including metadata corruption).
49+
* * %-ENOMEM - Insufficient memory available.
50+
* * %-ENOSPC - No inode left.
5251
*/
5352
int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino,
5453
struct buffer_head **out_bh)
@@ -83,14 +82,11 @@ int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino,
8382
* @ifile: ifile inode
8483
* @ino: inode number
8584
*
86-
* Return Value: On success, 0 is returned. On error, one of the following
87-
* negative error codes is returned.
88-
*
89-
* %-EIO - I/O error.
90-
*
91-
* %-ENOMEM - Insufficient amount of memory available.
92-
*
93-
* %-ENOENT - The inode number @ino have not been allocated.
85+
* Return: 0 on success, or one of the following negative error codes on
86+
* failure:
87+
* * %-EIO - I/O error (including metadata corruption).
88+
* * %-ENOENT - Inode number unallocated.
89+
* * %-ENOMEM - Insufficient memory available.
9490
*/
9591
int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino)
9692
{

fs/nilfs2/mdt.c

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -226,20 +226,21 @@ static int nilfs_mdt_read_block(struct inode *inode, unsigned long block,
226226
* @out_bh: output of a pointer to the buffer_head
227227
*
228228
* nilfs_mdt_get_block() looks up the specified buffer and tries to create
229-
* a new buffer if @create is not zero. On success, the returned buffer is
230-
* assured to be either existing or formatted using a buffer lock on success.
231-
* @out_bh is substituted only when zero is returned.
229+
* a new buffer if @create is not zero. If (and only if) this function
230+
* succeeds, it stores a pointer to the retrieved buffer head in the location
231+
* pointed to by @out_bh.
232232
*
233-
* Return Value: On success, it returns 0. On error, the following negative
234-
* error code is returned.
233+
* The retrieved buffer may be either an existing one or a newly allocated one.
234+
* For a newly created buffer, if the callback function argument @init_block
235+
* is non-NULL, the callback will be called with the buffer locked to format
236+
* the block.
235237
*
236-
* %-ENOMEM - Insufficient memory available.
237-
*
238-
* %-EIO - I/O error
239-
*
240-
* %-ENOENT - the specified block does not exist (hole block)
241-
*
242-
* %-EROFS - Read only filesystem (for create mode)
238+
* Return: 0 on success, or one of the following negative error codes on
239+
* failure:
240+
* * %-EIO - I/O error (including metadata corruption).
241+
* * %-ENOENT - The specified block does not exist (hole block).
242+
* * %-ENOMEM - Insufficient memory available.
243+
* * %-EROFS - Read only filesystem (for create mode).
243244
*/
244245
int nilfs_mdt_get_block(struct inode *inode, unsigned long blkoff, int create,
245246
void (*init_block)(struct inode *,
@@ -275,14 +276,11 @@ int nilfs_mdt_get_block(struct inode *inode, unsigned long blkoff, int create,
275276
* @out_bh, and block offset to @blkoff, respectively. @out_bh and
276277
* @blkoff are substituted only when zero is returned.
277278
*
278-
* Return Value: On success, it returns 0. On error, the following negative
279-
* error code is returned.
280-
*
281-
* %-ENOMEM - Insufficient memory available.
282-
*
283-
* %-EIO - I/O error
284-
*
285-
* %-ENOENT - no block was found in the range
279+
* Return: 0 on success, or one of the following negative error codes on
280+
* failure:
281+
* * %-EIO - I/O error (including metadata corruption).
282+
* * %-ENOENT - No block was found in the range.
283+
* * %-ENOMEM - Insufficient memory available.
286284
*/
287285
int nilfs_mdt_find_block(struct inode *inode, unsigned long start,
288286
unsigned long end, unsigned long *blkoff,
@@ -321,12 +319,11 @@ int nilfs_mdt_find_block(struct inode *inode, unsigned long start,
321319
* @inode: inode of the meta data file
322320
* @block: block offset
323321
*
324-
* Return Value: On success, zero is returned.
325-
* On error, one of the following negative error code is returned.
326-
*
327-
* %-ENOMEM - Insufficient memory available.
328-
*
329-
* %-EIO - I/O error
322+
* Return: 0 on success, or one of the following negative error codes on
323+
* failure:
324+
* * %-EIO - I/O error (including metadata corruption).
325+
* * %-ENOENT - Non-existent block.
326+
* * %-ENOMEM - Insufficient memory available.
330327
*/
331328
int nilfs_mdt_delete_block(struct inode *inode, unsigned long block)
332329
{
@@ -349,12 +346,10 @@ int nilfs_mdt_delete_block(struct inode *inode, unsigned long block)
349346
* nilfs_mdt_forget_block() clears a dirty flag of the specified buffer, and
350347
* tries to release the page including the buffer from a page cache.
351348
*
352-
* Return Value: On success, 0 is returned. On error, one of the following
353-
* negative error code is returned.
354-
*
355-
* %-EBUSY - page has an active buffer.
356-
*
357-
* %-ENOENT - page cache has no page addressed by the offset.
349+
* Return: 0 on success, or one of the following negative error codes on
350+
* failure:
351+
* * %-EBUSY - Page has an active buffer.
352+
* * %-ENOENT - Page cache has no page addressed by the offset.
358353
*/
359354
int nilfs_mdt_forget_block(struct inode *inode, unsigned long block)
360355
{

0 commit comments

Comments
 (0)