diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2014-06-22 01:04:54 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-22 01:04:54 -0400 |
commit | b474c7ae4395ba684e85fde8f55c8cf44a39afaf (patch) | |
tree | a7d3cad895a9e1f14894710b43e9ccbf634da3f1 /fs/xfs/xfs_fsops.c | |
parent | d99831ff393ff2e28d6110b41f24d9fecf986222 (diff) |
xfs: Nuke XFS_ERROR macro
XFS_ERROR was designed long ago to trap return values, but it's not
runtime configurable, it's not consistently used, and we can do
similar error trapping with ftrace scripts and triggers from
userspace.
Just nuke XFS_ERROR and associated bits.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@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 | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index d2295561570a..4334638b7b83 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 XFS_ERROR(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; |
@@ -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 XFS_ERROR(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; |
@@ -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 XFS_ERROR(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 XFS_ERROR(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 XFS_ERROR(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 XFS_ERROR(EPERM); | 607 | return EPERM; |
608 | if (!mutex_trylock(&mp->m_growlock)) | 608 | if (!mutex_trylock(&mp->m_growlock)) |
609 | return XFS_ERROR(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 XFS_ERROR(EPERM); | 623 | return EPERM; |
624 | if (!mutex_trylock(&mp->m_growlock)) | 624 | if (!mutex_trylock(&mp->m_growlock)) |
625 | return XFS_ERROR(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; |
@@ -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 XFS_ERROR(EINVAL); | 821 | return EINVAL; |
822 | } | 822 | } |
823 | 823 | ||
824 | return 0; | 824 | return 0; |