]> granicus.if.org Git - zfs/commitdiff
Illumos #3964 L2ARC should always compress metadata buffers
authorSaso Kiselkov <skiselkov@gmail.com>
Thu, 8 Aug 2013 20:33:18 +0000 (13:33 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 8 Aug 2013 20:37:00 +0000 (13:37 -0700)
3964 L2ARC should always compress metadata buffers
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>

References:
  https://www.illumos.org/issues/3964

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1379

include/sys/dbuf.h
include/sys/dmu.h
include/sys/dmu_objset.h

index 2fcf596b0009e161393b2b0d8e2cceeb5cf1b5d0..394fdfb151d7a379c059b3587b0dc2296cc8208b 100644 (file)
@@ -324,7 +324,8 @@ boolean_t dbuf_is_metadata(dmu_buf_impl_t *db);
        ((_db)->db_objset->os_secondary_cache == ZFS_CACHE_METADATA)))
 
 #define        DBUF_IS_L2COMPRESSIBLE(_db)                                     \
-       ((_db)->db_objset->os_compress != ZIO_COMPRESS_OFF)
+       ((_db)->db_objset->os_compress != ZIO_COMPRESS_OFF ||           \
+       (dbuf_is_metadata(_db) && zfs_mdcomp_disable == B_FALSE))
 
 #ifdef ZFS_DEBUG
 
index 17857255e311debe89fc869e7128b33e722405d7..adaab4c6bb61cdd6465ebef801186b81decb77e1 100644 (file)
@@ -828,6 +828,8 @@ int dmu_diff(objset_t *tosnap, objset_t *fromsnap, struct vnode *vp,
 #define        ZFS_CRC64_POLY  0xC96C5795D7870F42ULL   /* ECMA-182, reflected form */
 extern uint64_t zfs_crc64_table[256];
 
+extern int zfs_mdcomp_disable;
+
 #ifdef __cplusplus
 }
 #endif
index f4247442954f3dd9936ccc4ec38c2a1c24d7da03..507f73222895c362b151c53da8196dd59017670f 100644 (file)
@@ -130,7 +130,7 @@ struct objset {
        ((os)->os_secondary_cache == ZFS_CACHE_ALL ||           \
        (os)->os_secondary_cache == ZFS_CACHE_METADATA)
 
-#define        DMU_OS_IS_L2COMPRESSIBLE(os)    ((os)->os_compress != ZIO_COMPRESS_OFF)
+#define        DMU_OS_IS_L2COMPRESSIBLE(os)    (zfs_mdcomp_disable == B_FALSE)
 
 /* called from zpl */
 int dmu_objset_hold(const char *name, void *tag, objset_t **osp);