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

sys/sa.h File Reference

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

Go to the source code of this file.

Data Structures

struct  sa_attr_reg
 Attribute to register support for. More...
struct  sa_bulk_attr
 array of attributes to store. More...

Defines

#define SA_ADD_BULK_ATTR(b, idx, attr, func, data, len)
 special macro for adding entries for bulk attr support

  • bulk - sa_bulk_attr_t
  • count - integer that will be incremented during each add
  • attr - attribute to manipulate
  • func - function for accessing data.

Typedefs

typedef enum sa_bswap_type sa_bswap_type_t
 Currently available byteswap functions.
typedef uint16_t sa_attr_type_t
typedef struct sa_attr_reg sa_attr_reg_t
 Attribute to register support for.
typedef void( sa_data_locator_t )(void **, uint32_t *, uint32_t, boolean_t, void *userptr)
typedef struct sa_bulk_attr sa_bulk_attr_t
 array of attributes to store.
typedef struct sa_os sa_os_t
typedef enum sa_handle_type sa_handle_type_t
typedef void * sa_lookup_tab_t
typedef struct sa_handle sa_handle_t
typedef void( sa_update_cb_t )(sa_handle_t *, dmu_tx_t *tx)

Enumerations

enum  sa_bswap_type {
  SA_UINT64_ARRAY, SA_UINT32_ARRAY, SA_UINT16_ARRAY, SA_UINT8_ARRAY,
  SA_ACL
}
 

Currently available byteswap functions.

More...
enum  sa_handle_type { SA_HDL_SHARED, SA_HDL_PRIVATE }

Functions

int sa_handle_get (objset_t *, uint64_t, void *userp, sa_handle_type_t, sa_handle_t **)
int sa_handle_get_from_db (objset_t *, dmu_buf_t *, void *userp, sa_handle_type_t, sa_handle_t **)
void sa_handle_destroy (sa_handle_t *)
int sa_buf_hold (objset_t *, uint64_t, void *, dmu_buf_t **)
void sa_buf_rele (dmu_buf_t *, void *)
int sa_lookup (sa_handle_t *, sa_attr_type_t, void *buf, uint32_t buflen)
int sa_update (sa_handle_t *, sa_attr_type_t, void *buf, uint32_t buflen, dmu_tx_t *)
 update or add new attribute
int sa_remove (sa_handle_t *, sa_attr_type_t, dmu_tx_t *)
int sa_bulk_lookup (sa_handle_t *, sa_bulk_attr_t *, int count)
int sa_bulk_lookup_locked (sa_handle_t *, sa_bulk_attr_t *, int count)
int sa_bulk_update (sa_handle_t *, sa_bulk_attr_t *, int count, dmu_tx_t *)
int sa_size (sa_handle_t *, sa_attr_type_t, int *)
 Return size of an attribute.
int sa_update_from_cb (sa_handle_t *, sa_attr_type_t, uint32_t buflen, sa_data_locator_t *, void *userdata, dmu_tx_t *)
void sa_object_info (sa_handle_t *, dmu_object_info_t *)
void sa_object_size (sa_handle_t *, uint32_t *, u_longlong_t *)
void sa_update_user (sa_handle_t *, sa_handle_t *)
void * sa_get_userdata (sa_handle_t *)
void sa_set_userp (sa_handle_t *, void *)
dmu_buf_tsa_get_db (sa_handle_t *)
uint64_t sa_handle_object (sa_handle_t *)
boolean_t sa_attr_would_spill (sa_handle_t *, sa_attr_type_t, int size)
void sa_register_update_callback (objset_t *, sa_update_cb_t *)
int sa_setup (objset_t *, uint64_t, sa_attr_reg_t *, int, sa_attr_type_t **)
void sa_tear_down (objset_t *)
int sa_replace_all_by_template (sa_handle_t *, sa_bulk_attr_t *, int, dmu_tx_t *)
int sa_replace_all_by_template_locked (sa_handle_t *, sa_bulk_attr_t *, int, dmu_tx_t *)
 Replace all attributes with attributes specified in template.
boolean_t sa_enabled (objset_t *)
void sa_cache_init ()
void sa_cache_fini ()
int sa_set_sa_object (objset_t *, uint64_t)
int sa_hdrsize (void *)
void sa_handle_lock (sa_handle_t *)
void sa_handle_unlock (sa_handle_t *)
int sa_lookup_uio (sa_handle_t *, sa_attr_type_t, uio_t *)

Define Documentation

#define SA_ADD_BULK_ATTR (   b,
  idx,
  attr,
  func,
  data,
  len 
)
Value:
{ \
        b[idx].sa_attr = attr;\
        b[idx].sa_data_func = func; \
        b[idx].sa_data = data; \
        b[idx++].sa_length = len; \
}

special macro for adding entries for bulk attr support

  • bulk - sa_bulk_attr_t
  • count - integer that will be incremented during each add
  • attr - attribute to manipulate
  • func - function for accessing data.

  • data - pointer to data.
  • len - length of data

Definition at line 97 of file sa.h.


Typedef Documentation

typedef struct sa_attr_reg sa_attr_reg_t

Attribute to register support for.

typedef uint16_t sa_attr_type_t

Definition at line 47 of file sa.h.

Currently available byteswap functions.

If it all possible new attributes should used one of the already defined byteswap functions. If a new byteswap function is added then the ZPL/Pool version will need to be bumped.

typedef struct sa_bulk_attr sa_bulk_attr_t

array of attributes to store.

This array should be treated as opaque/private data. The SA_BULK_ADD_ATTR() macro should be used for manipulating the array.

When sa_replace_all_by_template() is used the attributes will be stored in the order defined in the array, except that the attributes may be split between the bonus and the spill buffer

typedef void( sa_data_locator_t)(void **, uint32_t *, uint32_t, boolean_t, void *userptr)

Definition at line 60 of file sa.h.

typedef struct sa_handle sa_handle_t

Definition at line 114 of file sa.h.

typedef void* sa_lookup_tab_t

Definition at line 112 of file sa.h.

typedef struct sa_os sa_os_t

Definition at line 105 of file sa.h.

typedef void( sa_update_cb_t)(sa_handle_t *, dmu_tx_t *tx)

Definition at line 116 of file sa.h.


Enumeration Type Documentation

Currently available byteswap functions.

If it all possible new attributes should used one of the already defined byteswap functions. If a new byteswap function is added then the ZPL/Pool version will need to be bumped.

Enumerator:
SA_UINT64_ARRAY 
SA_UINT32_ARRAY 
SA_UINT16_ARRAY 
SA_UINT8_ARRAY 
SA_ACL 

Definition at line 39 of file sa.h.

Enumerator:
SA_HDL_SHARED 
SA_HDL_PRIVATE 

Definition at line 107 of file sa.h.


Function Documentation

boolean_t sa_attr_would_spill ( sa_handle_t ,
sa_attr_type_t  ,
int  size 
)
int sa_buf_hold ( objset_t ,
uint64_t  ,
void *  ,
dmu_buf_t **   
)

Definition at line 1407 of file sa.c.

void sa_buf_rele ( dmu_buf_t ,
void *   
)

Definition at line 1413 of file sa.c.

int sa_bulk_lookup ( sa_handle_t ,
sa_bulk_attr_t ,
int  count 
)

Definition at line 1851 of file sa.c.

int sa_bulk_lookup_locked ( sa_handle_t ,
sa_bulk_attr_t ,
int  count 
)

Definition at line 1843 of file sa.c.

int sa_bulk_update ( sa_handle_t ,
sa_bulk_attr_t ,
int  count,
dmu_tx_t  
)

Definition at line 1863 of file sa.c.

void sa_cache_fini ( )

Definition at line 245 of file sa.c.

void sa_cache_init ( )

Definition at line 237 of file sa.c.

boolean_t sa_enabled ( objset_t )

Definition at line 1948 of file sa.c.

dmu_buf_t* sa_get_db ( sa_handle_t )

Definition at line 1914 of file sa.c.

void* sa_get_userdata ( sa_handle_t )

Definition at line 1920 of file sa.c.

void sa_handle_destroy ( sa_handle_t )

Definition at line 1328 of file sa.c.

int sa_handle_get ( objset_t ,
uint64_t  ,
void *  userp,
sa_handle_type_t  ,
sa_handle_t **   
)

Definition at line 1393 of file sa.c.

int sa_handle_get_from_db ( objset_t ,
dmu_buf_t ,
void *  userp,
sa_handle_type_t  ,
sa_handle_t **   
)

Definition at line 1353 of file sa.c.

void sa_handle_lock ( sa_handle_t )

Definition at line 1975 of file sa.c.

uint64_t sa_handle_object ( sa_handle_t )

Definition at line 1942 of file sa.c.

void sa_handle_unlock ( sa_handle_t )

Definition at line 1982 of file sa.c.

int sa_hdrsize ( void *  )

Definition at line 1967 of file sa.c.

int sa_lookup ( sa_handle_t ,
sa_attr_type_t  ,
void *  buf,
uint32_t  buflen 
)

Definition at line 1427 of file sa.c.

int sa_lookup_uio ( sa_handle_t ,
sa_attr_type_t  ,
uio_t *   
)

Definition at line 1446 of file sa.c.

void sa_object_info ( sa_handle_t ,
dmu_object_info_t  
)

Definition at line 1887 of file sa.c.

void sa_object_size ( sa_handle_t ,
uint32_t *  ,
u_longlong_t *   
)

Definition at line 1893 of file sa.c.

void sa_register_update_callback ( objset_t ,
sa_update_cb_t  
)

Definition at line 1933 of file sa.c.

int sa_remove ( sa_handle_t ,
sa_attr_type_t  ,
dmu_tx_t  
)

Definition at line 1875 of file sa.c.

int sa_replace_all_by_template ( sa_handle_t ,
sa_bulk_attr_t ,
int  ,
dmu_tx_t  
)

Definition at line 1603 of file sa.c.

int sa_replace_all_by_template_locked ( sa_handle_t hdl,
sa_bulk_attr_t attr_desc,
int  attr_count,
dmu_tx_t tx 
)

Replace all attributes with attributes specified in template.

If dnode had a spill buffer then those attributes will be also be replaced, possibly with just an empty spill block

This interface is intended to only be used for bulk adding of attributes for a new file. It will also be used by the ZPL when converting and old formatted znode to native SA support.

Definition at line 1592 of file sa.c.

int sa_set_sa_object ( objset_t ,
uint64_t   
)

Definition at line 1954 of file sa.c.

void sa_set_userp ( sa_handle_t ,
void *   
)

Definition at line 1908 of file sa.c.

int sa_setup ( objset_t ,
uint64_t  ,
sa_attr_reg_t ,
int  ,
sa_attr_type_t **   
)

Definition at line 981 of file sa.c.

int sa_size ( sa_handle_t ,
sa_attr_type_t  ,
int *   
)

Return size of an attribute.

Definition at line 1821 of file sa.c.

void sa_tear_down ( objset_t )

Definition at line 1104 of file sa.c.

int sa_update ( sa_handle_t ,
sa_attr_type_t  ,
void *  buf,
uint32_t  buflen,
dmu_tx_t  
)

update or add new attribute

Definition at line 1782 of file sa.c.

int sa_update_from_cb ( sa_handle_t ,
sa_attr_type_t  ,
uint32_t  buflen,
sa_data_locator_t ,
void *  userdata,
dmu_tx_t  
)

Definition at line 1800 of file sa.c.

void sa_update_user ( sa_handle_t ,
sa_handle_t  
)

Definition at line 1900 of file sa.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines