Data Structures |
struct | dnode_phys |
struct | dnode |
struct | dnode_handle |
| Adds a level of indirection between the dbuf and the dnode to avoid iterating descendent dbufs in dnode_move(). More...
|
struct | dnode_children |
struct | free_range |
Defines |
#define | DN_MAX_LEVELS |
#define | DN_BONUS(dnp) |
#define | DN_USED_BYTES(dnp) |
#define | EPB(blkshift, typeshift) (1 << (blkshift - typeshift)) |
#define | DNODE_FLAG_USED_BYTES (1<<0) |
| Is dn_used in bytes? if not, it's in multiples of SPA_MINBLOCKSIZE.
|
#define | DNODE_FLAG_USERUSED_ACCOUNTED (1<<1) |
#define | DNODE_FLAG_SPILL_BLKPTR (1<<2) |
| Does dnode have a SA spill blkptr in bonus?
|
#define | dprintf_dnode(db, fmt,...) |
#define | DNODE_VERIFY(dn) |
#define | FREE_VERIFY(db, start, end, tx) |
|
#define | DNODE_MUST_BE_ALLOCATED 1 |
#define | DNODE_MUST_BE_FREE 2 |
|
#define | DNODE_FIND_HOLE 1 |
#define | DNODE_FIND_BACKWARDS 2 |
#define | DNODE_FIND_HAVELOCK 4 |
|
#define | DNODE_SHIFT 9 |
| 512 bytes
|
#define | DN_MIN_INDBLKSHIFT 10 |
| 1k
|
#define | DN_MAX_INDBLKSHIFT 14 |
| 16k
|
#define | DNODE_BLOCK_SHIFT 14 |
| 16k
|
#define | DNODE_CORE_SIZE 64 |
| 64 bytes for dnode sans blkptrs
|
#define | DN_MAX_OBJECT_SHIFT 48 |
| 256 trillion (zfs_fid_t limit)
|
#define | DN_MAX_OFFSET_SHIFT 64 |
| 2^64 bytes in a dnode
|
|
- Note:
- a file will never ever have its ids moved from bonus->spill and only in a crypto environment would it be on spill
|
#define | DN_ID_CHKED_BONUS 0x1 |
#define | DN_ID_CHKED_SPILL 0x2 |
#define | DN_ID_OLD_EXIST 0x4 |
#define | DN_ID_NEW_EXIST 0x8 |
|
#define | DNODE_SIZE (1 << DNODE_SHIFT) |
#define | DN_MAX_NBLKPTR ((DNODE_SIZE - DNODE_CORE_SIZE) >> SPA_BLKPTRSHIFT) |
#define | DN_MAX_BONUSLEN (DNODE_SIZE - DNODE_CORE_SIZE - (1 << SPA_BLKPTRSHIFT)) |
#define | DN_MAX_OBJECT (1ULL << DN_MAX_OBJECT_SHIFT) |
#define | DN_ZERO_BONUSLEN (DN_MAX_BONUSLEN + 1) |
#define | DN_KILL_SPILLBLK (1) |
#define | DNODES_PER_BLOCK_SHIFT (DNODE_BLOCK_SHIFT - DNODE_SHIFT) |
#define | DNODES_PER_BLOCK (1ULL << DNODES_PER_BLOCK_SHIFT) |
#define | DNODES_PER_LEVEL_SHIFT (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT) |
#define | DNODES_PER_LEVEL (1ULL << DNODES_PER_LEVEL_SHIFT) |
Typedefs |
typedef struct dnode_phys | dnode_phys_t |
typedef struct dnode | dnode_t |
typedef struct dnode_handle | dnode_handle_t |
| Adds a level of indirection between the dbuf and the dnode to avoid iterating descendent dbufs in dnode_move().
|
typedef struct dnode_children | dnode_children_t |
typedef struct free_range | free_range_t |
Enumerations |
enum | dnode_dirtycontext { DN_UNDIRTIED,
DN_DIRTY_OPEN,
DN_DIRTY_SYNC
} |
Functions |
dnode_t * | dnode_special_open (struct objset *dd, dnode_phys_t *dnp, uint64_t object, dnode_handle_t *dnh) |
void | dnode_special_close (dnode_handle_t *dnh) |
void | dnode_setbonuslen (dnode_t *dn, int newsize, dmu_tx_t *tx) |
void | dnode_setbonus_type (dnode_t *dn, dmu_object_type_t, dmu_tx_t *tx) |
void | dnode_rm_spill (dnode_t *dn, dmu_tx_t *tx) |
int | dnode_hold (struct objset *dd, uint64_t object, void *ref, dnode_t **dnp) |
int | dnode_hold_impl (struct objset *dd, uint64_t object, int flag, void *ref, dnode_t **dnp) |
| Succeeds even for free dnodes.
|
boolean_t | dnode_add_ref (dnode_t *dn, void *ref) |
| Can only add a reference if there is already at least one reference on the dnode.
|
void | dnode_rele (dnode_t *dn, void *ref) |
void | dnode_setdirty (dnode_t *dn, dmu_tx_t *tx) |
void | dnode_sync (dnode_t *dn, dmu_tx_t *tx) |
| Writes out the dnode's dirty buffers.
|
void | dnode_allocate (dnode_t *dn, dmu_object_type_t ot, int blocksize, int ibs, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) |
void | dnode_reallocate (dnode_t *dn, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) |
void | dnode_free (dnode_t *dn, dmu_tx_t *tx) |
void | dnode_byteswap (dnode_phys_t *dnp) |
void | dnode_buf_byteswap (void *buf, size_t size) |
void | dnode_verify (dnode_t *dn) |
int | dnode_set_blksz (dnode_t *dn, uint64_t size, int ibs, dmu_tx_t *tx) |
| Try to change the block size for the indicated dnode.
|
void | dnode_free_range (dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx) |
void | dnode_clear_range (dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx) |
void | dnode_diduse_space (dnode_t *dn, int64_t space) |
| call from syncing context when we actually write/free space for this dnode
|
void | dnode_willuse_space (dnode_t *dn, int64_t space, dmu_tx_t *tx) |
| Call when we think we're going to write/free space in open context.
|
void | dnode_new_blkid (dnode_t *dn, uint64_t blkid, dmu_tx_t *tx, boolean_t) |
| read-holding callers must not rely on the lock being continuously held
|
uint64_t | dnode_block_freed (dnode_t *dn, uint64_t blkid) |
void | dnode_init (void) |
void | dnode_fini (void) |
int | dnode_next_offset (dnode_t *dn, int flags, uint64_t *off, int minlvl, uint64_t blkfill, uint64_t txg) |
| Find the next hole, data, or sparse region at or after *offset.
|
void | dnode_evict_dbufs (dnode_t *dn) |
| Tries to kick all the dnode's dbufs out of the cache...
|
int dnode_next_offset |
( |
dnode_t * |
dn, |
|
|
int |
flags, |
|
|
uint64_t * |
offset, |
|
|
int |
minlvl, |
|
|
uint64_t |
blkfill, |
|
|
uint64_t |
txg |
|
) |
| |
Find the next hole, data, or sparse region at or after *offset.
The value 'blkfill' tells us how many items we expect to find in an L0 data block; this value is 1 for normal objects, DNODES_PER_BLOCK for the meta dnode, and some fraction of DNODES_PER_BLOCK when searching for sparse regions thereof.
Examples:
dnode_next_offset(dn, flags, offset, 1, 1, 0); Finds the next/previous hole/data in a file. Used in dmu_offset_next().
dnode_next_offset(mdn, flags, offset, 0, DNODES_PER_BLOCK, txg); Finds the next free/allocated dnode an objset's meta-dnode. Only finds objects that have new contents since txg (ie. bonus buffer changes and content removal are ignored). Used in dmu_object_next().
dnode_next_offset(mdn, DNODE_FIND_HOLE, offset, 2, DNODES_PER_BLOCK >> 2, 0); Finds the next L2 meta-dnode bp that's at most 1/4 full. Used in dmu_object_alloc().
Definition at line 1963 of file dnode.c.