FreeBSD ZFS
The Zettabyte File System
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

sys/ddt.h File Reference

#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/fs/zfs.h>
#include <sys/zio.h>
#include <sys/dmu.h>
Include dependency graph for ddt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ddt_key
 On-disk ddt entry: key (name) and physical storage (value). More...
struct  ddt_phys
struct  ddt_entry
 In-core ddt entry. More...
struct  ddt
 In-core ddt. More...
struct  ddt_bookmark
 In-core and on-disk bookmark for DDT walks. More...
struct  ddt_ops
 Ops vector to access a specific DDT object type. More...

Defines

#define DDT_TYPE_CURRENT   0
#define DDT_COMPRESS_BYTEORDER_MASK   0x80
#define DDT_COMPRESS_FUNCTION_MASK   0x7f
#define DDK_GET_LSIZE(ddk)   BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1)
#define DDK_SET_LSIZE(ddk, x)   BF64_SET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1, x)
#define DDK_GET_PSIZE(ddk)   BF64_GET_SB((ddk)->ddk_prop, 16, 16, SPA_MINBLOCKSHIFT, 1)
#define DDK_SET_PSIZE(ddk, x)   BF64_SET_SB((ddk)->ddk_prop, 16, 16, SPA_MINBLOCKSHIFT, 1, x)
#define DDK_GET_COMPRESS(ddk)   BF64_GET((ddk)->ddk_prop, 32, 8)
#define DDK_SET_COMPRESS(ddk, x)   BF64_SET((ddk)->ddk_prop, 32, 8, x)
#define DDT_KEY_WORDS   (sizeof (ddt_key_t) / sizeof (uint64_t))
#define DDT_NAMELEN   80

Typedefs

typedef struct ddt_key ddt_key_t
 On-disk ddt entry: key (name) and physical storage (value).
typedef struct ddt_phys ddt_phys_t
typedef struct ddt_bookmark ddt_bookmark_t
 In-core and on-disk bookmark for DDT walks.
typedef struct ddt_ops ddt_ops_t
 Ops vector to access a specific DDT object type.

Enumerations

enum  ddt_type { DDT_TYPE_ZAP = 0, DDT_TYPES }
 

On-disk DDT formats, in the desired search order (newest version first).

More...
enum  ddt_class { DDT_CLASS_DITTO = 0, DDT_CLASS_DUPLICATE, DDT_CLASS_UNIQUE, DDT_CLASSES }
 

DDT classes, in the desired search order (highest replication level first).

More...
enum  ddt_phys_type {
  DDT_PHYS_DITTO = 0, DDT_PHYS_SINGLE = 1, DDT_PHYS_DOUBLE = 2, DDT_PHYS_TRIPLE = 3,
  DDT_PHYS_TYPES
}

Functions

void ddt_object_name (ddt_t *ddt, enum ddt_type type, enum ddt_class cls, char *name)
int ddt_object_walk (ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde)
uint64_t ddt_object_count (ddt_t *ddt, enum ddt_type type, enum ddt_class cls)
int ddt_object_info (ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *)
boolean_t ddt_object_exists (ddt_t *ddt, enum ddt_type type, enum ddt_class cls)
void ddt_bp_fill (const ddt_phys_t *ddp, blkptr_t *bp, uint64_t txg)
void ddt_bp_create (enum zio_checksum checksum, const ddt_key_t *ddk, const ddt_phys_t *ddp, blkptr_t *bp)
void ddt_key_fill (ddt_key_t *ddk, const blkptr_t *bp)
void ddt_phys_fill (ddt_phys_t *ddp, const blkptr_t *bp)
void ddt_phys_clear (ddt_phys_t *ddp)
void ddt_phys_addref (ddt_phys_t *ddp)
void ddt_phys_decref (ddt_phys_t *ddp)
void ddt_phys_free (ddt_t *ddt, ddt_key_t *ddk, ddt_phys_t *ddp, uint64_t txg)
ddt_phys_tddt_phys_select (const ddt_entry_t *dde, const blkptr_t *bp)
uint64_t ddt_phys_total_refcnt (const ddt_entry_t *dde)
void ddt_stat_add (ddt_stat_t *dst, const ddt_stat_t *src, uint64_t neg)
void ddt_histogram_add (ddt_histogram_t *dst, const ddt_histogram_t *src)
void ddt_histogram_stat (ddt_stat_t *dds, const ddt_histogram_t *ddh)
boolean_t ddt_histogram_empty (const ddt_histogram_t *ddh)
void ddt_get_dedup_object_stats (spa_t *spa, ddt_object_t *ddo)
void ddt_get_dedup_histogram (spa_t *spa, ddt_histogram_t *ddh)
void ddt_get_dedup_stats (spa_t *spa, ddt_stat_t *dds_total)
uint64_t ddt_get_dedup_dspace (spa_t *spa)
uint64_t ddt_get_pool_dedup_ratio (spa_t *spa)
int ddt_ditto_copies_needed (ddt_t *ddt, ddt_entry_t *dde, ddt_phys_t *ddp_willref)
int ddt_ditto_copies_present (ddt_entry_t *dde)
size_t ddt_compress (void *src, uchar_t *dst, size_t s_len, size_t d_len)
void ddt_decompress (uchar_t *src, void *dst, size_t s_len, size_t d_len)
ddt_tddt_select (spa_t *spa, const blkptr_t *bp)
void ddt_enter (ddt_t *ddt)
void ddt_exit (ddt_t *ddt)
ddt_entry_tddt_lookup (ddt_t *ddt, const blkptr_t *bp, boolean_t add)
void ddt_prefetch (spa_t *spa, const blkptr_t *bp)
void ddt_remove (ddt_t *ddt, ddt_entry_t *dde)
boolean_t ddt_class_contains (spa_t *spa, enum ddt_class max_class, const blkptr_t *bp)
ddt_entry_tddt_repair_start (ddt_t *ddt, const blkptr_t *bp)
void ddt_repair_done (ddt_t *ddt, ddt_entry_t *dde)
int ddt_entry_compare (const void *x1, const void *x2)
void ddt_create (spa_t *spa)
int ddt_load (spa_t *spa)
void ddt_unload (spa_t *spa)
void ddt_sync (spa_t *spa, uint64_t txg)
int ddt_walk (spa_t *spa, ddt_bookmark_t *ddb, ddt_entry_t *dde)
int ddt_object_update (ddt_t *ddt, enum ddt_type type, enum ddt_class cls, ddt_entry_t *dde, dmu_tx_t *tx)

Variables

const ddt_ops_t ddt_zap_ops

Define Documentation

#define DDK_GET_COMPRESS (   ddk)    BF64_GET((ddk)->ddk_prop, 32, 8)

Definition at line 89 of file ddt.h.

#define DDK_GET_LSIZE (   ddk)    BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1)

Definition at line 79 of file ddt.h.

#define DDK_GET_PSIZE (   ddk)    BF64_GET_SB((ddk)->ddk_prop, 16, 16, SPA_MINBLOCKSHIFT, 1)

Definition at line 84 of file ddt.h.

#define DDK_SET_COMPRESS (   ddk,
 
)    BF64_SET((ddk)->ddk_prop, 32, 8, x)

Definition at line 90 of file ddt.h.

#define DDK_SET_LSIZE (   ddk,
 
)    BF64_SET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1, x)

Definition at line 81 of file ddt.h.

#define DDK_SET_PSIZE (   ddk,
 
)    BF64_SET_SB((ddk)->ddk_prop, 16, 16, SPA_MINBLOCKSHIFT, 1, x)

Definition at line 86 of file ddt.h.

#define DDT_COMPRESS_BYTEORDER_MASK   0x80

Definition at line 58 of file ddt.h.

#define DDT_COMPRESS_FUNCTION_MASK   0x7f

Definition at line 59 of file ddt.h.

#define DDT_KEY_WORDS   (sizeof (ddt_key_t) / sizeof (uint64_t))

Definition at line 92 of file ddt.h.

#define DDT_NAMELEN   80

Definition at line 172 of file ddt.h.

#define DDT_TYPE_CURRENT   0

Definition at line 56 of file ddt.h.


Typedef Documentation

typedef struct ddt_bookmark ddt_bookmark_t

In-core and on-disk bookmark for DDT walks.

typedef struct ddt_key ddt_key_t

On-disk ddt entry: key (name) and physical storage (value).

typedef struct ddt_ops ddt_ops_t

Ops vector to access a specific DDT object type.

typedef struct ddt_phys ddt_phys_t

Enumeration Type Documentation

enum ddt_class

DDT classes, in the desired search order (highest replication level first).

Enumerator:
DDT_CLASS_DITTO 
DDT_CLASS_DUPLICATE 
DDT_CLASS_UNIQUE 
DDT_CLASSES 

Definition at line 49 of file ddt.h.

Enumerator:
DDT_PHYS_DITTO 
DDT_PHYS_SINGLE 
DDT_PHYS_DOUBLE 
DDT_PHYS_TRIPLE 
DDT_PHYS_TYPES 

Definition at line 100 of file ddt.h.

enum ddt_type

On-disk DDT formats, in the desired search order (newest version first).

Enumerator:
DDT_TYPE_ZAP 
DDT_TYPES 

Definition at line 41 of file ddt.h.


Function Documentation

void ddt_bp_create ( enum zio_checksum  checksum,
const ddt_key_t ddk,
const ddt_phys_t ddp,
blkptr_t bp 
)

Definition at line 264 of file ddt.c.

void ddt_bp_fill ( const ddt_phys_t ddp,
blkptr_t bp,
uint64_t  txg 
)

Definition at line 254 of file ddt.c.

boolean_t ddt_class_contains ( spa_t spa,
enum ddt_class  max_class,
const blkptr_t bp 
)

Definition at line 866 of file ddt.c.

size_t ddt_compress ( void *  src,
uchar_t *  dst,
size_t  s_len,
size_t  d_len 
)

Definition at line 576 of file ddt.c.

void ddt_create ( spa_t spa)

Definition at line 811 of file ddt.c.

void ddt_decompress ( uchar_t *  src,
void *  dst,
size_t  s_len,
size_t  d_len 
)

Definition at line 598 of file ddt.c.

int ddt_ditto_copies_needed ( ddt_t ddt,
ddt_entry_t dde,
ddt_phys_t ddp_willref 
)

Definition at line 524 of file ddt.c.

int ddt_ditto_copies_present ( ddt_entry_t dde)

Definition at line 560 of file ddt.c.

void ddt_enter ( ddt_t ddt)

Definition at line 626 of file ddt.c.

int ddt_entry_compare ( const void *  x1,
const void *  x2 
)

Definition at line 763 of file ddt.c.

void ddt_exit ( ddt_t ddt)

Definition at line 632 of file ddt.c.

uint64_t ddt_get_dedup_dspace ( spa_t spa)

Definition at line 503 of file ddt.c.

void ddt_get_dedup_histogram ( spa_t spa,
ddt_histogram_t *  ddh 
)

Definition at line 477 of file ddt.c.

void ddt_get_dedup_object_stats ( spa_t spa,
ddt_object_t *  ddo 
)

Definition at line 452 of file ddt.c.

void ddt_get_dedup_stats ( spa_t spa,
ddt_stat_t *  dds_total 
)

Definition at line 492 of file ddt.c.

uint64_t ddt_get_pool_dedup_ratio ( spa_t spa)

Definition at line 512 of file ddt.c.

void ddt_histogram_add ( ddt_histogram_t *  dst,
const ddt_histogram_t *  src 
)

Definition at line 423 of file ddt.c.

boolean_t ddt_histogram_empty ( const ddt_histogram_t *  ddh)

Definition at line 439 of file ddt.c.

void ddt_histogram_stat ( ddt_stat_t *  dds,
const ddt_histogram_t *  ddh 
)

Definition at line 430 of file ddt.c.

void ddt_key_fill ( ddt_key_t ddk,
const blkptr_t bp 
)

Definition at line 286 of file ddt.c.

int ddt_load ( spa_t spa)

Definition at line 820 of file ddt.c.

ddt_entry_t* ddt_lookup ( ddt_t ddt,
const blkptr_t bp,
boolean_t  add 
)

Definition at line 676 of file ddt.c.

uint64_t ddt_object_count ( ddt_t ddt,
enum ddt_type  type,
enum ddt_class  cls 
)

Definition at line 219 of file ddt.c.

boolean_t ddt_object_exists ( ddt_t ddt,
enum ddt_type  type,
enum ddt_class  cls 
)

Definition at line 239 of file ddt.c.

int ddt_object_info ( ddt_t ddt,
enum ddt_type  type,
enum ddt_class  cls,
dmu_object_info_t  
)

Definition at line 228 of file ddt.c.

void ddt_object_name ( ddt_t ddt,
enum ddt_type  type,
enum ddt_class  cls,
char *  name 
)

Definition at line 245 of file ddt.c.

int ddt_object_update ( ddt_t ddt,
enum ddt_type  type,
enum ddt_class  cls,
ddt_entry_t dde,
dmu_tx_t tx 
)

Definition at line 189 of file ddt.c.

int ddt_object_walk ( ddt_t ddt,
enum ddt_type  type,
enum ddt_class  cls,
uint64_t *  walk,
ddt_entry_t dde 
)

Definition at line 209 of file ddt.c.

void ddt_phys_addref ( ddt_phys_t ddp)

Definition at line 313 of file ddt.c.

void ddt_phys_clear ( ddt_phys_t ddp)

Definition at line 307 of file ddt.c.

void ddt_phys_decref ( ddt_phys_t ddp)

Definition at line 319 of file ddt.c.

void ddt_phys_fill ( ddt_phys_t ddp,
const blkptr_t bp 
)

Definition at line 297 of file ddt.c.

void ddt_phys_free ( ddt_t ddt,
ddt_key_t ddk,
ddt_phys_t ddp,
uint64_t  txg 
)

Definition at line 326 of file ddt.c.

ddt_phys_t* ddt_phys_select ( const ddt_entry_t dde,
const blkptr_t bp 
)

Definition at line 336 of file ddt.c.

uint64_t ddt_phys_total_refcnt ( const ddt_entry_t dde)

Definition at line 349 of file ddt.c.

void ddt_prefetch ( spa_t spa,
const blkptr_t bp 
)

Definition at line 739 of file ddt.c.

void ddt_remove ( ddt_t ddt,
ddt_entry_t dde 
)

Definition at line 667 of file ddt.c.

void ddt_repair_done ( ddt_t ddt,
ddt_entry_t dde 
)

Definition at line 918 of file ddt.c.

ddt_entry_t* ddt_repair_start ( ddt_t ddt,
const blkptr_t bp 
)

Definition at line 890 of file ddt.c.

ddt_t* ddt_select ( spa_t spa,
const blkptr_t bp 
)

Definition at line 620 of file ddt.c.

void ddt_stat_add ( ddt_stat_t *  dst,
const ddt_stat_t *  src,
uint64_t  neg 
)

Definition at line 393 of file ddt.c.

void ddt_sync ( spa_t spa,
uint64_t  txg 
)

Definition at line 1102 of file ddt.c.

void ddt_unload ( spa_t spa)

Definition at line 855 of file ddt.c.

int ddt_walk ( spa_t spa,
ddt_bookmark_t ddb,
ddt_entry_t dde 
)

Definition at line 1126 of file ddt.c.


Variable Documentation

Definition at line 146 of file ddt_zap.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines