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

sys/dmu_tx.h File Reference

#include <sys/dmu.h>
#include <sys/txg.h>
#include <sys/refcount.h>
Include dependency graph for dmu_tx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dmu_tx
 No synchronization is needed because a tx can only be handled by one thread. More...
struct  dmu_tx_hold
struct  dmu_tx_callback

Defines

#define DMU_TX_DIRTY_BUF(tx, db)

Typedefs

typedef struct dmu_tx_hold dmu_tx_hold_t
typedef struct dmu_tx_callback dmu_tx_callback_t

Enumerations

enum  dmu_tx_hold_type {
  THT_NEWOBJECT, THT_WRITE, THT_BONUS, THT_FREE,
  THT_ZAP, THT_SPACE, THT_SPILL, THT_NUMTYPES
}

Functions

dmu_tx_tdmu_tx_create (objset_t *dd)
int dmu_tx_assign (dmu_tx_t *tx, uint64_t txg_how)
 Assign tx to a transaction group.
void dmu_tx_commit (dmu_tx_t *tx)
void dmu_tx_abort (dmu_tx_t *tx)
uint64_t dmu_tx_get_txg (dmu_tx_t *tx)
 Return the txg number for the given assigned transaction.
void dmu_tx_wait (dmu_tx_t *tx)
void dmu_tx_do_callbacks (list_t *cb_list, int error)
 Call all the commit callbacks on a list, with a given error code.
dmu_tx_tdmu_tx_create_assigned (struct dsl_pool *dp, uint64_t txg)
dmu_tx_tdmu_tx_create_dd (dsl_dir_t *dd)
int dmu_tx_is_syncing (dmu_tx_t *tx)
int dmu_tx_private_ok (dmu_tx_t *tx)
void dmu_tx_add_new_object (dmu_tx_t *tx, objset_t *os, uint64_t object)
void dmu_tx_willuse_space (dmu_tx_t *tx, int64_t delta)
void dmu_tx_dirty_buf (dmu_tx_t *tx, struct dmu_buf_impl *db)
int dmu_tx_holds (dmu_tx_t *tx, uint64_t object)
void dmu_tx_hold_space (dmu_tx_t *tx, uint64_t space)

Define Documentation

#define DMU_TX_DIRTY_BUF (   tx,
  db 
)

Definition at line 138 of file dmu_tx.h.


Typedef Documentation

typedef struct dmu_tx_hold dmu_tx_hold_t

Enumeration Type Documentation

Enumerator:
THT_NEWOBJECT 
THT_WRITE 
THT_BONUS 
THT_FREE 
THT_ZAP 
THT_SPACE 
THT_SPILL 
THT_NUMTYPES 

Definition at line 72 of file dmu_tx.h.


Function Documentation

void dmu_tx_abort ( dmu_tx_t tx)

Definition at line 1191 of file dmu_tx.c.

void dmu_tx_add_new_object ( dmu_tx_t tx,
objset_t os,
uint64_t  object 
)

Definition at line 141 of file dmu_tx.c.

int dmu_tx_assign ( dmu_tx_t tx,
uint64_t  txg_how 
)

Assign tx to a transaction group.

txg_how can be one of:

  1. TXG_WAIT. If the current open txg is full, waits until there's a new one. This should be used when you're not holding locks. If will only fail if we're truly out of space (or over quota).
  2. TXG_NOWAIT. If we can't assign into the current open txg without blocking, returns immediately with ERESTART. This should be used whenever you're holding locks. On an ERESTART error, the caller should drop locks, do a dmu_tx_wait(tx), and try again.
  3. A specific txg. Use this if you need to ensure that multiple transactions all sync in the same txg. Like TXG_NOWAIT, it returns ERESTART if it can't assign you into the requested txg.

Definition at line 1072 of file dmu_tx.c.

void dmu_tx_commit ( dmu_tx_t tx)

Definition at line 1139 of file dmu_tx.c.

dmu_tx_t* dmu_tx_create ( objset_t dd)

Definition at line 65 of file dmu_tx.c.

dmu_tx_t* dmu_tx_create_assigned ( struct dsl_pool dp,
uint64_t  txg 
)

Definition at line 74 of file dmu_tx.c.

dmu_tx_t* dmu_tx_create_dd ( dsl_dir_t dd)

Definition at line 47 of file dmu_tx.c.

void dmu_tx_dirty_buf ( dmu_tx_t tx,
struct dmu_buf_impl db 
)
void dmu_tx_do_callbacks ( list_t *  cb_list,
int  error 
)

Call all the commit callbacks on a list, with a given error code.

Definition at line 1247 of file dmu_tx.c.

uint64_t dmu_tx_get_txg ( dmu_tx_t tx)

Return the txg number for the given assigned transaction.

Definition at line 1224 of file dmu_tx.c.

void dmu_tx_hold_space ( dmu_tx_t tx,
uint64_t  space 
)

Definition at line 762 of file dmu_tx.c.

int dmu_tx_holds ( dmu_tx_t tx,
uint64_t  object 
)

Definition at line 774 of file dmu_tx.c.

int dmu_tx_is_syncing ( dmu_tx_t tx)

Definition at line 87 of file dmu_tx.c.

int dmu_tx_private_ok ( dmu_tx_t tx)

Definition at line 93 of file dmu_tx.c.

void dmu_tx_wait ( dmu_tx_t tx)

Definition at line 1095 of file dmu_tx.c.

void dmu_tx_willuse_space ( dmu_tx_t tx,
int64_t  delta 
)

Definition at line 1122 of file dmu_tx.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines