Skip to content

Commit

Permalink
3964 L2ARC should always compress metadata buffers
Browse files Browse the repository at this point in the history
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Elling <richard.elling@gmail.com>
Approved by: Dan McDonald <danmcd@nexenta.com>
  • Loading branch information
Saso Kiselkov authored and Dan McDonald committed Oct 14, 2013
1 parent 4f9a636 commit e4be62a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion usr/src/uts/common/fs/zfs/sys/dbuf.h
Expand Up @@ -329,7 +329,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

Expand Down
3 changes: 3 additions & 0 deletions usr/src/uts/common/fs/zfs/sys/dmu.h
Expand Up @@ -24,6 +24,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright 2013 DEY Storage Systems, Inc.
*/

/* Portions Copyright 2010 Robert Milkowski */
Expand Down Expand Up @@ -806,6 +807,8 @@ int dmu_diff(const char *tosnap_name, const char *fromsnap_name,
#define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */
extern uint64_t zfs_crc64_table[256];

extern int zfs_mdcomp_disable;

#ifdef __cplusplus
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion usr/src/uts/common/fs/zfs/sys/dmu_objset.h
Expand Up @@ -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);
Expand Down

0 comments on commit e4be62a

Please sign in to comment.