#include <sys/dmu.h>
#include <sys/txg.h>
#include <sys/refcount.h>
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_t * | dmu_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_t * | dmu_tx_create_assigned (struct dsl_pool *dp, uint64_t txg) |
dmu_tx_t * | dmu_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 |
|
) |
| |
Typedef Documentation
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
int dmu_tx_assign |
( |
dmu_tx_t * |
tx, |
|
|
uint64_t |
txg_how |
|
) |
| |
Assign tx to a transaction group.
txg_how can be one of:
- 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).
- 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.
- 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_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 |
|
) |
| |
int dmu_tx_holds |
( |
dmu_tx_t * |
tx, |
|
|
uint64_t |
object |
|
) |
| |
void dmu_tx_willuse_space |
( |
dmu_tx_t * |
tx, |
|
|
int64_t |
delta |
|
) |
| |