aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans_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_trans_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_trans_buf.c')
-rw-r--r--fs/xfs/xfs_trans_buf.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 33bf55d7403a..96c898e7ac9a 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -266,7 +266,7 @@ xfs_trans_read_buf_map(
266 bp = xfs_buf_read_map(target, map, nmaps, flags, ops); 266 bp = xfs_buf_read_map(target, map, nmaps, flags, ops);
267 if (!bp) 267 if (!bp)
268 return (flags & XBF_TRYLOCK) ? 268 return (flags & XBF_TRYLOCK) ?
269 EAGAIN : ENOMEM; 269 -EAGAIN : -ENOMEM;
270 270
271 if (bp->b_error) { 271 if (bp->b_error) {
272 error = bp->b_error; 272 error = bp->b_error;
@@ -276,8 +276,8 @@ xfs_trans_read_buf_map(
276 xfs_buf_relse(bp); 276 xfs_buf_relse(bp);
277 277
278 /* bad CRC means corrupted metadata */ 278 /* bad CRC means corrupted metadata */
279 if (error == EFSBADCRC) 279 if (error == -EFSBADCRC)
280 error = EFSCORRUPTED; 280 error = -EFSCORRUPTED;
281 return error; 281 return error;
282 } 282 }
283#ifdef DEBUG 283#ifdef DEBUG
@@ -286,7 +286,7 @@ xfs_trans_read_buf_map(
286 if (((xfs_req_num++) % xfs_error_mod) == 0) { 286 if (((xfs_req_num++) % xfs_error_mod) == 0) {
287 xfs_buf_relse(bp); 287 xfs_buf_relse(bp);
288 xfs_debug(mp, "Returning error!"); 288 xfs_debug(mp, "Returning error!");
289 return EIO; 289 return -EIO;
290 } 290 }
291 } 291 }
292 } 292 }
@@ -342,8 +342,8 @@ xfs_trans_read_buf_map(
342 xfs_force_shutdown(tp->t_mountp, 342 xfs_force_shutdown(tp->t_mountp,
343 SHUTDOWN_META_IO_ERROR); 343 SHUTDOWN_META_IO_ERROR);
344 /* bad CRC means corrupted metadata */ 344 /* bad CRC means corrupted metadata */
345 if (error == EFSBADCRC) 345 if (error == -EFSBADCRC)
346 error = EFSCORRUPTED; 346 error = -EFSCORRUPTED;
347 return error; 347 return error;
348 } 348 }
349 } 349 }
@@ -354,7 +354,7 @@ xfs_trans_read_buf_map(
354 if (XFS_FORCED_SHUTDOWN(mp)) { 354 if (XFS_FORCED_SHUTDOWN(mp)) {
355 trace_xfs_trans_read_buf_shut(bp, _RET_IP_); 355 trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
356 *bpp = NULL; 356 *bpp = NULL;
357 return EIO; 357 return -EIO;
358 } 358 }
359 359
360 360
@@ -371,7 +371,7 @@ xfs_trans_read_buf_map(
371 if (bp == NULL) { 371 if (bp == NULL) {
372 *bpp = NULL; 372 *bpp = NULL;
373 return (flags & XBF_TRYLOCK) ? 373 return (flags & XBF_TRYLOCK) ?
374 0 : ENOMEM; 374 0 : -ENOMEM;
375 } 375 }
376 if (bp->b_error) { 376 if (bp->b_error) {
377 error = bp->b_error; 377 error = bp->b_error;
@@ -383,8 +383,8 @@ xfs_trans_read_buf_map(
383 xfs_buf_relse(bp); 383 xfs_buf_relse(bp);
384 384
385 /* bad CRC means corrupted metadata */ 385 /* bad CRC means corrupted metadata */
386 if (error == EFSBADCRC) 386 if (error == -EFSBADCRC)
387 error = EFSCORRUPTED; 387 error = -EFSCORRUPTED;
388 return error; 388 return error;
389 } 389 }
390#ifdef DEBUG 390#ifdef DEBUG
@@ -395,7 +395,7 @@ xfs_trans_read_buf_map(
395 SHUTDOWN_META_IO_ERROR); 395 SHUTDOWN_META_IO_ERROR);
396 xfs_buf_relse(bp); 396 xfs_buf_relse(bp);
397 xfs_debug(mp, "Returning trans error!"); 397 xfs_debug(mp, "Returning trans error!");
398 return EIO; 398 return -EIO;
399 } 399 }
400 } 400 }
401 } 401 }
@@ -413,7 +413,7 @@ shutdown_abort:
413 trace_xfs_trans_read_buf_shut(bp, _RET_IP_); 413 trace_xfs_trans_read_buf_shut(bp, _RET_IP_);
414 xfs_buf_relse(bp); 414 xfs_buf_relse(bp);
415 *bpp = NULL; 415 *bpp = NULL;
416 return EIO; 416 return -EIO;
417} 417}
418 418
419/* 419/*