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

sys/zfs_vfsops.h File Reference

#include <sys/list.h>
#include <sys/vfs.h>
#include <sys/zil.h>
#include <sys/sa.h>
#include <sys/rrwlock.h>
#include <sys/zfs_ioctl.h>
#include <sys/rrwlock.h>
Include dependency graph for zfs_vfsops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  zfsvfs
struct  zfid_short
 File IDs for normal filesystems. More...
struct  zfid_long
 File IDs for snapshot filesystems. More...

Defines

#define ZFS_OBJ_MTX_SZ   64
#define SHORT_FID_LEN   (sizeof (zfid_short_t) - sizeof (uint16_t))
#define LONG_FID_LEN   (sizeof (zfid_long_t) - sizeof (uint16_t))

Typedefs

typedef struct zfsvfs zfsvfs_t
typedef struct zfid_short zfid_short_t
 File IDs for normal filesystems.
typedef struct zfid_long zfid_long_t
 File IDs for snapshot filesystems.

Functions

int zfs_suspend_fs (zfsvfs_t *zfsvfs)
 Block out VOPs and close zfsvfs_t::z_os.
int zfs_resume_fs (zfsvfs_t *zfsvfs, const char *osname)
 Reopen zfsvfs_t::z_os and release VOPs.
int zfs_userspace_one (zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, const char *domain, uint64_t rid, uint64_t *valuep)
int zfs_userspace_many (zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, uint64_t *cookiep, void *vbuf, uint64_t *bufsizep)
int zfs_set_userquota (zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, const char *domain, uint64_t rid, uint64_t quota)
boolean_t zfs_owner_overquota (zfsvfs_t *zfsvfs, struct znode *, boolean_t isgroup)
boolean_t zfs_fuid_overquota (zfsvfs_t *zfsvfs, boolean_t isgroup, uint64_t fuid)
int zfs_set_version (zfsvfs_t *zfsvfs, uint64_t newvers)
int zfsvfs_create (const char *name, zfsvfs_t **zfvp)
void zfsvfs_free (zfsvfs_t *zfsvfs)
int zfs_check_global_label (const char *dsname, const char *hexsl)
int zfs_vnode_lock (vnode_t *vp, int flags)
void zfsvfs_update_fromname (const char *oldname, const char *newname)

Variables

uint_t zfs_fsyncer_key
int zfs_super_owner

Define Documentation

#define LONG_FID_LEN   (sizeof (zfid_long_t) - sizeof (uint16_t))

Definition at line 139 of file zfs_vfsops.h.

#define SHORT_FID_LEN   (sizeof (zfid_short_t) - sizeof (uint16_t))

Definition at line 138 of file zfs_vfsops.h.

#define ZFS_OBJ_MTX_SZ   64

Definition at line 85 of file zfs_vfsops.h.


Typedef Documentation

typedef struct zfid_long zfid_long_t

File IDs for snapshot filesystems.

Filesystems under .zfs/snapshot have a total file ID size of 22 bytes (including the length field). This makes files under .zfs/snapshot accessible by NFSv3 and NFSv4, but not NFSv2.

For files under .zfs/snapshot, we partition up the available space as follows: 2 bytes fid length (required) 6 bytes object number (48 bits) 4 bytes generation number (32 bits) 6 bytes objset id (48 bits) 4 bytes currently just zero (32 bits)

We reserve only 48 bits for the object number and objset id, as these are the limits currently defined and imposed by the DMU.

typedef struct zfid_short zfid_short_t

File IDs for normal filesystems.

Normal filesystems (those not under .zfs/snapshot) have a total file ID size limited to 12 bytes (including the length field) due to NFSv2 protocol's limitation of 32 bytes for a filehandle. For historical reasons, this same limit is being imposed by the Solaris NFSv3 implementation (although the NFSv3 protocol actually permits a maximum of 64 bytes). It is not possible to expand beyond 12 bytes without abandoning support of NFSv2.

For normal filesystems, we partition up the available space as follows: 2 bytes fid length (required) 6 bytes object number (48 bits) 4 bytes generation number (32 bits)

We reserve only 48 bits for the object number, as this is the limit currently defined and imposed by the DMU.

typedef struct zfsvfs zfsvfs_t

Definition at line 41 of file zfs_vfsops.h.


Function Documentation

int zfs_check_global_label ( const char *  dsname,
const char *  hexsl 
)
boolean_t zfs_fuid_overquota ( zfsvfs_t zfsvfs,
boolean_t  isgroup,
uint64_t  fuid 
)

Definition at line 801 of file zfs_vfsops.c.

boolean_t zfs_owner_overquota ( zfsvfs_t zfsvfs,
struct znode ,
boolean_t  isgroup 
)

Definition at line 825 of file zfs_vfsops.c.

int zfs_resume_fs ( zfsvfs_t zfsvfs,
const char *  osname 
)

Reopen zfsvfs_t::z_os and release VOPs.

Definition at line 2182 of file zfs_vfsops.c.

int zfs_set_userquota ( zfsvfs_t zfsvfs,
zfs_userquota_prop_t  type,
const char *  domain,
uint64_t  rid,
uint64_t  quota 
)

Definition at line 740 of file zfs_vfsops.c.

int zfs_set_version ( zfsvfs_t zfsvfs,
uint64_t  newvers 
)

Definition at line 2351 of file zfs_vfsops.c.

int zfs_suspend_fs ( zfsvfs_t zfsvfs)

Block out VOPs and close zfsvfs_t::z_os.

Note:
If successful, then we return with the 'z_teardown_lock' and 'z_teardown_inactive_lock' write held.

Definition at line 2167 of file zfs_vfsops.c.

int zfs_userspace_many ( zfsvfs_t zfsvfs,
zfs_userquota_prop_t  type,
uint64_t *  cookiep,
void *  vbuf,
uint64_t *  bufsizep 
)

Definition at line 651 of file zfs_vfsops.c.

int zfs_userspace_one ( zfsvfs_t zfsvfs,
zfs_userquota_prop_t  type,
const char *  domain,
uint64_t  rid,
uint64_t *  valuep 
)

Definition at line 713 of file zfs_vfsops.c.

int zfs_vnode_lock ( vnode_t *  vp,
int  flags 
)

Definition at line 1740 of file zfs_vfsops.c.

int zfsvfs_create ( const char *  name,
zfsvfs_t **  zfvp 
)

Definition at line 841 of file zfs_vfsops.c.

void zfsvfs_free ( zfsvfs_t zfsvfs)

Definition at line 1064 of file zfs_vfsops.c.

void zfsvfs_update_fromname ( const char *  oldname,
const char *  newname 
)

Definition at line 2461 of file zfs_vfsops.c.


Variable Documentation

Definition at line 5408 of file zfs_ioctl.c.

Definition at line 71 of file zfs_vfsops.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines