33
33
* @dofunc: concrete function of get/set metadata info
34
34
*
35
35
* 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.
47
44
*/
48
45
static int nilfs_ioctl_wrap_copy (struct the_nilfs * nilfs ,
49
46
struct nilfs_argv * argv , int dir ,
@@ -190,13 +187,10 @@ static int nilfs_ioctl_getversion(struct inode *inode, void __user *argp)
190
187
* given checkpoint between checkpoint and snapshot state. This ioctl
191
188
* is used in chcp and mkcp utilities.
192
189
*
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.
200
194
*/
201
195
static int nilfs_ioctl_change_cpmode (struct inode * inode , struct file * filp ,
202
196
unsigned int cmd , void __user * argp )
@@ -244,13 +238,10 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
244
238
* checkpoint from NILFS2 file system. This ioctl is used in rmcp
245
239
* utility.
246
240
*
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.
254
245
*/
255
246
static int
256
247
nilfs_ioctl_delete_checkpoint (struct inode * inode , struct file * filp ,
@@ -296,7 +287,7 @@ nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
296
287
* requested checkpoints. The NILFS_IOCTL_GET_CPINFO ioctl is used in
297
288
* lscp utility and by nilfs_cleanerd daemon.
298
289
*
299
- * Return value: count of nilfs_cpinfo structures in output buffer.
290
+ * Return: Count of nilfs_cpinfo structures in output buffer.
300
291
*/
301
292
static ssize_t
302
293
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,
320
311
*
321
312
* Description: nilfs_ioctl_get_cpstat() returns information about checkpoints.
322
313
* 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.
324
316
*
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.
334
322
*/
335
323
static int nilfs_ioctl_get_cpstat (struct inode * inode , struct file * filp ,
336
324
unsigned int cmd , void __user * argp )
@@ -363,7 +351,8 @@ static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp,
363
351
* info about requested segments. The NILFS_IOCTL_GET_SUINFO ioctl is used
364
352
* in lssu, nilfs_resize utilities and by nilfs_cleanerd daemon.
365
353
*
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.
367
356
*/
368
357
static ssize_t
369
358
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,
387
376
*
388
377
* Description: nilfs_ioctl_get_sustat() returns segment usage statistics.
389
378
* 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.
399
381
*
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.
401
387
*/
402
388
static int nilfs_ioctl_get_sustat (struct inode * inode , struct file * filp ,
403
389
unsigned int cmd , void __user * argp )
@@ -430,7 +416,8 @@ static int nilfs_ioctl_get_sustat(struct inode *inode, struct file *filp,
430
416
* on virtual block addresses. The NILFS_IOCTL_GET_VINFO ioctl is used
431
417
* by nilfs_cleanerd daemon.
432
418
*
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.
434
421
*/
435
422
static ssize_t
436
423
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,
457
444
* about descriptors of disk block numbers. The NILFS_IOCTL_GET_BDESCS ioctl
458
445
* is used by nilfs_cleanerd daemon.
459
446
*
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.
461
449
*/
462
450
static ssize_t
463
451
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,
494
482
*
495
483
* Description: nilfs_ioctl_do_get_bdescs() function returns information
496
484
* 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.
504
487
*
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.
510
494
*/
511
495
static int nilfs_ioctl_get_bdescs (struct inode * inode , struct file * filp ,
512
496
unsigned int cmd , void __user * argp )
@@ -540,16 +524,12 @@ static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp,
540
524
* Description: nilfs_ioctl_move_inode_block() function registers data/node
541
525
* buffer in the GC pagecache and submit read request.
542
526
*
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.
553
533
*/
554
534
static int nilfs_ioctl_move_inode_block (struct inode * inode ,
555
535
struct nilfs_vdesc * vdesc ,
@@ -604,8 +584,8 @@ static int nilfs_ioctl_move_inode_block(struct inode *inode,
604
584
* blocks that garbage collector specified with the array of nilfs_vdesc
605
585
* structures and stores them into page caches of GC inodes.
606
586
*
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 .
609
589
*/
610
590
static int nilfs_ioctl_move_blocks (struct super_block * sb ,
611
591
struct nilfs_argv * argv , void * buf )
@@ -682,14 +662,11 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
682
662
* in the period from p_start to p_end, excluding p_end itself. The checkpoints
683
663
* which have been already deleted are ignored.
684
664
*
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.
693
670
*/
694
671
static int nilfs_ioctl_delete_checkpoints (struct the_nilfs * nilfs ,
695
672
struct nilfs_argv * argv , void * buf )
@@ -717,14 +694,11 @@ static int nilfs_ioctl_delete_checkpoints(struct the_nilfs *nilfs,
717
694
* Description: nilfs_ioctl_free_vblocknrs() function frees
718
695
* the virtual block numbers specified by @buf and @argv->v_nmembs.
719
696
*
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.
728
702
*/
729
703
static int nilfs_ioctl_free_vblocknrs (struct the_nilfs * nilfs ,
730
704
struct nilfs_argv * argv , void * buf )
@@ -746,14 +720,11 @@ static int nilfs_ioctl_free_vblocknrs(struct the_nilfs *nilfs,
746
720
* Description: nilfs_ioctl_mark_blocks_dirty() function marks
747
721
* metadata file or data blocks as dirty.
748
722
*
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.
757
728
*/
758
729
static int nilfs_ioctl_mark_blocks_dirty (struct the_nilfs * nilfs ,
759
730
struct nilfs_argv * argv , void * buf )
@@ -852,7 +823,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
852
823
* from userspace. The NILFS_IOCTL_CLEAN_SEGMENTS ioctl is used by
853
824
* nilfs_cleanerd daemon.
854
825
*
855
- * Return Value: On success, 0 is returned or error code, otherwise .
826
+ * Return: 0 on success, or a negative error code on failure .
856
827
*/
857
828
static int nilfs_ioctl_clean_segments (struct inode * inode , struct file * filp ,
858
829
unsigned int cmd , void __user * argp )
@@ -976,20 +947,14 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
976
947
* and metadata are written out to the device when it successfully
977
948
* returned.
978
949
*
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.
993
958
*/
994
959
static int nilfs_ioctl_sync (struct inode * inode , struct file * filp ,
995
960
unsigned int cmd , void __user * argp )
@@ -1023,7 +988,7 @@ static int nilfs_ioctl_sync(struct inode *inode, struct file *filp,
1023
988
* @filp: file object
1024
989
* @argp: pointer on argument from userspace
1025
990
*
1026
- * Return Value: On success, 0 is returned or error code, otherwise .
991
+ * Return: 0 on success, or a negative error code on failure .
1027
992
*/
1028
993
static int nilfs_ioctl_resize (struct inode * inode , struct file * filp ,
1029
994
void __user * argp )
@@ -1059,7 +1024,7 @@ static int nilfs_ioctl_resize(struct inode *inode, struct file *filp,
1059
1024
* checks the arguments from userspace and calls nilfs_sufile_trim_fs, which
1060
1025
* performs the actual trim operation.
1061
1026
*
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 .
1063
1028
*/
1064
1029
static int nilfs_ioctl_trim_fs (struct inode * inode , void __user * argp )
1065
1030
{
@@ -1101,7 +1066,7 @@ static int nilfs_ioctl_trim_fs(struct inode *inode, void __user *argp)
1101
1066
* of segments in bytes and upper limit of segments in bytes.
1102
1067
* The NILFS_IOCTL_SET_ALLOC_RANGE is used by nilfs_resize utility.
1103
1068
*
1104
- * Return Value: On success, 0 is returned or error code, otherwise .
1069
+ * Return: 0 on success, or a negative error code on failure .
1105
1070
*/
1106
1071
static int nilfs_ioctl_set_alloc_range (struct inode * inode , void __user * argp )
1107
1072
{
@@ -1152,17 +1117,15 @@ static int nilfs_ioctl_set_alloc_range(struct inode *inode, void __user *argp)
1152
1117
* @dofunc: concrete function of getting metadata info
1153
1118
*
1154
1119
* 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.
1156
1122
*
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.
1166
1129
*/
1167
1130
static int nilfs_ioctl_get_info (struct inode * inode , struct file * filp ,
1168
1131
unsigned int cmd , void __user * argp ,
@@ -1202,18 +1165,14 @@ static int nilfs_ioctl_get_info(struct inode *inode, struct file *filp,
1202
1165
* encapsulated in nilfs_argv and updates the segment usage info
1203
1166
* according to the flags in nilfs_suinfo_update.
1204
1167
*
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.
1217
1176
*/
1218
1177
static int nilfs_ioctl_set_suinfo (struct inode * inode , struct file * filp ,
1219
1178
unsigned int cmd , void __user * argp )
0 commit comments