Skip to content

Commit d33544a

Browse files
konisakpm00
authored andcommitted
nilfs2: correct return value kernel-doc descriptions for sufile
Similar to the previous changes to fix return value descriptions, this fixes the format of the return value descriptions of functions for sufile-related functions, eliminating a dozen warnings emitted by the kernel-doc script. 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 e4a99d4 commit d33544a

File tree

2 files changed

+45
-73
lines changed

2 files changed

+45
-73
lines changed

fs/nilfs2/sufile.c

Lines changed: 39 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,13 @@ unsigned long nilfs_sufile_get_ncleansegs(struct inode *sufile)
155155
* of successfully modified segments from the head is stored in the
156156
* place @ndone points to.
157157
*
158-
* Return Value: On success, zero is returned. On error, one of the
159-
* following negative error codes is returned.
160-
*
161-
* %-EIO - I/O error.
162-
*
163-
* %-ENOMEM - Insufficient amount of memory available.
164-
*
165-
* %-ENOENT - Given segment usage is in hole block (may be returned if
166-
* @create is zero)
167-
*
168-
* %-EINVAL - Invalid segment usage number
158+
* Return: 0 on success, or one of the following negative error codes on
159+
* failure:
160+
* * %-EINVAL - Invalid segment usage number
161+
* * %-EIO - I/O error (including metadata corruption).
162+
* * %-ENOENT - Given segment usage is in hole block (may be returned if
163+
* @create is zero)
164+
* * %-ENOMEM - Insufficient memory available.
169165
*/
170166
int nilfs_sufile_updatev(struct inode *sufile, __u64 *segnumv, size_t nsegs,
171167
int create, size_t *ndone,
@@ -272,10 +268,7 @@ int nilfs_sufile_update(struct inode *sufile, __u64 segnum, int create,
272268
* @start: minimum segment number of allocatable region (inclusive)
273269
* @end: maximum segment number of allocatable region (inclusive)
274270
*
275-
* Return Value: On success, 0 is returned. On error, one of the
276-
* following negative error codes is returned.
277-
*
278-
* %-ERANGE - invalid segment region
271+
* Return: 0 on success, or %-ERANGE if segment range is invalid.
279272
*/
280273
int nilfs_sufile_set_alloc_range(struct inode *sufile, __u64 start, __u64 end)
281274
{
@@ -300,17 +293,14 @@ int nilfs_sufile_set_alloc_range(struct inode *sufile, __u64 start, __u64 end)
300293
* @sufile: inode of segment usage file
301294
* @segnump: pointer to segment number
302295
*
303-
* Description: nilfs_sufile_alloc() allocates a clean segment.
304-
*
305-
* Return Value: On success, 0 is returned and the segment number of the
306-
* allocated segment is stored in the place pointed by @segnump. On error, one
307-
* of the following negative error codes is returned.
308-
*
309-
* %-EIO - I/O error.
296+
* Description: nilfs_sufile_alloc() allocates a clean segment, and stores
297+
* its segment number in the place pointed to by @segnump.
310298
*
311-
* %-ENOMEM - Insufficient amount of memory available.
312-
*
313-
* %-ENOSPC - No clean segment left.
299+
* Return: 0 on success, or one of the following negative error codes on
300+
* failure:
301+
* * %-EIO - I/O error (including metadata corruption).
302+
* * %-ENOMEM - Insufficient memory available.
303+
* * %-ENOSPC - No clean segment left.
314304
*/
315305
int nilfs_sufile_alloc(struct inode *sufile, __u64 *segnump)
316306
{
@@ -610,16 +600,13 @@ int nilfs_sufile_set_segment_usage(struct inode *sufile, __u64 segnum,
610600
* @sufile: inode of segment usage file
611601
* @sustat: pointer to a structure of segment usage statistics
612602
*
613-
* Description: nilfs_sufile_get_stat() returns information about segment
614-
* usage.
615-
*
616-
* Return Value: On success, 0 is returned, and segment usage information is
617-
* stored in the place pointed by @sustat. On error, one of the following
618-
* negative error codes is returned.
603+
* Description: nilfs_sufile_get_stat() retrieves segment usage statistics
604+
* and stores them in the location pointed to by @sustat.
619605
*
620-
* %-EIO - I/O error.
621-
*
622-
* %-ENOMEM - Insufficient amount of memory available.
606+
* Return: 0 on success, or one of the following negative error codes on
607+
* failure:
608+
* * %-EIO - I/O error (including metadata corruption).
609+
* * %-ENOMEM - Insufficient memory available.
623610
*/
624611
int nilfs_sufile_get_stat(struct inode *sufile, struct nilfs_sustat *sustat)
625612
{
@@ -683,16 +670,12 @@ void nilfs_sufile_do_set_error(struct inode *sufile, __u64 segnum,
683670
* @start: start segment number (inclusive)
684671
* @end: end segment number (inclusive)
685672
*
686-
* Return Value: On success, 0 is returned. On error, one of the
687-
* following negative error codes is returned.
688-
*
689-
* %-EIO - I/O error.
690-
*
691-
* %-ENOMEM - Insufficient amount of memory available.
692-
*
693-
* %-EINVAL - Invalid number of segments specified
694-
*
695-
* %-EBUSY - Dirty or active segments are present in the range
673+
* Return: 0 on success, or one of the following negative error codes on
674+
* failure:
675+
* * %-EBUSY - Dirty or active segments are present in the range.
676+
* * %-EINVAL - Invalid number of segments specified.
677+
* * %-EIO - I/O error (including metadata corruption).
678+
* * %-ENOMEM - Insufficient memory available.
696679
*/
697680
static int nilfs_sufile_truncate_range(struct inode *sufile,
698681
__u64 start, __u64 end)
@@ -787,16 +770,12 @@ static int nilfs_sufile_truncate_range(struct inode *sufile,
787770
* @sufile: inode of segment usage file
788771
* @newnsegs: new number of segments
789772
*
790-
* Return Value: On success, 0 is returned. On error, one of the
791-
* following negative error codes is returned.
792-
*
793-
* %-EIO - I/O error.
794-
*
795-
* %-ENOMEM - Insufficient amount of memory available.
796-
*
797-
* %-ENOSPC - Enough free space is not left for shrinking
798-
*
799-
* %-EBUSY - Dirty or active segments exist in the region to be truncated
773+
* Return: 0 on success, or one of the following negative error codes on
774+
* failure:
775+
* * %-EBUSY - Dirty or active segments exist in the region to be truncated.
776+
* * %-EIO - I/O error (including metadata corruption).
777+
* * %-ENOMEM - Insufficient memory available.
778+
* * %-ENOSPC - Enough free space is not left for shrinking.
800779
*/
801780
int nilfs_sufile_resize(struct inode *sufile, __u64 newnsegs)
802781
{
@@ -939,14 +918,11 @@ ssize_t nilfs_sufile_get_suinfo(struct inode *sufile, __u64 segnum, void *buf,
939918
* segment usage accordingly. Only the fields indicated by the sup_flags
940919
* are updated.
941920
*
942-
* Return Value: On success, 0 is returned. On error, one of the
943-
* following negative error codes is returned.
944-
*
945-
* %-EIO - I/O error.
946-
*
947-
* %-ENOMEM - Insufficient amount of memory available.
948-
*
949-
* %-EINVAL - Invalid values in input (segment number, flags or nblocks)
921+
* Return: 0 on success, or one of the following negative error codes on
922+
* failure:
923+
* * %-EINVAL - Invalid values in input (segment number, flags or nblocks).
924+
* * %-EIO - I/O error (including metadata corruption).
925+
* * %-ENOMEM - Insufficient memory available.
950926
*/
951927
ssize_t nilfs_sufile_set_suinfo(struct inode *sufile, void *buf,
952928
unsigned int supsz, size_t nsup)
@@ -1073,7 +1049,7 @@ ssize_t nilfs_sufile_set_suinfo(struct inode *sufile, void *buf,
10731049
* and start+len is rounded down. For each clean segment blkdev_issue_discard
10741050
* function is invoked.
10751051
*
1076-
* Return Value: On success, 0 is returned or negative error code, otherwise.
1052+
* Return: 0 on success, or a negative error code on failure.
10771053
*/
10781054
int nilfs_sufile_trim_fs(struct inode *sufile, struct fstrim_range *range)
10791055
{

fs/nilfs2/sufile.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ static inline int nilfs_sufile_freev(struct inode *sufile, __u64 *segnumv,
9595
* @nsegs: size of @segnumv array
9696
* @ndone: place to store the number of cancelled segments
9797
*
98-
* Return Value: On success, 0 is returned. On error, a negative error codes
99-
* is returned.
98+
* Return: 0 on success, or a negative error code on failure.
10099
*/
101100
static inline int nilfs_sufile_cancel_freev(struct inode *sufile,
102101
__u64 *segnumv, size_t nsegs,
@@ -114,14 +113,11 @@ static inline int nilfs_sufile_cancel_freev(struct inode *sufile,
114113
* Description: nilfs_sufile_set_error() marks the segment specified by
115114
* @segnum as erroneous. The error segment will never be used again.
116115
*
117-
* Return Value: On success, 0 is returned. On error, one of the following
118-
* negative error codes is returned.
119-
*
120-
* %-EIO - I/O error.
121-
*
122-
* %-ENOMEM - Insufficient amount of memory available.
123-
*
124-
* %-EINVAL - Invalid segment usage number.
116+
* Return: 0 on success, or one of the following negative error codes on
117+
* failure:
118+
* * %-EINVAL - Invalid segment usage number.
119+
* * %-EIO - I/O error (including metadata corruption).
120+
* * %-ENOMEM - Insufficient memory available.
125121
*/
126122
static inline int nilfs_sufile_set_error(struct inode *sufile, __u64 segnum)
127123
{

0 commit comments

Comments
 (0)