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

sys/dsl_prop.h File Reference

#include <sys/dmu.h>
#include <sys/dsl_pool.h>
#include <sys/zfs_context.h>
#include <sys/dsl_synctask.h>
Include dependency graph for dsl_prop.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dsl_prop_cb_record
struct  dsl_props_arg
struct  dsl_prop_set_arg

Defines

#define DSL_PROP_CHECK_PREDICTION(dd, psa)

Typedefs

typedef void( dsl_prop_changed_cb_t )(void *arg, uint64_t newval)
 The callback func may not call into the DMU or DSL!
typedef struct dsl_prop_cb_record dsl_prop_cb_record_t
typedef struct dsl_props_arg dsl_props_arg_t
typedef struct dsl_prop_set_arg dsl_prop_setarg_t

Functions

int dsl_prop_register (struct dsl_dataset *ds, const char *propname, dsl_prop_changed_cb_t *callback, void *cbarg)
 Register interest in the named property.
int dsl_prop_unregister (struct dsl_dataset *ds, const char *propname, dsl_prop_changed_cb_t *callback, void *cbarg)
 Unregister this callback.
int dsl_prop_numcb (struct dsl_dataset *ds)
 Return the number of callbacks that are registered for this dataset.
int dsl_prop_get (const char *ddname, const char *propname, int intsz, int numints, void *buf, char *setpoint)
int dsl_prop_get_integer (const char *ddname, const char *propname, uint64_t *valuep, char *setpoint)
 Get the current property value.
int dsl_prop_get_all (objset_t *os, nvlist_t **nvp)
int dsl_prop_get_received (objset_t *os, nvlist_t **nvp)
int dsl_prop_get_ds (struct dsl_dataset *ds, const char *propname, int intsz, int numints, void *buf, char *setpoint)
int dsl_prop_get_dd (struct dsl_dir *dd, const char *propname, int intsz, int numints, void *buf, char *setpoint, boolean_t snapshot)
int dsl_prop_set (const char *ddname, const char *propname, zprop_source_t source, int intsz, int numints, const void *buf)
int dsl_props_set (const char *dsname, zprop_source_t source, nvlist_t *nvl)
void dsl_dir_prop_set_uint64_sync (dsl_dir_t *dd, const char *name, uint64_t val, dmu_tx_t *tx)
void dsl_prop_setarg_init_uint64 (dsl_prop_setarg_t *psa, const char *propname, zprop_source_t source, uint64_t *value)
int dsl_prop_predict_sync (dsl_dir_t *dd, dsl_prop_setarg_t *psa)
 Predict the effective value of the given special property if it were set with the given value and source.
boolean_t dsl_prop_get_hasrecvd (objset_t *os)
void dsl_prop_set_hasrecvd (objset_t *os)
 Call after successfully receiving properties to ensure that only the first receive on or after SPA_VERSION_RECVD_PROPS blows away local properties.
void dsl_prop_unset_hasrecvd (objset_t *os)
void dsl_prop_nvlist_add_uint64 (nvlist_t *nv, zfs_prop_t prop, uint64_t value)
void dsl_prop_nvlist_add_string (nvlist_t *nv, zfs_prop_t prop, const char *value)

Variables

dsl_syncfunc_t dsl_props_set_sync

Define Documentation

#define DSL_PROP_CHECK_PREDICTION (   dd,
  psa 
)

Definition at line 103 of file dsl_prop.h.


Typedef Documentation

typedef void( dsl_prop_changed_cb_t)(void *arg, uint64_t newval)

The callback func may not call into the DMU or DSL!

Definition at line 41 of file dsl_prop.h.


Function Documentation

void dsl_dir_prop_set_uint64_sync ( dsl_dir_t dd,
const char *  name,
uint64_t  val,
dmu_tx_t tx 
)

Definition at line 761 of file dsl_prop.c.

int dsl_prop_get ( const char *  ddname,
const char *  propname,
int  intsz,
int  numints,
void *  buf,
char *  setpoint 
)

Definition at line 268 of file dsl_prop.c.

int dsl_prop_get_all ( objset_t os,
nvlist_t **  nvp 
)

Definition at line 1099 of file dsl_prop.c.

int dsl_prop_get_dd ( struct dsl_dir dd,
const char *  propname,
int  intsz,
int  numints,
void *  buf,
char *  setpoint,
boolean_t  snapshot 
)

Definition at line 72 of file dsl_prop.c.

int dsl_prop_get_ds ( struct dsl_dataset ds,
const char *  propname,
int  intsz,
int  numints,
void *  buf,
char *  setpoint 
)

Definition at line 161 of file dsl_prop.c.

boolean_t dsl_prop_get_hasrecvd ( objset_t os)

Definition at line 1049 of file dsl_prop.c.

int dsl_prop_get_integer ( const char *  ddname,
const char *  propname,
uint64_t *  valuep,
char *  setpoint 
)

Get the current property value.

It may have changed by the time this function returns, so it is NOT safe to follow up with dsl_prop_register() and assume that the value has not changed in between.

Returns:
0 on success or ENOENT if ddname is invalid.

Definition at line 295 of file dsl_prop.c.

int dsl_prop_get_received ( objset_t os,
nvlist_t **  nvp 
)

Definition at line 1105 of file dsl_prop.c.

int dsl_prop_numcb ( struct dsl_dataset ds)

Return the number of callbacks that are registered for this dataset.

Definition at line 472 of file dsl_prop.c.

void dsl_prop_nvlist_add_string ( nvlist_t *  nv,
zfs_prop_t  prop,
const char *  value 
)

Definition at line 1141 of file dsl_prop.c.

void dsl_prop_nvlist_add_uint64 ( nvlist_t *  nv,
zfs_prop_t  prop,
uint64_t  value 
)

Definition at line 1118 of file dsl_prop.c.

int dsl_prop_predict_sync ( dsl_dir_t dd,
dsl_prop_setarg_t psa 
)

Predict the effective value of the given special property if it were set with the given value and source.

This is not a general purpose function. It exists only to handle the special requirements of the quota and reservation properties. The fact that these properties are non-inheritable greatly simplifies the prediction logic.

Returns:
0 on success, a positive error code on failure, or -1 if called with a property not handled by this function.

Definition at line 325 of file dsl_prop.c.

int dsl_prop_register ( dsl_dataset_t ds,
const char *  propname,
dsl_prop_changed_cb_t callback,
void *  cbarg 
)

Register interest in the named property.

We'll call the callback once to notify it of the current property value, and again each time the property changes, until this callback is unregistered.

Returns:
0 on success or errno if the prop is not an integer value.

Definition at line 229 of file dsl_prop.c.

int dsl_prop_set ( const char *  ddname,
const char *  propname,
zprop_source_t  source,
int  intsz,
int  numints,
const void *  buf 
)

Definition at line 779 of file dsl_prop.c.

void dsl_prop_set_hasrecvd ( objset_t os)

Call after successfully receiving properties to ensure that only the first receive on or after SPA_VERSION_RECVD_PROPS blows away local properties.

Definition at line 1083 of file dsl_prop.c.

void dsl_prop_setarg_init_uint64 ( dsl_prop_setarg_t psa,
const char *  propname,
zprop_source_t  source,
uint64_t *  value 
)

Definition at line 302 of file dsl_prop.c.

int dsl_prop_unregister ( dsl_dataset_t ds,
const char *  propname,
dsl_prop_changed_cb_t callback,
void *  cbarg 
)

Unregister this callback.

Returns:
0 on success, ENOENT if ddname is invalid, or ENOMSG if no matching callback registered.

Definition at line 439 of file dsl_prop.c.

void dsl_prop_unset_hasrecvd ( objset_t os)

Definition at line 1093 of file dsl_prop.c.

int dsl_props_set ( const char *  dsname,
zprop_source_t  source,
nvlist_t *  nvl 
)

Definition at line 825 of file dsl_prop.c.


Variable Documentation

dsl_syncfunc_t dsl_props_set_sync

Definition at line 88 of file dsl_prop.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines