aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2016-09-03 08:30:51 +0000
committerAlexander Motin <mav@FreeBSD.org>2016-09-03 08:30:51 +0000
commitefa0867fb057f00d85a0c375a6624fb860493a1d (patch)
tree31e273b7e45f10101fe936341da7be9692195c5c /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c
parentc26e24432a505ecc5292898ef7a4815e2c00cb75 (diff)
parentfcc8f0a6e5ae08022367e6cee6f5826adb96d932 (diff)
downloadsrc-efa0867fb057f00d85a0c375a6624fb860493a1d.tar.gz
src-efa0867fb057f00d85a0c375a6624fb860493a1d.zip
MFV r302991: 6950 ARC should cache compressed data
illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2 https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2 https://www.illumos.org/issues/6950 When reading compressed data from disk, the ARC should keep the compressed block cached and only decompress it when consumers access the block. The uncompressed data should be short-lived allowing the ARC to cache a much larger amount of data. The DMU would also maintain a smaller cache of uncompressed blocks to minimize the impact of decompressing frequently accessed blocks. Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Don Brady <don.brady@intel.com> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: George Wilson <george.wilson@delphix.com>
Notes
Notes: svn path=/head/; revision=305323
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c
index ade681c1de8e..8f7914f87eb2 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c
@@ -231,4 +231,28 @@ refcount_transfer(refcount_t *dst, refcount_t *src)
list_destroy(&removed);
}
+void
+refcount_transfer_ownership(refcount_t *rc, void *current_holder,
+ void *new_holder)
+{
+ reference_t *ref;
+ boolean_t found = B_FALSE;
+
+ mutex_enter(&rc->rc_mtx);
+ if (!rc->rc_tracked) {
+ mutex_exit(&rc->rc_mtx);
+ return;
+ }
+
+ for (ref = list_head(&rc->rc_list); ref;
+ ref = list_next(&rc->rc_list, ref)) {
+ if (ref->ref_holder == current_holder) {
+ ref->ref_holder = new_holder;
+ found = B_TRUE;
+ break;
+ }
+ }
+ ASSERT(found);
+ mutex_exit(&rc->rc_mtx);
+}
#endif /* ZFS_DEBUG */