aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.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_buf.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_buf.c')
-rw-r--r--fs/xfs/xfs_buf.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 7a34a1ae6552..a6dc83e70ece 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -130,7 +130,7 @@ xfs_buf_get_maps(
130 bp->b_maps = kmem_zalloc(map_count * sizeof(struct xfs_buf_map), 130 bp->b_maps = kmem_zalloc(map_count * sizeof(struct xfs_buf_map),
131 KM_NOFS); 131 KM_NOFS);
132 if (!bp->b_maps) 132 if (!bp->b_maps)
133 return ENOMEM; 133 return -ENOMEM;
134 return 0; 134 return 0;
135} 135}
136 136
@@ -344,7 +344,7 @@ retry:
344 if (unlikely(page == NULL)) { 344 if (unlikely(page == NULL)) {
345 if (flags & XBF_READ_AHEAD) { 345 if (flags & XBF_READ_AHEAD) {
346 bp->b_page_count = i; 346 bp->b_page_count = i;
347 error = ENOMEM; 347 error = -ENOMEM;
348 goto out_free_pages; 348 goto out_free_pages;
349 } 349 }
350 350
@@ -465,7 +465,7 @@ _xfs_buf_find(
465 eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks); 465 eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks);
466 if (blkno >= eofs) { 466 if (blkno >= eofs) {
467 /* 467 /*
468 * XXX (dgc): we should really be returning EFSCORRUPTED here, 468 * XXX (dgc): we should really be returning -EFSCORRUPTED here,
469 * but none of the higher level infrastructure supports 469 * but none of the higher level infrastructure supports
470 * returning a specific error on buffer lookup failures. 470 * returning a specific error on buffer lookup failures.
471 */ 471 */
@@ -1052,8 +1052,8 @@ xfs_buf_ioerror(
1052 xfs_buf_t *bp, 1052 xfs_buf_t *bp,
1053 int error) 1053 int error)
1054{ 1054{
1055 ASSERT(error >= 0 && error <= 0xffff); 1055 ASSERT(error <= 0 && error >= -1000);
1056 bp->b_error = (unsigned short)error; 1056 bp->b_error = error;
1057 trace_xfs_buf_ioerror(bp, error, _RET_IP_); 1057 trace_xfs_buf_ioerror(bp, error, _RET_IP_);
1058} 1058}
1059 1059
@@ -1064,7 +1064,7 @@ xfs_buf_ioerror_alert(
1064{ 1064{
1065 xfs_alert(bp->b_target->bt_mount, 1065 xfs_alert(bp->b_target->bt_mount,
1066"metadata I/O error: block 0x%llx (\"%s\") error %d numblks %d", 1066"metadata I/O error: block 0x%llx (\"%s\") error %d numblks %d",
1067 (__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length); 1067 (__uint64_t)XFS_BUF_ADDR(bp), func, -bp->b_error, bp->b_length);
1068} 1068}
1069 1069
1070/* 1070/*
@@ -1083,7 +1083,7 @@ xfs_bioerror(
1083 /* 1083 /*
1084 * No need to wait until the buffer is unpinned, we aren't flushing it. 1084 * No need to wait until the buffer is unpinned, we aren't flushing it.
1085 */ 1085 */
1086 xfs_buf_ioerror(bp, EIO); 1086 xfs_buf_ioerror(bp, -EIO);
1087 1087
1088 /* 1088 /*
1089 * We're calling xfs_buf_ioend, so delete XBF_DONE flag. 1089 * We're calling xfs_buf_ioend, so delete XBF_DONE flag.
@@ -1094,7 +1094,7 @@ xfs_bioerror(
1094 1094
1095 xfs_buf_ioend(bp, 0); 1095 xfs_buf_ioend(bp, 0);
1096 1096
1097 return EIO; 1097 return -EIO;
1098} 1098}
1099 1099
1100/* 1100/*
@@ -1127,13 +1127,13 @@ xfs_bioerror_relse(
1127 * There's no reason to mark error for 1127 * There's no reason to mark error for
1128 * ASYNC buffers. 1128 * ASYNC buffers.
1129 */ 1129 */
1130 xfs_buf_ioerror(bp, EIO); 1130 xfs_buf_ioerror(bp, -EIO);
1131 complete(&bp->b_iowait); 1131 complete(&bp->b_iowait);
1132 } else { 1132 } else {
1133 xfs_buf_relse(bp); 1133 xfs_buf_relse(bp);
1134 } 1134 }
1135 1135
1136 return EIO; 1136 return -EIO;
1137} 1137}
1138 1138
1139STATIC int 1139STATIC int
@@ -1199,7 +1199,7 @@ xfs_buf_bio_end_io(
1199 * buffers that require multiple bios to complete. 1199 * buffers that require multiple bios to complete.
1200 */ 1200 */
1201 if (!bp->b_error) 1201 if (!bp->b_error)
1202 xfs_buf_ioerror(bp, -error); 1202 xfs_buf_ioerror(bp, error);
1203 1203
1204 if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ)) 1204 if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ))
1205 invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp)); 1205 invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp));
@@ -1286,7 +1286,7 @@ next_chunk:
1286 * because the caller (xfs_buf_iorequest) holds a count itself. 1286 * because the caller (xfs_buf_iorequest) holds a count itself.
1287 */ 1287 */
1288 atomic_dec(&bp->b_io_remaining); 1288 atomic_dec(&bp->b_io_remaining);
1289 xfs_buf_ioerror(bp, EIO); 1289 xfs_buf_ioerror(bp, -EIO);
1290 bio_put(bio); 1290 bio_put(bio);
1291 } 1291 }
1292 1292
@@ -1628,7 +1628,7 @@ xfs_setsize_buftarg(
1628 xfs_warn(btp->bt_mount, 1628 xfs_warn(btp->bt_mount,
1629 "Cannot set_blocksize to %u on device %s", 1629 "Cannot set_blocksize to %u on device %s",
1630 sectorsize, name); 1630 sectorsize, name);
1631 return EINVAL; 1631 return -EINVAL;
1632 } 1632 }
1633 1633
1634 /* Set up device logical sector size mask */ 1634 /* Set up device logical sector size mask */