aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-06-25 00:58:08 -0400
committerDave Chinner <david@fromorbit.com>2014-06-25 00:58:08 -0400
commit2451337dd043901b5270b7586942abe564443e3d (patch)
tree5f2a59b2c829dbb942c18315ffc0edfed0d3790a /fs/xfs/xfs_dquot.c
parent30f712c9dd69348aa51351d5cb6d366bf4fae31d (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_dquot.c')
-rw-r--r--fs/xfs/xfs_dquot.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 3ee242686181..8a44a79f49af 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -327,7 +327,7 @@ xfs_qm_dqalloc(
327 */ 327 */
328 if (!xfs_this_quota_on(dqp->q_mount, dqp->dq_flags)) { 328 if (!xfs_this_quota_on(dqp->q_mount, dqp->dq_flags)) {
329 xfs_iunlock(quotip, XFS_ILOCK_EXCL); 329 xfs_iunlock(quotip, XFS_ILOCK_EXCL);
330 return ESRCH; 330 return -ESRCH;
331 } 331 }
332 332
333 xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL); 333 xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL);
@@ -354,7 +354,7 @@ xfs_qm_dqalloc(
354 mp->m_quotainfo->qi_dqchunklen, 354 mp->m_quotainfo->qi_dqchunklen,
355 0); 355 0);
356 if (!bp) { 356 if (!bp) {
357 error = ENOMEM; 357 error = -ENOMEM;
358 goto error1; 358 goto error1;
359 } 359 }
360 bp->b_ops = &xfs_dquot_buf_ops; 360 bp->b_ops = &xfs_dquot_buf_ops;
@@ -442,7 +442,7 @@ xfs_qm_dqrepair(
442 if (error) { 442 if (error) {
443 /* repair failed, we're screwed */ 443 /* repair failed, we're screwed */
444 xfs_trans_brelse(tp, *bpp); 444 xfs_trans_brelse(tp, *bpp);
445 return EIO; 445 return -EIO;
446 } 446 }
447 } 447 }
448 448
@@ -480,7 +480,7 @@ xfs_qm_dqtobp(
480 * didn't have the quota inode lock. 480 * didn't have the quota inode lock.
481 */ 481 */
482 xfs_iunlock(quotip, lock_mode); 482 xfs_iunlock(quotip, lock_mode);
483 return ESRCH; 483 return -ESRCH;
484 } 484 }
485 485
486 /* 486 /*
@@ -508,7 +508,7 @@ xfs_qm_dqtobp(
508 * We don't allocate unless we're asked to 508 * We don't allocate unless we're asked to
509 */ 509 */
510 if (!(flags & XFS_QMOPT_DQALLOC)) 510 if (!(flags & XFS_QMOPT_DQALLOC))
511 return ENOENT; 511 return -ENOENT;
512 512
513 ASSERT(tp); 513 ASSERT(tp);
514 error = xfs_qm_dqalloc(tpp, mp, dqp, quotip, 514 error = xfs_qm_dqalloc(tpp, mp, dqp, quotip,
@@ -530,7 +530,7 @@ xfs_qm_dqtobp(
530 mp->m_quotainfo->qi_dqchunklen, 530 mp->m_quotainfo->qi_dqchunklen,
531 0, &bp, &xfs_dquot_buf_ops); 531 0, &bp, &xfs_dquot_buf_ops);
532 532
533 if (error == EFSCORRUPTED && (flags & XFS_QMOPT_DQREPAIR)) { 533 if (error == -EFSCORRUPTED && (flags & XFS_QMOPT_DQREPAIR)) {
534 xfs_dqid_t firstid = (xfs_dqid_t)map.br_startoff * 534 xfs_dqid_t firstid = (xfs_dqid_t)map.br_startoff *
535 mp->m_quotainfo->qi_dqperchunk; 535 mp->m_quotainfo->qi_dqperchunk;
536 ASSERT(bp == NULL); 536 ASSERT(bp == NULL);
@@ -715,7 +715,7 @@ xfs_qm_dqget(
715 if ((! XFS_IS_UQUOTA_ON(mp) && type == XFS_DQ_USER) || 715 if ((! XFS_IS_UQUOTA_ON(mp) && type == XFS_DQ_USER) ||
716 (! XFS_IS_PQUOTA_ON(mp) && type == XFS_DQ_PROJ) || 716 (! XFS_IS_PQUOTA_ON(mp) && type == XFS_DQ_PROJ) ||
717 (! XFS_IS_GQUOTA_ON(mp) && type == XFS_DQ_GROUP)) { 717 (! XFS_IS_GQUOTA_ON(mp) && type == XFS_DQ_GROUP)) {
718 return ESRCH; 718 return -ESRCH;
719 } 719 }
720 720
721#ifdef DEBUG 721#ifdef DEBUG
@@ -723,7 +723,7 @@ xfs_qm_dqget(
723 if ((xfs_dqerror_target == mp->m_ddev_targp) && 723 if ((xfs_dqerror_target == mp->m_ddev_targp) &&
724 (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) { 724 (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) {
725 xfs_debug(mp, "Returning error in dqget"); 725 xfs_debug(mp, "Returning error in dqget");
726 return EIO; 726 return -EIO;
727 } 727 }
728 } 728 }
729 729
@@ -796,14 +796,14 @@ restart:
796 } else { 796 } else {
797 /* inode stays locked on return */ 797 /* inode stays locked on return */
798 xfs_qm_dqdestroy(dqp); 798 xfs_qm_dqdestroy(dqp);
799 return ESRCH; 799 return -ESRCH;
800 } 800 }
801 } 801 }
802 802
803 mutex_lock(&qi->qi_tree_lock); 803 mutex_lock(&qi->qi_tree_lock);
804 error = -radix_tree_insert(tree, id, dqp); 804 error = radix_tree_insert(tree, id, dqp);
805 if (unlikely(error)) { 805 if (unlikely(error)) {
806 WARN_ON(error != EEXIST); 806 WARN_ON(error != -EEXIST);
807 807
808 /* 808 /*
809 * Duplicate found. Just throw away the new dquot and start 809 * Duplicate found. Just throw away the new dquot and start
@@ -966,7 +966,7 @@ xfs_qm_dqflush(
966 SHUTDOWN_CORRUPT_INCORE); 966 SHUTDOWN_CORRUPT_INCORE);
967 else 967 else
968 spin_unlock(&mp->m_ail->xa_lock); 968 spin_unlock(&mp->m_ail->xa_lock);
969 error = EIO; 969 error = -EIO;
970 goto out_unlock; 970 goto out_unlock;
971 } 971 }
972 972
@@ -992,7 +992,7 @@ xfs_qm_dqflush(
992 xfs_buf_relse(bp); 992 xfs_buf_relse(bp);
993 xfs_dqfunlock(dqp); 993 xfs_dqfunlock(dqp);
994 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); 994 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
995 return EIO; 995 return -EIO;
996 } 996 }
997 997
998 /* This is the only portion of data that needs to persist */ 998 /* This is the only portion of data that needs to persist */
@@ -1045,7 +1045,7 @@ xfs_qm_dqflush(
1045 1045
1046out_unlock: 1046out_unlock:
1047 xfs_dqfunlock(dqp); 1047 xfs_dqfunlock(dqp);
1048 return EIO; 1048 return -EIO;
1049} 1049}
1050 1050
1051/* 1051/*