Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ufs/inode.h
Show All 38 Lines | |||||
#ifndef _UFS_UFS_INODE_H_ | #ifndef _UFS_UFS_INODE_H_ | ||||
#define _UFS_UFS_INODE_H_ | #define _UFS_UFS_INODE_H_ | ||||
#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 | |||||
#include <sys/stack.h> | |||||
#endif | |||||
/* | /* | ||||
* 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 | |||||
struct iown_tracker { | |||||
struct thread *tr_owner; | |||||
struct stack tr_st; | |||||
struct stack tr_unlock; | |||||
int tr_gen; | |||||
}; | |||||
#endif | |||||
/* | /* | ||||
* The inode is used to describe each active (or recently active) file in the | * The inode is used to describe each active (or recently active) file in the | ||||
* UFS filesystem. It is composed of two types of information. The first part | * UFS filesystem. It is composed of two types of information. The first part | ||||
* is the information that is needed only while the file is active (such as | * is the information that is needed only while the file is active (such as | ||||
* the identity of the file and linkage to speed its lookup). The second part | * the identity of the file and linkage to speed its lookup). The second part | ||||
* is the permanent meta-data associated with the file which is read in | * is the permanent meta-data associated with the file which is read in | ||||
* from the permanent dinode from long term storage when the file becomes | * from the permanent dinode from long term storage when the file becomes | ||||
* active, and is put back when the file is no longer being used. | * active, and is put back when the file is no longer being used. | ||||
Show All 28 Lines | struct inode { | ||||
/* | /* | ||||
* Side effects; used during directory lookup. | * Side effects; used during directory lookup. | ||||
*/ | */ | ||||
int32_t i_count; /* Size of free slot in directory. */ | int32_t i_count; /* Size of free slot in directory. */ | ||||
doff_t i_endoff; /* End of useful stuff in directory. */ | doff_t i_endoff; /* End of useful stuff in directory. */ | ||||
doff_t i_diroff; /* Offset in dir, where we found last entry. */ | doff_t i_diroff; /* Offset in dir, where we found last entry. */ | ||||
doff_t i_offset; /* Offset of free space in directory. */ | doff_t i_offset; /* Offset of free space in directory. */ | ||||
#ifdef DIAGNOSTIC | |||||
int i_lock_gen; | |||||
struct iown_tracker i_count_tracker; | |||||
struct iown_tracker i_endoff_tracker; | |||||
struct iown_tracker i_offset_tracker; | |||||
#endif | |||||
int i_nextclustercg; /* last cg searched for cluster */ | int i_nextclustercg; /* last cg searched for cluster */ | ||||
/* | /* | ||||
* 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 */ | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 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 DIAGNOSTIC | |||||
void ufs_init_trackers(struct inode *ip); | |||||
void ufs_unlock_tracker(struct inode *ip); | |||||
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); | |||||
#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__) | |||||
int32_t ufs_get_i_count(struct inode *ip, const char *file, int line); | |||||
void ufs_set_i_count(struct inode *ip, int32_t cnt, const char *file, int line); | |||||
#define I_COUNT(ip) ufs_get_i_count(ip, __FILE__, __LINE__) | |||||
#define SET_I_COUNT(ip, cnt) ufs_set_i_count(ip, cnt, __FILE__, __LINE__) | |||||
doff_t ufs_get_i_endoff(struct inode *ip, const char *file, int line); | |||||
void ufs_set_i_endoff(struct inode *ip, doff_t off, const char *file, int line); | |||||
#define I_ENDOFF(ip) ufs_get_i_endoff(ip, __FILE__, __LINE__) | |||||
#define SET_I_ENDOFF(ip, off) ufs_set_i_endoff(ip, off, __FILE__, __LINE__) | |||||
#else | |||||
#define I_OFFSET(ip) ((ip)->i_offset) | |||||
#define SET_I_OFFSET(ip, off) ((ip)->i_offset = (off)) | |||||
#define I_COUNT(ip) ((ip)->i_count) | |||||
#define SET_I_COUNT(ip, cnt) ((ip)->i_count = cnt) | |||||
#define I_ENDOFF(ip) ((ip)->i_endoff) | |||||
#define SET_I_ENDOFF(ip, off) ((ip)->i_endoff = off) | |||||
#endif | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* !_UFS_UFS_INODE_H_ */ | #endif /* !_UFS_UFS_INODE_H_ */ |