Print this page
3756 want lz4 support for metadata compression


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2012 by Delphix. All rights reserved.
  25  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  26  * Copyright (c) 2012, Joyent, Inc. All rights reserved.

  27  */
  28 
  29 /* Portions Copyright 2010 Robert Milkowski */
  30 
  31 #ifndef _SYS_DMU_H
  32 #define _SYS_DMU_H
  33 
  34 /*
  35  * This file describes the interface that the DMU provides for its
  36  * consumers.
  37  *
  38  * The DMU also interacts with the SPA.  That interface is described in
  39  * dmu_spa.h.
  40  */
  41 
  42 #include <sys/inttypes.h>
  43 #include <sys/types.h>
  44 #include <sys/param.h>
  45 #include <sys/cred.h>
  46 #include <sys/time.h>


 382  * apply to all newly written blocks; existing blocks will not be affected.
 383  */
 384 void dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum,
 385     dmu_tx_t *tx);
 386 
 387 /*
 388  * Set the compress property on a dnode.  The new compression algorithm will
 389  * apply to all newly written blocks; existing blocks will not be affected.
 390  */
 391 void dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress,
 392     dmu_tx_t *tx);
 393 
 394 /*
 395  * Decide how to write a block: checksum, compression, number of copies, etc.
 396  */
 397 #define WP_NOFILL       0x1
 398 #define WP_DMU_SYNC     0x2
 399 #define WP_SPILL        0x4
 400 
 401 void dmu_write_policy(objset_t *os, struct dnode *dn, int level, int wp,
 402     struct zio_prop *zp);
 403 /*
 404  * The bonus data is accessed more or less like a regular buffer.
 405  * You must dmu_bonus_hold() to get the buffer, which will give you a
 406  * dmu_buf_t with db_offset==-1ULL, and db_size = the size of the bonus
 407  * data.  As with any normal buffer, you must call dmu_buf_read() to
 408  * read db_data, dmu_buf_will_dirty() before modifying it, and the
 409  * object must be held in an assigned transaction before calling
 410  * dmu_buf_will_dirty.  You may use dmu_buf_set_user() on the bonus
 411  * buffer as well.  You must release your hold with dmu_buf_rele().
 412  */
 413 int dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **);
 414 int dmu_bonus_max(void);
 415 int dmu_set_bonus(dmu_buf_t *, int, dmu_tx_t *);
 416 int dmu_set_bonustype(dmu_buf_t *, dmu_object_type_t, dmu_tx_t *);
 417 dmu_object_type_t dmu_get_bonustype(dmu_buf_t *);
 418 int dmu_rm_spill(objset_t *, uint64_t, dmu_tx_t *);
 419 
 420 /*
 421  * Special spill buffer support used by "SA" framework
 422  */




   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2012 by Delphix. All rights reserved.
  25  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  26  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  27  * Copyright (c) 2013 Martin Matuska. All rights reserved.
  28  */
  29 
  30 /* Portions Copyright 2010 Robert Milkowski */
  31 
  32 #ifndef _SYS_DMU_H
  33 #define _SYS_DMU_H
  34 
  35 /*
  36  * This file describes the interface that the DMU provides for its
  37  * consumers.
  38  *
  39  * The DMU also interacts with the SPA.  That interface is described in
  40  * dmu_spa.h.
  41  */
  42 
  43 #include <sys/inttypes.h>
  44 #include <sys/types.h>
  45 #include <sys/param.h>
  46 #include <sys/cred.h>
  47 #include <sys/time.h>


 383  * apply to all newly written blocks; existing blocks will not be affected.
 384  */
 385 void dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum,
 386     dmu_tx_t *tx);
 387 
 388 /*
 389  * Set the compress property on a dnode.  The new compression algorithm will
 390  * apply to all newly written blocks; existing blocks will not be affected.
 391  */
 392 void dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress,
 393     dmu_tx_t *tx);
 394 
 395 /*
 396  * Decide how to write a block: checksum, compression, number of copies, etc.
 397  */
 398 #define WP_NOFILL       0x1
 399 #define WP_DMU_SYNC     0x2
 400 #define WP_SPILL        0x4
 401 
 402 void dmu_write_policy(objset_t *os, struct dnode *dn, int level, int wp,
 403     struct zio_prop *zp, uint64_t txg);
 404 /*
 405  * The bonus data is accessed more or less like a regular buffer.
 406  * You must dmu_bonus_hold() to get the buffer, which will give you a
 407  * dmu_buf_t with db_offset==-1ULL, and db_size = the size of the bonus
 408  * data.  As with any normal buffer, you must call dmu_buf_read() to
 409  * read db_data, dmu_buf_will_dirty() before modifying it, and the
 410  * object must be held in an assigned transaction before calling
 411  * dmu_buf_will_dirty.  You may use dmu_buf_set_user() on the bonus
 412  * buffer as well.  You must release your hold with dmu_buf_rele().
 413  */
 414 int dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **);
 415 int dmu_bonus_max(void);
 416 int dmu_set_bonus(dmu_buf_t *, int, dmu_tx_t *);
 417 int dmu_set_bonustype(dmu_buf_t *, dmu_object_type_t, dmu_tx_t *);
 418 dmu_object_type_t dmu_get_bonustype(dmu_buf_t *);
 419 int dmu_rm_spill(objset_t *, uint64_t, dmu_tx_t *);
 420 
 421 /*
 422  * Special spill buffer support used by "SA" framework
 423  */