diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-06-25 00:58:08 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-25 00:58:08 -0400 |
commit | 2451337dd043901b5270b7586942abe564443e3d (patch) | |
tree | 5f2a59b2c829dbb942c18315ffc0edfed0d3790a /fs/xfs/xfs_fsops.c | |
parent | 30f712c9dd69348aa51351d5cb6d366bf4fae31d (diff) |
xfs: global error sign conversion
Convert all the errors the core XFs code to negative error signs
like the rest of the kernel and remove all the sign conversion we
do in the interface layers.
Errors for conversion (and comparison) found via searches like:
$ git grep " E" fs/xfs
$ git grep "return E" fs/xfs
$ git grep " E[A-Z].*;$" fs/xfs
Negation points found via searches like:
$ git grep "= -[a-z,A-Z]" fs/xfs
$ git grep "return -[a-z,A-D,F-Z]" fs/xfs
$ git grep " -[a-z].*;" fs/xfs
[ with some bits I missed from Brian Foster ]
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r-- | fs/xfs/xfs_fsops.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 4334638b7b83..f91de1ef05e1 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
@@ -168,7 +168,7 @@ xfs_growfs_data_private( | |||
168 | nb = in->newblocks; | 168 | nb = in->newblocks; |
169 | pct = in->imaxpct; | 169 | pct = in->imaxpct; |
170 | if (nb < mp->m_sb.sb_dblocks || pct < 0 || pct > 100) | 170 | if (nb < mp->m_sb.sb_dblocks || pct < 0 || pct > 100) |
171 | return EINVAL; | 171 | return -EINVAL; |
172 | if ((error = xfs_sb_validate_fsb_count(&mp->m_sb, nb))) | 172 | if ((error = xfs_sb_validate_fsb_count(&mp->m_sb, nb))) |
173 | return error; | 173 | return error; |
174 | dpct = pct - mp->m_sb.sb_imax_pct; | 174 | dpct = pct - mp->m_sb.sb_imax_pct; |
@@ -176,7 +176,7 @@ xfs_growfs_data_private( | |||
176 | XFS_FSB_TO_BB(mp, nb) - XFS_FSS_TO_BB(mp, 1), | 176 | XFS_FSB_TO_BB(mp, nb) - XFS_FSS_TO_BB(mp, 1), |
177 | XFS_FSS_TO_BB(mp, 1), 0, NULL); | 177 | XFS_FSS_TO_BB(mp, 1), 0, NULL); |
178 | if (!bp) | 178 | if (!bp) |
179 | return EIO; | 179 | return -EIO; |
180 | if (bp->b_error) { | 180 | if (bp->b_error) { |
181 | error = bp->b_error; | 181 | error = bp->b_error; |
182 | xfs_buf_relse(bp); | 182 | xfs_buf_relse(bp); |
@@ -191,7 +191,7 @@ xfs_growfs_data_private( | |||
191 | nagcount--; | 191 | nagcount--; |
192 | nb = (xfs_rfsblock_t)nagcount * mp->m_sb.sb_agblocks; | 192 | nb = (xfs_rfsblock_t)nagcount * mp->m_sb.sb_agblocks; |
193 | if (nb < mp->m_sb.sb_dblocks) | 193 | if (nb < mp->m_sb.sb_dblocks) |
194 | return EINVAL; | 194 | return -EINVAL; |
195 | } | 195 | } |
196 | new = nb - mp->m_sb.sb_dblocks; | 196 | new = nb - mp->m_sb.sb_dblocks; |
197 | oagcount = mp->m_sb.sb_agcount; | 197 | oagcount = mp->m_sb.sb_agcount; |
@@ -229,7 +229,7 @@ xfs_growfs_data_private( | |||
229 | XFS_FSS_TO_BB(mp, 1), 0, | 229 | XFS_FSS_TO_BB(mp, 1), 0, |
230 | &xfs_agf_buf_ops); | 230 | &xfs_agf_buf_ops); |
231 | if (!bp) { | 231 | if (!bp) { |
232 | error = ENOMEM; | 232 | error = -ENOMEM; |
233 | goto error0; | 233 | goto error0; |
234 | } | 234 | } |
235 | 235 | ||
@@ -270,7 +270,7 @@ xfs_growfs_data_private( | |||
270 | XFS_FSS_TO_BB(mp, 1), 0, | 270 | XFS_FSS_TO_BB(mp, 1), 0, |
271 | &xfs_agfl_buf_ops); | 271 | &xfs_agfl_buf_ops); |
272 | if (!bp) { | 272 | if (!bp) { |
273 | error = ENOMEM; | 273 | error = -ENOMEM; |
274 | goto error0; | 274 | goto error0; |
275 | } | 275 | } |
276 | 276 | ||
@@ -298,7 +298,7 @@ xfs_growfs_data_private( | |||
298 | XFS_FSS_TO_BB(mp, 1), 0, | 298 | XFS_FSS_TO_BB(mp, 1), 0, |
299 | &xfs_agi_buf_ops); | 299 | &xfs_agi_buf_ops); |
300 | if (!bp) { | 300 | if (!bp) { |
301 | error = ENOMEM; | 301 | error = -ENOMEM; |
302 | goto error0; | 302 | goto error0; |
303 | } | 303 | } |
304 | 304 | ||
@@ -336,7 +336,7 @@ xfs_growfs_data_private( | |||
336 | &xfs_allocbt_buf_ops); | 336 | &xfs_allocbt_buf_ops); |
337 | 337 | ||
338 | if (!bp) { | 338 | if (!bp) { |
339 | error = ENOMEM; | 339 | error = -ENOMEM; |
340 | goto error0; | 340 | goto error0; |
341 | } | 341 | } |
342 | 342 | ||
@@ -365,7 +365,7 @@ xfs_growfs_data_private( | |||
365 | BTOBB(mp->m_sb.sb_blocksize), 0, | 365 | BTOBB(mp->m_sb.sb_blocksize), 0, |
366 | &xfs_allocbt_buf_ops); | 366 | &xfs_allocbt_buf_ops); |
367 | if (!bp) { | 367 | if (!bp) { |
368 | error = ENOMEM; | 368 | error = -ENOMEM; |
369 | goto error0; | 369 | goto error0; |
370 | } | 370 | } |
371 | 371 | ||
@@ -395,7 +395,7 @@ xfs_growfs_data_private( | |||
395 | BTOBB(mp->m_sb.sb_blocksize), 0, | 395 | BTOBB(mp->m_sb.sb_blocksize), 0, |
396 | &xfs_inobt_buf_ops); | 396 | &xfs_inobt_buf_ops); |
397 | if (!bp) { | 397 | if (!bp) { |
398 | error = ENOMEM; | 398 | error = -ENOMEM; |
399 | goto error0; | 399 | goto error0; |
400 | } | 400 | } |
401 | 401 | ||
@@ -420,7 +420,7 @@ xfs_growfs_data_private( | |||
420 | BTOBB(mp->m_sb.sb_blocksize), 0, | 420 | BTOBB(mp->m_sb.sb_blocksize), 0, |
421 | &xfs_inobt_buf_ops); | 421 | &xfs_inobt_buf_ops); |
422 | if (!bp) { | 422 | if (!bp) { |
423 | error = ENOMEM; | 423 | error = -ENOMEM; |
424 | goto error0; | 424 | goto error0; |
425 | } | 425 | } |
426 | 426 | ||
@@ -531,7 +531,7 @@ xfs_growfs_data_private( | |||
531 | bp->b_ops = &xfs_sb_buf_ops; | 531 | bp->b_ops = &xfs_sb_buf_ops; |
532 | xfs_buf_zero(bp, 0, BBTOB(bp->b_length)); | 532 | xfs_buf_zero(bp, 0, BBTOB(bp->b_length)); |
533 | } else | 533 | } else |
534 | error = ENOMEM; | 534 | error = -ENOMEM; |
535 | } | 535 | } |
536 | 536 | ||
537 | /* | 537 | /* |
@@ -576,17 +576,17 @@ xfs_growfs_log_private( | |||
576 | 576 | ||
577 | nb = in->newblocks; | 577 | nb = in->newblocks; |
578 | if (nb < XFS_MIN_LOG_BLOCKS || nb < XFS_B_TO_FSB(mp, XFS_MIN_LOG_BYTES)) | 578 | if (nb < XFS_MIN_LOG_BLOCKS || nb < XFS_B_TO_FSB(mp, XFS_MIN_LOG_BYTES)) |
579 | return EINVAL; | 579 | return -EINVAL; |
580 | if (nb == mp->m_sb.sb_logblocks && | 580 | if (nb == mp->m_sb.sb_logblocks && |
581 | in->isint == (mp->m_sb.sb_logstart != 0)) | 581 | in->isint == (mp->m_sb.sb_logstart != 0)) |
582 | return EINVAL; | 582 | return -EINVAL; |
583 | /* | 583 | /* |
584 | * Moving the log is hard, need new interfaces to sync | 584 | * Moving the log is hard, need new interfaces to sync |
585 | * the log first, hold off all activity while moving it. | 585 | * the log first, hold off all activity while moving it. |
586 | * Can have shorter or longer log in the same space, | 586 | * Can have shorter or longer log in the same space, |
587 | * or transform internal to external log or vice versa. | 587 | * or transform internal to external log or vice versa. |
588 | */ | 588 | */ |
589 | return ENOSYS; | 589 | return -ENOSYS; |
590 | } | 590 | } |
591 | 591 | ||
592 | /* | 592 | /* |
@@ -604,9 +604,9 @@ xfs_growfs_data( | |||
604 | int error; | 604 | int error; |
605 | 605 | ||
606 | if (!capable(CAP_SYS_ADMIN)) | 606 | if (!capable(CAP_SYS_ADMIN)) |
607 | return EPERM; | 607 | return -EPERM; |
608 | if (!mutex_trylock(&mp->m_growlock)) | 608 | if (!mutex_trylock(&mp->m_growlock)) |
609 | return EWOULDBLOCK; | 609 | return -EWOULDBLOCK; |
610 | error = xfs_growfs_data_private(mp, in); | 610 | error = xfs_growfs_data_private(mp, in); |
611 | mutex_unlock(&mp->m_growlock); | 611 | mutex_unlock(&mp->m_growlock); |
612 | return error; | 612 | return error; |
@@ -620,9 +620,9 @@ xfs_growfs_log( | |||
620 | int error; | 620 | int error; |
621 | 621 | ||
622 | if (!capable(CAP_SYS_ADMIN)) | 622 | if (!capable(CAP_SYS_ADMIN)) |
623 | return EPERM; | 623 | return -EPERM; |
624 | if (!mutex_trylock(&mp->m_growlock)) | 624 | if (!mutex_trylock(&mp->m_growlock)) |
625 | return EWOULDBLOCK; | 625 | return -EWOULDBLOCK; |
626 | error = xfs_growfs_log_private(mp, in); | 626 | error = xfs_growfs_log_private(mp, in); |
627 | mutex_unlock(&mp->m_growlock); | 627 | mutex_unlock(&mp->m_growlock); |
628 | return error; | 628 | return error; |
@@ -674,7 +674,7 @@ xfs_reserve_blocks( | |||
674 | /* If inval is null, report current values and return */ | 674 | /* If inval is null, report current values and return */ |
675 | if (inval == (__uint64_t *)NULL) { | 675 | if (inval == (__uint64_t *)NULL) { |
676 | if (!outval) | 676 | if (!outval) |
677 | return EINVAL; | 677 | return -EINVAL; |
678 | outval->resblks = mp->m_resblks; | 678 | outval->resblks = mp->m_resblks; |
679 | outval->resblks_avail = mp->m_resblks_avail; | 679 | outval->resblks_avail = mp->m_resblks_avail; |
680 | return 0; | 680 | return 0; |
@@ -757,7 +757,7 @@ out: | |||
757 | int error; | 757 | int error; |
758 | error = xfs_icsb_modify_counters(mp, XFS_SBS_FDBLOCKS, | 758 | error = xfs_icsb_modify_counters(mp, XFS_SBS_FDBLOCKS, |
759 | fdblks_delta, 0); | 759 | fdblks_delta, 0); |
760 | if (error == ENOSPC) | 760 | if (error == -ENOSPC) |
761 | goto retry; | 761 | goto retry; |
762 | } | 762 | } |
763 | return 0; | 763 | return 0; |
@@ -818,7 +818,7 @@ xfs_fs_goingdown( | |||
818 | SHUTDOWN_FORCE_UMOUNT | SHUTDOWN_LOG_IO_ERROR); | 818 | SHUTDOWN_FORCE_UMOUNT | SHUTDOWN_LOG_IO_ERROR); |
819 | break; | 819 | break; |
820 | default: | 820 | default: |
821 | return EINVAL; | 821 | return -EINVAL; |
822 | } | 822 | } |
823 | 823 | ||
824 | return 0; | 824 | return 0; |