Skip to content

Commit 17c46a4

Browse files
konisakpm00
authored andcommitted
nilfs2: correct return value kernel-doc descriptions for ioctl functions
Patch series "nilfs2: fix kernel-doc comments for function return values", v2. This series fixes the inadequacies in the return value descriptions in nilfs2's kernel-doc comments (mainly incorrect formatting), as well as the lack of return value descriptions themselves, and fixes most of the remaining warnings that are output when the kernel-doc script is run with the "-Wall" option. This patch (of 7): In the kernel-doc comments for functions, there are many cases where the format of the return value description is inaccurate, such as "Return Value: ...", which causes many warnings to be output when the kernel-doc script is executed with the "-Wall" option. This fixes such incorrectly formatted return value descriptions for ioctl functions. Link: https://lkml.kernel.org/r/[email protected] 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 d22feb5 commit 17c46a4

File tree

1 file changed

+96
-137
lines changed

1 file changed

+96
-137
lines changed

fs/nilfs2/ioctl.c

Lines changed: 96 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,14 @@
3333
* @dofunc: concrete function of get/set metadata info
3434
*
3535
* Description: nilfs_ioctl_wrap_copy() gets/sets metadata info by means of
36-
* calling dofunc() function on the basis of @argv argument.
37-
*
38-
* Return Value: On success, 0 is returned and requested metadata info
39-
* is copied into userspace. On error, one of the following
40-
* negative error codes is returned.
41-
*
42-
* %-EINVAL - Invalid arguments from userspace.
43-
*
44-
* %-ENOMEM - Insufficient amount of memory available.
45-
*
46-
* %-EFAULT - Failure during execution of requested operation.
36+
* calling dofunc() function on the basis of @argv argument. If successful,
37+
* the requested metadata information is copied to userspace memory.
38+
*
39+
* Return: 0 on success, or one of the following negative error codes on
40+
* failure:
41+
* * %-EFAULT - Failure during execution of requested operation.
42+
* * %-EINVAL - Invalid arguments from userspace.
43+
* * %-ENOMEM - Insufficient memory available.
4744
*/
4845
static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
4946
struct nilfs_argv *argv, int dir,
@@ -190,13 +187,10 @@ static int nilfs_ioctl_getversion(struct inode *inode, void __user *argp)
190187
* given checkpoint between checkpoint and snapshot state. This ioctl
191188
* is used in chcp and mkcp utilities.
192189
*
193-
* Return Value: On success, 0 is returned and mode of a checkpoint is
194-
* changed. On error, one of the following negative error codes
195-
* is returned.
196-
*
197-
* %-EPERM - Operation not permitted.
198-
*
199-
* %-EFAULT - Failure during checkpoint mode changing.
190+
* Return: 0 on success, or one of the following negative error codes on
191+
* failure:
192+
* %-EFAULT - Failure during checkpoint mode changing.
193+
* %-EPERM - Operation not permitted.
200194
*/
201195
static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
202196
unsigned int cmd, void __user *argp)
@@ -244,13 +238,10 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
244238
* checkpoint from NILFS2 file system. This ioctl is used in rmcp
245239
* utility.
246240
*
247-
* Return Value: On success, 0 is returned and a checkpoint is
248-
* removed. On error, one of the following negative error codes
249-
* is returned.
250-
*
251-
* %-EPERM - Operation not permitted.
252-
*
253-
* %-EFAULT - Failure during checkpoint removing.
241+
* Return: 0 on success, or one of the following negative error codes on
242+
* failure:
243+
* %-EFAULT - Failure during checkpoint removing.
244+
* %-EPERM - Operation not permitted.
254245
*/
255246
static int
256247
nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
@@ -296,7 +287,7 @@ nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
296287
* requested checkpoints. The NILFS_IOCTL_GET_CPINFO ioctl is used in
297288
* lscp utility and by nilfs_cleanerd daemon.
298289
*
299-
* Return value: count of nilfs_cpinfo structures in output buffer.
290+
* Return: Count of nilfs_cpinfo structures in output buffer.
300291
*/
301292
static ssize_t
302293
nilfs_ioctl_do_get_cpinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
@@ -320,17 +311,14 @@ nilfs_ioctl_do_get_cpinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
320311
*
321312
* Description: nilfs_ioctl_get_cpstat() returns information about checkpoints.
322313
* The NILFS_IOCTL_GET_CPSTAT ioctl is used by lscp, rmcp utilities
323-
* and by nilfs_cleanerd daemon.
314+
* and by nilfs_cleanerd daemon. The checkpoint statistics are copied to
315+
* the userspace memory pointed to by @argp.
324316
*
325-
* Return Value: On success, 0 is returned, and checkpoints information is
326-
* copied into userspace pointer @argp. On error, one of the following
327-
* negative error codes is returned.
328-
*
329-
* %-EIO - I/O error.
330-
*
331-
* %-ENOMEM - Insufficient amount of memory available.
332-
*
333-
* %-EFAULT - Failure during getting checkpoints statistics.
317+
* Return: 0 on success, or one of the following negative error codes on
318+
* failure:
319+
* * %-EFAULT - Failure during getting checkpoints statistics.
320+
* * %-EIO - I/O error.
321+
* * %-ENOMEM - Insufficient memory available.
334322
*/
335323
static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp,
336324
unsigned int cmd, void __user *argp)
@@ -363,7 +351,8 @@ static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp,
363351
* info about requested segments. The NILFS_IOCTL_GET_SUINFO ioctl is used
364352
* in lssu, nilfs_resize utilities and by nilfs_cleanerd daemon.
365353
*
366-
* Return value: count of nilfs_suinfo structures in output buffer.
354+
* Return: Count of nilfs_suinfo structures in output buffer on success,
355+
* or a negative error code on failure.
367356
*/
368357
static ssize_t
369358
nilfs_ioctl_do_get_suinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
@@ -387,17 +376,14 @@ nilfs_ioctl_do_get_suinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
387376
*
388377
* Description: nilfs_ioctl_get_sustat() returns segment usage statistics.
389378
* The NILFS_IOCTL_GET_SUSTAT ioctl is used in lssu, nilfs_resize utilities
390-
* and by nilfs_cleanerd daemon.
391-
*
392-
* Return Value: On success, 0 is returned, and segment usage information is
393-
* copied into userspace pointer @argp. On error, one of the following
394-
* negative error codes is returned.
395-
*
396-
* %-EIO - I/O error.
397-
*
398-
* %-ENOMEM - Insufficient amount of memory available.
379+
* and by nilfs_cleanerd daemon. The requested segment usage information is
380+
* copied to the userspace memory pointed to by @argp.
399381
*
400-
* %-EFAULT - Failure during getting segment usage statistics.
382+
* Return: 0 on success, or one of the following negative error codes on
383+
* failure:
384+
* * %-EFAULT - Failure during getting segment usage statistics.
385+
* * %-EIO - I/O error.
386+
* * %-ENOMEM - Insufficient memory available.
401387
*/
402388
static int nilfs_ioctl_get_sustat(struct inode *inode, struct file *filp,
403389
unsigned int cmd, void __user *argp)
@@ -430,7 +416,8 @@ static int nilfs_ioctl_get_sustat(struct inode *inode, struct file *filp,
430416
* on virtual block addresses. The NILFS_IOCTL_GET_VINFO ioctl is used
431417
* by nilfs_cleanerd daemon.
432418
*
433-
* Return value: count of nilfs_vinfo structures in output buffer.
419+
* Return: Count of nilfs_vinfo structures in output buffer on success, or
420+
* a negative error code on failure.
434421
*/
435422
static ssize_t
436423
nilfs_ioctl_do_get_vinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
@@ -457,7 +444,8 @@ nilfs_ioctl_do_get_vinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
457444
* about descriptors of disk block numbers. The NILFS_IOCTL_GET_BDESCS ioctl
458445
* is used by nilfs_cleanerd daemon.
459446
*
460-
* Return value: count of nilfs_bdescs structures in output buffer.
447+
* Return: Count of nilfs_bdescs structures in output buffer on success, or
448+
* a negative error code on failure.
461449
*/
462450
static ssize_t
463451
nilfs_ioctl_do_get_bdescs(struct the_nilfs *nilfs, __u64 *posp, int flags,
@@ -494,19 +482,15 @@ nilfs_ioctl_do_get_bdescs(struct the_nilfs *nilfs, __u64 *posp, int flags,
494482
*
495483
* Description: nilfs_ioctl_do_get_bdescs() function returns information
496484
* about descriptors of disk block numbers. The NILFS_IOCTL_GET_BDESCS ioctl
497-
* is used by nilfs_cleanerd daemon.
498-
*
499-
* Return Value: On success, 0 is returned, and disk block descriptors are
500-
* copied into userspace pointer @argp. On error, one of the following
501-
* negative error codes is returned.
502-
*
503-
* %-EINVAL - Invalid arguments from userspace.
485+
* is used by nilfs_cleanerd daemon. If successful, disk block descriptors
486+
* are copied to userspace pointer @argp.
504487
*
505-
* %-EIO - I/O error.
506-
*
507-
* %-ENOMEM - Insufficient amount of memory available.
508-
*
509-
* %-EFAULT - Failure during getting disk block descriptors.
488+
* Return: 0 on success, or one of the following negative error codes on
489+
* failure:
490+
* * %-EFAULT - Failure during getting disk block descriptors.
491+
* * %-EINVAL - Invalid arguments from userspace.
492+
* * %-EIO - I/O error.
493+
* * %-ENOMEM - Insufficient memory available.
510494
*/
511495
static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp,
512496
unsigned int cmd, void __user *argp)
@@ -540,16 +524,12 @@ static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp,
540524
* Description: nilfs_ioctl_move_inode_block() function registers data/node
541525
* buffer in the GC pagecache and submit read request.
542526
*
543-
* Return Value: On success, 0 is returned. On error, one of the following
544-
* negative error codes is returned.
545-
*
546-
* %-EIO - I/O error.
547-
*
548-
* %-ENOMEM - Insufficient amount of memory available.
549-
*
550-
* %-ENOENT - Requested block doesn't exist.
551-
*
552-
* %-EEXIST - Blocks conflict is detected.
527+
* Return: 0 on success, or one of the following negative error codes on
528+
* failure:
529+
* * %-EEXIST - Block conflict detected.
530+
* * %-EIO - I/O error.
531+
* * %-ENOENT - Requested block doesn't exist.
532+
* * %-ENOMEM - Insufficient memory available.
553533
*/
554534
static int nilfs_ioctl_move_inode_block(struct inode *inode,
555535
struct nilfs_vdesc *vdesc,
@@ -604,8 +584,8 @@ static int nilfs_ioctl_move_inode_block(struct inode *inode,
604584
* blocks that garbage collector specified with the array of nilfs_vdesc
605585
* structures and stores them into page caches of GC inodes.
606586
*
607-
* Return Value: Number of processed nilfs_vdesc structures or
608-
* error code, otherwise.
587+
* Return: Number of processed nilfs_vdesc structures on success, or
588+
* a negative error code on failure.
609589
*/
610590
static int nilfs_ioctl_move_blocks(struct super_block *sb,
611591
struct nilfs_argv *argv, void *buf)
@@ -682,14 +662,11 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
682662
* in the period from p_start to p_end, excluding p_end itself. The checkpoints
683663
* which have been already deleted are ignored.
684664
*
685-
* Return Value: Number of processed nilfs_period structures or
686-
* error code, otherwise.
687-
*
688-
* %-EIO - I/O error.
689-
*
690-
* %-ENOMEM - Insufficient amount of memory available.
691-
*
692-
* %-EINVAL - invalid checkpoints.
665+
* Return: Number of processed nilfs_period structures on success, or one of
666+
* the following negative error codes on failure:
667+
* * %-EINVAL - invalid checkpoints.
668+
* * %-EIO - I/O error.
669+
* * %-ENOMEM - Insufficient memory available.
693670
*/
694671
static int nilfs_ioctl_delete_checkpoints(struct the_nilfs *nilfs,
695672
struct nilfs_argv *argv, void *buf)
@@ -717,14 +694,11 @@ static int nilfs_ioctl_delete_checkpoints(struct the_nilfs *nilfs,
717694
* Description: nilfs_ioctl_free_vblocknrs() function frees
718695
* the virtual block numbers specified by @buf and @argv->v_nmembs.
719696
*
720-
* Return Value: Number of processed virtual block numbers or
721-
* error code, otherwise.
722-
*
723-
* %-EIO - I/O error.
724-
*
725-
* %-ENOMEM - Insufficient amount of memory available.
726-
*
727-
* %-ENOENT - The virtual block number have not been allocated.
697+
* Return: Number of processed virtual block numbers on success, or one of the
698+
* following negative error codes on failure:
699+
* * %-EIO - I/O error.
700+
* * %-ENOENT - Unallocated virtual block number.
701+
* * %-ENOMEM - Insufficient memory available.
728702
*/
729703
static int nilfs_ioctl_free_vblocknrs(struct the_nilfs *nilfs,
730704
struct nilfs_argv *argv, void *buf)
@@ -746,14 +720,11 @@ static int nilfs_ioctl_free_vblocknrs(struct the_nilfs *nilfs,
746720
* Description: nilfs_ioctl_mark_blocks_dirty() function marks
747721
* metadata file or data blocks as dirty.
748722
*
749-
* Return Value: Number of processed block descriptors or
750-
* error code, otherwise.
751-
*
752-
* %-ENOMEM - Insufficient memory available.
753-
*
754-
* %-EIO - I/O error
755-
*
756-
* %-ENOENT - the specified block does not exist (hole block)
723+
* Return: Number of processed block descriptors on success, or one of the
724+
* following negative error codes on failure:
725+
* * %-EIO - I/O error.
726+
* * %-ENOENT - Non-existent block (hole block).
727+
* * %-ENOMEM - Insufficient memory available.
757728
*/
758729
static int nilfs_ioctl_mark_blocks_dirty(struct the_nilfs *nilfs,
759730
struct nilfs_argv *argv, void *buf)
@@ -852,7 +823,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
852823
* from userspace. The NILFS_IOCTL_CLEAN_SEGMENTS ioctl is used by
853824
* nilfs_cleanerd daemon.
854825
*
855-
* Return Value: On success, 0 is returned or error code, otherwise.
826+
* Return: 0 on success, or a negative error code on failure.
856827
*/
857828
static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
858829
unsigned int cmd, void __user *argp)
@@ -976,20 +947,14 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
976947
* and metadata are written out to the device when it successfully
977948
* returned.
978949
*
979-
* Return Value: On success, 0 is retured. On errors, one of the following
980-
* negative error code is returned.
981-
*
982-
* %-EROFS - Read only filesystem.
983-
*
984-
* %-EIO - I/O error
985-
*
986-
* %-ENOSPC - No space left on device (only in a panic state).
987-
*
988-
* %-ERESTARTSYS - Interrupted.
989-
*
990-
* %-ENOMEM - Insufficient memory available.
991-
*
992-
* %-EFAULT - Failure during execution of requested operation.
950+
* Return: 0 on success, or one of the following negative error codes on
951+
* failure:
952+
* * %-EFAULT - Failure during execution of requested operation.
953+
* * %-EIO - I/O error.
954+
* * %-ENOMEM - Insufficient memory available.
955+
* * %-ENOSPC - No space left on device (only in a panic state).
956+
* * %-ERESTARTSYS - Interrupted.
957+
* * %-EROFS - Read only filesystem.
993958
*/
994959
static int nilfs_ioctl_sync(struct inode *inode, struct file *filp,
995960
unsigned int cmd, void __user *argp)
@@ -1023,7 +988,7 @@ static int nilfs_ioctl_sync(struct inode *inode, struct file *filp,
1023988
* @filp: file object
1024989
* @argp: pointer on argument from userspace
1025990
*
1026-
* Return Value: On success, 0 is returned or error code, otherwise.
991+
* Return: 0 on success, or a negative error code on failure.
1027992
*/
1028993
static int nilfs_ioctl_resize(struct inode *inode, struct file *filp,
1029994
void __user *argp)
@@ -1059,7 +1024,7 @@ static int nilfs_ioctl_resize(struct inode *inode, struct file *filp,
10591024
* checks the arguments from userspace and calls nilfs_sufile_trim_fs, which
10601025
* performs the actual trim operation.
10611026
*
1062-
* Return Value: On success, 0 is returned or negative error code, otherwise.
1027+
* Return: 0 on success, or a negative error code on failure.
10631028
*/
10641029
static int nilfs_ioctl_trim_fs(struct inode *inode, void __user *argp)
10651030
{
@@ -1101,7 +1066,7 @@ static int nilfs_ioctl_trim_fs(struct inode *inode, void __user *argp)
11011066
* of segments in bytes and upper limit of segments in bytes.
11021067
* The NILFS_IOCTL_SET_ALLOC_RANGE is used by nilfs_resize utility.
11031068
*
1104-
* Return Value: On success, 0 is returned or error code, otherwise.
1069+
* Return: 0 on success, or a negative error code on failure.
11051070
*/
11061071
static int nilfs_ioctl_set_alloc_range(struct inode *inode, void __user *argp)
11071072
{
@@ -1152,17 +1117,15 @@ static int nilfs_ioctl_set_alloc_range(struct inode *inode, void __user *argp)
11521117
* @dofunc: concrete function of getting metadata info
11531118
*
11541119
* Description: nilfs_ioctl_get_info() gets metadata info by means of
1155-
* calling dofunc() function.
1120+
* calling dofunc() function. The requested metadata information is copied
1121+
* to userspace memory @argp.
11561122
*
1157-
* Return Value: On success, 0 is returned and requested metadata info
1158-
* is copied into userspace. On error, one of the following
1159-
* negative error codes is returned.
1160-
*
1161-
* %-EINVAL - Invalid arguments from userspace.
1162-
*
1163-
* %-ENOMEM - Insufficient amount of memory available.
1164-
*
1165-
* %-EFAULT - Failure during execution of requested operation.
1123+
* Return: 0 on success, or one of the following negative error codes on
1124+
* failure:
1125+
* * %-EFAULT - Failure during execution of requested operation.
1126+
* * %-EINVAL - Invalid arguments from userspace.
1127+
* * %-EIO - I/O error.
1128+
* * %-ENOMEM - Insufficient memory available.
11661129
*/
11671130
static int nilfs_ioctl_get_info(struct inode *inode, struct file *filp,
11681131
unsigned int cmd, void __user *argp,
@@ -1202,18 +1165,14 @@ static int nilfs_ioctl_get_info(struct inode *inode, struct file *filp,
12021165
* encapsulated in nilfs_argv and updates the segment usage info
12031166
* according to the flags in nilfs_suinfo_update.
12041167
*
1205-
* Return Value: On success, 0 is returned. On error, one of the
1206-
* following negative error codes is returned.
1207-
*
1208-
* %-EPERM - Not enough permissions
1209-
*
1210-
* %-EFAULT - Error copying input data
1211-
*
1212-
* %-EIO - I/O error.
1213-
*
1214-
* %-ENOMEM - Insufficient amount of memory available.
1215-
*
1216-
* %-EINVAL - Invalid values in input (segment number, flags or nblocks)
1168+
* Return: 0 on success, or one of the following negative error codes on
1169+
* failure:
1170+
* * %-EEXIST - Block conflict detected.
1171+
* * %-EFAULT - Error copying input data.
1172+
* * %-EINVAL - Invalid values in input (segment number, flags or nblocks).
1173+
* * %-EIO - I/O error.
1174+
* * %-ENOMEM - Insufficient memory available.
1175+
* * %-EPERM - Not enough permissions.
12171176
*/
12181177
static int nilfs_ioctl_set_suinfo(struct inode *inode, struct file *filp,
12191178
unsigned int cmd, void __user *argp)

0 commit comments

Comments
 (0)