FreeBSD ZFS
The Zettabyte File System
|
#include <sys/spa.h>
#include <sys/arc.h>
#include <sys/txg.h>
#include <sys/zfs_context.h>
#include <sys/dnode.h>
#include <sys/zio.h>
#include <sys/zil.h>
#include <sys/sa.h>
#include <sys/zil.h>
#include <sys/sa.h>
Go to the source code of this file.
Data Structures | |
struct | objset_phys |
struct | objset |
Defines | |
#define | OBJSET_PHYS_SIZE 2048 |
#define | OBJSET_OLD_PHYS_SIZE 1024 |
#define | OBJSET_BUF_HAS_USERUSED(buf) (arc_buf_size(buf) > OBJSET_OLD_PHYS_SIZE) |
#define | OBJSET_FLAG_USERACCOUNTING_COMPLETE (1ULL<<0) |
#define | DMU_META_OBJSET 0 |
#define | DMU_META_DNODE_OBJECT 0 |
#define | DMU_OBJECT_IS_SPECIAL(obj) ((int64_t)(obj) <= 0) |
#define | DMU_META_DNODE(os) ((os)->os_meta_dnode.dnh_dnode) |
#define | DMU_USERUSED_DNODE(os) ((os)->os_userused_dnode.dnh_dnode) |
#define | DMU_GROUPUSED_DNODE(os) ((os)->os_groupused_dnode.dnh_dnode) |
#define | DMU_OS_IS_L2CACHEABLE(os) |
Typedefs | |
typedef struct objset_phys | objset_phys_t |
Functions | |
int | dmu_objset_hold (const char *name, void *tag, objset_t **osp) |
int | dmu_objset_own (const char *name, dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp) |
void | dmu_objset_rele (objset_t *os, void *tag) |
void | dmu_objset_disown (objset_t *os, void *tag) |
int | dmu_objset_from_ds (struct dsl_dataset *ds, objset_t **osp) |
int | dmu_objset_create (const char *name, dmu_objset_type_t type, uint64_t flags, void(*func)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx), void *arg) |
int | dmu_objset_clone (const char *name, struct dsl_dataset *clone_origin, uint64_t flags) |
int | dmu_objset_destroy (const char *name, boolean_t defer) |
int | dmu_objset_snapshot (char *fsname, char *snapname, char *tag, struct nvlist *props, boolean_t recursive, boolean_t temporary, int fd) |
void | dmu_objset_stats (objset_t *os, nvlist_t *nv) |
void | dmu_objset_fast_stat (objset_t *os, dmu_objset_stats_t *stat) |
Get stats on a dataset. | |
void | dmu_objset_space (objset_t *os, uint64_t *refdbytesp, uint64_t *availbytesp, uint64_t *usedobjsp, uint64_t *availobjsp) |
Get the space usage statistics for statvfs(). | |
uint64_t | dmu_objset_fsid_guid (objset_t *os) |
The fsid_guid is a 56-bit ID that can change to avoid collisions. | |
int | dmu_objset_find (const char *name, int func(const char *, void *), void *arg, int flags) |
Find all objsets under name, and for each, call 'func(child_name, arg)'. | |
int | dmu_objset_find_spa (spa_t *spa, const char *name, int func(spa_t *, uint64_t, const char *, void *), void *arg, int flags) |
Find all objsets under name, call func on each. | |
int | dmu_objset_prefetch (const char *name, void *arg) |
void | dmu_objset_byteswap (void *buf, size_t size) |
int | dmu_objset_evict_dbufs (objset_t *os) |
timestruc_t | dmu_objset_snap_cmtime (objset_t *os) |
void | dmu_objset_sync (objset_t *os, zio_t *zio, dmu_tx_t *tx) |
boolean_t | dmu_objset_is_dirty (objset_t *os, uint64_t txg) |
objset_t * | dmu_objset_create_impl (spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, dmu_objset_type_t type, dmu_tx_t *tx) |
int | dmu_objset_open_impl (spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, objset_t **osp) |
void | dmu_objset_evict (objset_t *os) |
void | dmu_objset_do_userquota_updates (objset_t *os, dmu_tx_t *tx) |
void | dmu_objset_userquota_get_ids (dnode_t *dn, boolean_t before, dmu_tx_t *tx) |
boolean_t | dmu_objset_userused_enabled (objset_t *os) |
int | dmu_objset_userspace_upgrade (objset_t *os) |
boolean_t | dmu_objset_userspace_present (objset_t *os) |
void | dmu_objset_init (void) |
void | dmu_objset_fini (void) |
Variables | |
krwlock_t | os_lock |
Needed to close a window in dnode_move() that allows the objset to be freed before it can be safely accessed. |
#define DMU_GROUPUSED_DNODE | ( | os | ) | ((os)->os_groupused_dnode.dnh_dnode) |
Definition at line 147 of file dmu_objset.h.
#define DMU_META_DNODE | ( | os | ) | ((os)->os_meta_dnode.dnh_dnode) |
Definition at line 145 of file dmu_objset.h.
#define DMU_META_DNODE_OBJECT 0 |
Definition at line 143 of file dmu_objset.h.
#define DMU_META_OBJSET 0 |
Definition at line 142 of file dmu_objset.h.
#define DMU_OBJECT_IS_SPECIAL | ( | obj | ) | ((int64_t)(obj) <= 0) |
Definition at line 144 of file dmu_objset.h.
#define DMU_OS_IS_L2CACHEABLE | ( | os | ) |
((os)->os_secondary_cache == ZFS_CACHE_ALL || \ (os)->os_secondary_cache == ZFS_CACHE_METADATA)
Definition at line 149 of file dmu_objset.h.
#define DMU_USERUSED_DNODE | ( | os | ) | ((os)->os_userused_dnode.dnh_dnode) |
Definition at line 146 of file dmu_objset.h.
#define OBJSET_BUF_HAS_USERUSED | ( | buf | ) | (arc_buf_size(buf) > OBJSET_OLD_PHYS_SIZE) |
Definition at line 51 of file dmu_objset.h.
#define OBJSET_FLAG_USERACCOUNTING_COMPLETE (1ULL<<0) |
Definition at line 54 of file dmu_objset.h.
#define OBJSET_OLD_PHYS_SIZE 1024 |
Definition at line 49 of file dmu_objset.h.
#define OBJSET_PHYS_SIZE 2048 |
Definition at line 48 of file dmu_objset.h.
typedef struct objset_phys objset_phys_t |
void dmu_objset_byteswap | ( | void * | buf, |
size_t | size | ||
) |
Definition at line 241 of file dmu_objset.c.
int dmu_objset_clone | ( | const char * | name, |
struct dsl_dataset * | clone_origin, | ||
uint64_t | flags | ||
) |
Definition at line 760 of file dmu_objset.c.
int dmu_objset_create | ( | const char * | name, |
dmu_objset_type_t | type, | ||
uint64_t | flags, | ||
void(*)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx) | func, | ||
void * | arg | ||
) |
Definition at line 729 of file dmu_objset.c.
objset_t* dmu_objset_create_impl | ( | spa_t * | spa, |
struct dsl_dataset * | ds, | ||
blkptr_t * | bp, | ||
dmu_objset_type_t | type, | ||
dmu_tx_t * | tx | ||
) |
Definition at line 599 of file dmu_objset.c.
int dmu_objset_destroy | ( | const char * | name, |
boolean_t | defer | ||
) |
Definition at line 788 of file dmu_objset.c.
void dmu_objset_disown | ( | objset_t * | os, |
void * | tag | ||
) |
Definition at line 482 of file dmu_objset.c.
Definition at line 1222 of file dmu_objset.c.
void dmu_objset_evict | ( | objset_t * | os | ) |
Definition at line 528 of file dmu_objset.c.
int dmu_objset_evict_dbufs | ( | objset_t * | os | ) |
Definition at line 488 of file dmu_objset.c.
void dmu_objset_fast_stat | ( | objset_t * | os, |
dmu_objset_stats_t * | stat | ||
) |
Get stats on a dataset.
Definition at line 1498 of file dmu_objset.c.
int dmu_objset_find | ( | const char * | name, |
int | funcconst char *, void *, | ||
void * | arg, | ||
int | flags | ||
) |
Find all objsets under name, and for each, call 'func(child_name, arg)'.
Definition at line 1637 of file dmu_objset.c.
int dmu_objset_find_spa | ( | spa_t * | spa, |
const char * | name, | ||
int | funcspa_t *, uint64_t, const char *, void *, | ||
void * | arg, | ||
int | flags | ||
) |
Find all objsets under name, call func on each.
Definition at line 1650 of file dmu_objset.c.
void dmu_objset_fini | ( | void | ) |
Definition at line 60 of file dmu_objset.c.
int dmu_objset_from_ds | ( | struct dsl_dataset * | ds, |
objset_t ** | osp | ||
) |
Definition at line 418 of file dmu_objset.c.
uint64_t dmu_objset_fsid_guid | ( | objset_t * | os | ) |
The fsid_guid is a 56-bit ID that can change to avoid collisions.
(Contrast with the ds_guid which is a 64-bit ID that will never change, so there is a small probability that it will collide.)
Definition at line 1492 of file dmu_objset.c.
int dmu_objset_hold | ( | const char * | name, |
void * | tag, | ||
objset_t ** | osp | ||
) |
Definition at line 434 of file dmu_objset.c.
void dmu_objset_init | ( | void | ) |
Definition at line 54 of file dmu_objset.c.
boolean_t dmu_objset_is_dirty | ( | objset_t * | os, |
uint64_t | txg | ||
) |
Definition at line 1184 of file dmu_objset.c.
int dmu_objset_open_impl | ( | spa_t * | spa, |
struct dsl_dataset * | ds, | ||
blkptr_t * | bp, | ||
objset_t ** | osp | ||
) |
Definition at line 257 of file dmu_objset.c.
int dmu_objset_own | ( | const char * | name, |
dmu_objset_type_t | type, | ||
boolean_t | readonly, | ||
void * | tag, | ||
objset_t ** | osp | ||
) |
Definition at line 452 of file dmu_objset.c.
int dmu_objset_prefetch | ( | const char * | name, |
void * | arg | ||
) |
Definition at line 1752 of file dmu_objset.c.
void dmu_objset_rele | ( | objset_t * | os, |
void * | tag | ||
) |
Definition at line 476 of file dmu_objset.c.
timestruc_t dmu_objset_snap_cmtime | ( | objset_t * | os | ) |
Definition at line 592 of file dmu_objset.c.
int dmu_objset_snapshot | ( | char * | fsname, |
char * | snapname, | ||
char * | tag, | ||
struct nvlist * | props, | ||
boolean_t | recursive, | ||
boolean_t | temporary, | ||
int | fd | ||
) |
void dmu_objset_space | ( | objset_t * | os, |
uint64_t * | refdbytesp, | ||
uint64_t * | availbytesp, | ||
uint64_t * | usedobjsp, | ||
uint64_t * | availobjsp | ||
) |
Get the space usage statistics for statvfs().
refdbytes is the amount of space "referenced" by this objset. availbytes is the amount of space available to this objset, taking into account quotas & reservations, assuming that no other objsets use the space first. These values correspond to the 'referenced' and 'available' properties, described in the zfs(1m) manpage.
usedobjs and availobjs are the number of objects currently allocated, and available.
Definition at line 1484 of file dmu_objset.c.
void dmu_objset_stats | ( | objset_t * | os, |
nvlist_t * | nv | ||
) |
Definition at line 1506 of file dmu_objset.c.
Definition at line 1096 of file dmu_objset.c.
Definition at line 1327 of file dmu_objset.c.
boolean_t dmu_objset_userspace_present | ( | objset_t * | os | ) |
Definition at line 1428 of file dmu_objset.c.
int dmu_objset_userspace_upgrade | ( | objset_t * | os | ) |
Definition at line 1435 of file dmu_objset.c.
boolean_t dmu_objset_userused_enabled | ( | objset_t * | os | ) |
Definition at line 1199 of file dmu_objset.c.
krwlock_t os_lock |
Needed to close a window in dnode_move() that allows the objset to be freed before it can be safely accessed.
Definition at line 51 of file dmu_objset.c.