aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/arc.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2013-03-08 10:41:28 -0800
committerBrian Behlendorf <[email protected]>2013-10-31 14:58:04 -0700
commit2e528b49f8a0f8f2f51536a00fdf3ea9343bf302 (patch)
tree5c7c906ca4a8a6f52d6aafbf4eddefc8e872e42f /module/zfs/arc.c
parent7011fb6004b2227ff9e89894ed69ab83d36c1696 (diff)
Illumos #3598
3598 want to dtrace when errors are generated in zfs Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Christopher Siden <[email protected]> Approved by: Garrett D'Amore <[email protected]> References: https://www.illumos.org/issues/3598 illumos/illumos-gate@be6fd75a69ae679453d9cda5bff3326111e6d1ca Ported-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #1775 Porting notes: 1. include/sys/zfs_context.h has been modified to render some new macros inert until dtrace is available on Linux. 2. Linux-specific changes have been adapted to use SET_ERROR(). 3. I'm NOT happy about this change. It does nothing but ugly up the code under Linux. Unfortunately we need to take it to avoid more merge conflicts in the future. -Brian
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r--module/zfs/arc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 0cfcde7ac..a521501bd 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
@@ -3764,7 +3764,7 @@ arc_memory_throttle(uint64_t reserve, uint64_t inflight_data, uint64_t txg)
if (available_memory <= zfs_write_limit_max) {
ARCSTAT_INCR(arcstat_memory_throttle_count, 1);
DMU_TX_STAT_BUMP(dmu_tx_memory_reclaim);
- return (EAGAIN);
+ return (SET_ERROR(EAGAIN));
}
if (inflight_data > available_memory / 4) {
@@ -3802,7 +3802,7 @@ arc_tempreserve_space(uint64_t reserve, uint64_t txg)
arc_c = MIN(arc_c_max, reserve * 4);
if (reserve > arc_c) {
DMU_TX_STAT_BUMP(dmu_tx_memory_reserve);
- return (ENOMEM);
+ return (SET_ERROR(ENOMEM));
}
/*
@@ -3837,7 +3837,7 @@ arc_tempreserve_space(uint64_t reserve, uint64_t txg)
arc_anon->arcs_lsize[ARC_BUFC_DATA]>>10,
reserve>>10, arc_c>>10);
DMU_TX_STAT_BUMP(dmu_tx_dirty_throttle);
- return (ERESTART);
+ return (SET_ERROR(ERESTART));
}
atomic_add_64(&arc_tempreserve, reserve);
return (0);
@@ -3858,7 +3858,7 @@ arc_kstat_update(kstat_t *ksp, int rw)
arc_stats_t *as = ksp->ks_data;
if (rw == KSTAT_WRITE) {
- return (EACCES);
+ return (SET_ERROR(EACCES));
} else {
arc_kstat_update_state(arc_anon,
&as->arcstat_anon_size,
@@ -4530,7 +4530,7 @@ l2arc_read_done(zio_t *zio)
if (zio->io_error != 0) {
ARCSTAT_BUMP(arcstat_l2_io_error);
} else {
- zio->io_error = EIO;
+ zio->io_error = SET_ERROR(EIO);
}
if (!equal)
ARCSTAT_BUMP(arcstat_l2_cksum_bad);
@@ -5109,7 +5109,7 @@ l2arc_decompress_zio(zio_t *zio, arc_buf_hdr_t *hdr, enum zio_compress c)
bcopy(zio->io_data, cdata, csize);
if (zio_decompress_data(c, cdata, zio->io_data, csize,
hdr->b_size) != 0)
- zio->io_error = EIO;
+ zio->io_error = SET_ERROR(EIO);
zio_data_buf_free(cdata, csize);
}