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

sys/zfs_sa.h File Reference

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

Go to the source code of this file.

Data Structures

struct  znode_phys
 This is a deprecated data structure that only exists for dealing with file systems create prior to ZPL version 5. More...

Defines

#define ZFS_OLD_ZNODE_PHYS_SIZE   0x108
#define ZFS_SA_BASE_ATTR_SIZE
#define SA_MODE_OFFSET   0
#define SA_SIZE_OFFSET   8
#define SA_GEN_OFFSET   16
#define SA_UID_OFFSET   24
#define SA_GID_OFFSET   32
#define SA_PARENT_OFFSET   40

Typedefs

typedef enum zpl_attr zpl_attr_t
 List of attributes known to the ZPL.
typedef struct znode_phys znode_phys_t
 This is a deprecated data structure that only exists for dealing with file systems create prior to ZPL version 5.

Enumerations

enum  zpl_attr {
  ZPL_ATIME, ZPL_MTIME, ZPL_CTIME, ZPL_CRTIME,
  ZPL_GEN, ZPL_MODE, ZPL_SIZE, ZPL_PARENT,
  ZPL_LINKS, ZPL_XATTR, ZPL_RDEV, ZPL_FLAGS,
  ZPL_UID, ZPL_GID, ZPL_PAD, ZPL_ZNODE_ACL,
  ZPL_DACL_COUNT, ZPL_SYMLINK, ZPL_SCANSTAMP, ZPL_DACL_ACES,
  ZPL_END
}
 

List of attributes known to the ZPL.

More...

Functions

int zfs_sa_readlink (struct znode *, uio_t *)
void zfs_sa_symlink (struct znode *, char *link, int len, dmu_tx_t *)
void zfs_sa_upgrade (struct sa_handle *, dmu_tx_t *)
 I'm not convinced we should do any of this upgrade.
void zfs_sa_get_scanstamp (struct znode *, xvattr_t *)
void zfs_sa_set_scanstamp (struct znode *, xvattr_t *, dmu_tx_t *)
void zfs_sa_uprade_pre (struct sa_handle *, void *, dmu_tx_t *)
void zfs_sa_upgrade_post (struct sa_handle *, void *, dmu_tx_t *)
void zfs_sa_upgrade_txholds (dmu_tx_t *, struct znode *)

Variables

sa_attr_reg_t zfs_attr_table [ZPL_END+1]
 ZPL attribute registration table.
sa_attr_reg_t zfs_legacy_attr_table [ZPL_END+1]

Define Documentation

#define SA_GEN_OFFSET   16

Definition at line 85 of file zfs_sa.h.

#define SA_GID_OFFSET   32

Definition at line 87 of file zfs_sa.h.

#define SA_MODE_OFFSET   0

Definition at line 83 of file zfs_sa.h.

#define SA_PARENT_OFFSET   40

Definition at line 88 of file zfs_sa.h.

#define SA_SIZE_OFFSET   8

Definition at line 84 of file zfs_sa.h.

#define SA_UID_OFFSET   24

Definition at line 86 of file zfs_sa.h.

#define ZFS_OLD_ZNODE_PHYS_SIZE   0x108

Definition at line 79 of file zfs_sa.h.

#define ZFS_SA_BASE_ATTR_SIZE
Value:

Definition at line 80 of file zfs_sa.h.


Typedef Documentation

typedef struct znode_phys znode_phys_t

This is a deprecated data structure that only exists for dealing with file systems create prior to ZPL version 5.

Data may pad out any remaining bytes in the znode buffer, eg:

 
  |<---------------------- dnode_phys (512) ------------------------>|
  |<-- dnode (192) --->|<----------- "bonus" buffer (320) ---------->|
 			|<---- znode (264) ---->|<---- data (56) ---->|
 
 

At present, we use this space for the following:

  • symbolic links
  • 32-byte anti-virus scanstamp (regular files only)
typedef enum zpl_attr zpl_attr_t

List of attributes known to the ZPL.

The values of the actual attributes are not defined by the order the enums. It is controlled by the attribute registration mechanism. Two different file systems could have different numeric values for the same attributes. This list is only used for dereferencing into the table that will hold the actual numeric value.


Enumeration Type Documentation

enum zpl_attr

List of attributes known to the ZPL.

The values of the actual attributes are not defined by the order the enums. It is controlled by the attribute registration mechanism. Two different file systems could have different numeric values for the same attributes. This list is only used for dereferencing into the table that will hold the actual numeric value.

Enumerator:
ZPL_ATIME 
ZPL_MTIME 
ZPL_CTIME 
ZPL_CRTIME 
ZPL_GEN 
ZPL_MODE 
ZPL_SIZE 
ZPL_PARENT 
ZPL_LINKS 
ZPL_XATTR 
ZPL_RDEV 
ZPL_FLAGS 
ZPL_UID 
ZPL_GID 
ZPL_PAD 
ZPL_ZNODE_ACL 
ZPL_DACL_COUNT 
ZPL_SYMLINK 
ZPL_SCANSTAMP 
ZPL_DACL_ACES 
ZPL_END 

Definition at line 55 of file zfs_sa.h.


Function Documentation

void zfs_sa_get_scanstamp ( struct znode ,
xvattr_t *   
)

Definition at line 123 of file zfs_sa.c.

int zfs_sa_readlink ( struct znode ,
uio_t *   
)

Definition at line 72 of file zfs_sa.c.

void zfs_sa_set_scanstamp ( struct znode ,
xvattr_t *  ,
dmu_tx_t  
)

Definition at line 157 of file zfs_sa.c.

void zfs_sa_symlink ( struct znode ,
char *  link,
int  len,
dmu_tx_t  
)

Definition at line 96 of file zfs_sa.c.

void zfs_sa_upgrade ( sa_handle_t hdl,
dmu_tx_t tx 
)

I'm not convinced we should do any of this upgrade.

since the SA code can read both old/new znode formats with probably little to no performance difference.

All new files will be created with the new format.

Definition at line 196 of file zfs_sa.c.

void zfs_sa_upgrade_post ( struct sa_handle ,
void *  ,
dmu_tx_t  
)
void zfs_sa_upgrade_txholds ( dmu_tx_t ,
struct znode  
)

Definition at line 320 of file zfs_sa.c.

void zfs_sa_uprade_pre ( struct sa_handle ,
void *  ,
dmu_tx_t  
)

Variable Documentation

ZPL attribute registration table.

Order of attributes doesn't matter a unique value will be assigned for each attribute that is file system specific

This is just the set of ZPL attributes that this version of ZFS deals with natively. The file system could have other attributes stored in files, but they will be ignored. The SA framework will preserve them, just that this version of ZFS won't change or delete them.

Definition at line 45 of file zfs_sa.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines