Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ufs/inode.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <ufs/ufs/dinode.h> | #include <ufs/ufs/dinode.h> | ||||
#include <sys/seqc.h> | #include <sys/seqc.h> | ||||
#ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
#include <sys/stack.h> | #include <sys/stack.h> | ||||
#endif | #endif | ||||
#include <sys/buf.h> | |||||
/* | /* | ||||
* This must agree with the definition in <ufs/ufs/dir.h>. | * This must agree with the definition in <ufs/ufs/dir.h>. | ||||
*/ | */ | ||||
#define doff_t int32_t | #define doff_t int32_t | ||||
#ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
struct iown_tracker { | struct iown_tracker { | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | #ifdef DIAGNOSTIC | ||||
int i_lock_gen; | int i_lock_gen; | ||||
struct iown_tracker i_count_tracker; | struct iown_tracker i_count_tracker; | ||||
struct iown_tracker i_endoff_tracker; | struct iown_tracker i_endoff_tracker; | ||||
struct iown_tracker i_offset_tracker; | struct iown_tracker i_offset_tracker; | ||||
#endif | #endif | ||||
int i_nextclustercg; /* last cg searched for cluster */ | int i_nextclustercg; /* last cg searched for cluster */ | ||||
struct vn_clusterw i_clusterw; /* Buffer clustering information */ | |||||
mckusick: Add comment /* Buffer clustering information */ | |||||
/* | /* | ||||
* Data for extended attribute modification. | * Data for extended attribute modification. | ||||
*/ | */ | ||||
u_char *i_ea_area; /* Pointer to malloced copy of EA area */ | u_char *i_ea_area; /* Pointer to malloced copy of EA area */ | ||||
unsigned i_ea_len; /* Length of i_ea_area */ | unsigned i_ea_len; /* Length of i_ea_area */ | ||||
int i_ea_error; /* First errno in transaction */ | int i_ea_error; /* First errno in transaction */ | ||||
int i_ea_refs; /* Number of users of EA area */ | int i_ea_refs; /* Number of users of EA area */ | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | #define UFS_INODE_SET_FLAG_SHARED(ip, flags) do { \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
#define i_dirhash i_un.dirhash | #define i_dirhash i_un.dirhash | ||||
#define i_snapblklist i_un.snapblklist | #define i_snapblklist i_un.snapblklist | ||||
#define i_din1 dinode_u.din1 | #define i_din1 dinode_u.din1 | ||||
#define i_din2 dinode_u.din2 | #define i_din2 dinode_u.din2 | ||||
#ifdef _KERNEL | |||||
#define ITOUMP(ip) ((ip)->i_ump) | #define ITOUMP(ip) ((ip)->i_ump) | ||||
#define ITODEV(ip) (ITOUMP(ip)->um_dev) | #define ITODEV(ip) (ITOUMP(ip)->um_dev) | ||||
#define ITODEVVP(ip) (ITOUMP(ip)->um_devvp) | #define ITODEVVP(ip) (ITOUMP(ip)->um_devvp) | ||||
#define ITOFS(ip) (ITOUMP(ip)->um_fs) | #define ITOFS(ip) (ITOUMP(ip)->um_fs) | ||||
#define ITOVFS(ip) ((ip)->i_vnode->v_mount) | #define ITOVFS(ip) ((ip)->i_vnode->v_mount) | ||||
#ifdef _KERNEL | |||||
static inline _Bool | static inline _Bool | ||||
I_IS_UFS1(const struct inode *ip) | I_IS_UFS1(const struct inode *ip) | ||||
{ | { | ||||
return ((ip->i_flag & IN_UFS2) == 0); | return ((ip->i_flag & IN_UFS2) == 0); | ||||
} | } | ||||
static inline _Bool | static inline _Bool | ||||
I_IS_UFS2(const struct inode *ip) | I_IS_UFS2(const struct inode *ip) | ||||
{ | { | ||||
return ((ip->i_flag & IN_UFS2) != 0); | return ((ip->i_flag & IN_UFS2) != 0); | ||||
} | } | ||||
#endif /* _KERNEL */ | |||||
/* | /* | ||||
* The DIP macro is used to access fields in the dinode that are | * The DIP macro is used to access fields in the dinode that are | ||||
* not cached in the inode itself. | * not cached in the inode itself. | ||||
*/ | */ | ||||
#define DIP(ip, field) (I_IS_UFS1(ip) ? (ip)->i_din1->d##field : \ | #define DIP(ip, field) (I_IS_UFS1(ip) ? (ip)->i_din1->d##field : \ | ||||
(ip)->i_din2->d##field) | (ip)->i_din2->d##field) | ||||
#define DIP_SET(ip, field, val) do { \ | #define DIP_SET(ip, field, val) do { \ | ||||
Show All 31 Lines | |||||
/* This overlays the fid structure (see mount.h). */ | /* This overlays the fid structure (see mount.h). */ | ||||
struct ufid { | struct ufid { | ||||
u_int16_t ufid_len; /* Length of structure. */ | u_int16_t ufid_len; /* Length of structure. */ | ||||
u_int16_t ufid_pad; /* Force 32-bit alignment. */ | u_int16_t ufid_pad; /* Force 32-bit alignment. */ | ||||
uint32_t ufid_ino; /* File number (ino). */ | uint32_t ufid_ino; /* File number (ino). */ | ||||
uint32_t ufid_gen; /* Generation number. */ | uint32_t ufid_gen; /* Generation number. */ | ||||
}; | }; | ||||
#ifdef _KERNEL | |||||
#ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
void ufs_init_trackers(struct inode *ip); | void ufs_init_trackers(struct inode *ip); | ||||
void ufs_unlock_tracker(struct inode *ip); | void ufs_unlock_tracker(struct inode *ip); | ||||
doff_t ufs_get_i_offset(struct inode *ip, const char *file, int line); | doff_t ufs_get_i_offset(struct inode *ip, const char *file, int line); | ||||
void ufs_set_i_offset(struct inode *ip, doff_t off, const char *file, int line); | void ufs_set_i_offset(struct inode *ip, doff_t off, const char *file, int line); | ||||
#define I_OFFSET(ip) ufs_get_i_offset(ip, __FILE__, __LINE__) | #define I_OFFSET(ip) ufs_get_i_offset(ip, __FILE__, __LINE__) | ||||
#define SET_I_OFFSET(ip, off) ufs_set_i_offset(ip, off, __FILE__, __LINE__) | #define SET_I_OFFSET(ip, off) ufs_set_i_offset(ip, off, __FILE__, __LINE__) | ||||
Show All 23 Lines |
Add comment /* Buffer clustering information */