#ifndef _SYS_FS_PC_NODE_H
#define _SYS_FS_PC_NODE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <vm/page.h>
#include <sys/buf.h>
#include <sys/vnode.h>
#ifdef _KERNEL
#include <sys/vfs_opreg.h>
#endif
struct pc_fid {
ushort_t pcfid_len;
uint32_t pcfid_block;
uint16_t pcfid_offset;
uint16_t pcfid_ctime;
};
struct pcnode {
struct pcnode *pc_forw;
struct pcnode *pc_back;
int pc_flags;
struct vnode *pc_vn;
uint_t pc_size;
pc_cluster32_t pc_scluster;
daddr_t pc_eblkno;
int pc_eoffset;
struct pcdir pc_entry;
pc_cluster32_t pc_lcluster;
daddr_t pc_lindex;
};
#define PC_MOD 0x01
#define PC_CHG 0x02
#define PC_INVAL 0x04
#define PC_EXTERNAL 0x08
#define PC_ACC 0x10
#define PC_RELEHOLD 0x80
#define PCTOV(PCP) ((PCP)->pc_vn)
#define VTOPC(VP) ((struct pcnode *)((VP)->v_data))
#define pc_makenodeid(BN, OFF, ATTR, SCLUSTER, ENTPS) \
(ino_t)((ATTR) & PCA_DIR ? \
(uint32_t)(-(SCLUSTER) - 1) : \
((BN) * (ENTPS)) + ((OFF) / sizeof (struct pcdir)))
#define NPCHASH 1
#if NPCHASH == 1
#define PCFHASH(FSP, BN, O) 0
#define PCDHASH(FSP, SC) 0
#else
#define PCFHASH(FSP, BN, O) (((unsigned)FSP + BN + O) % NPCHASH)
#define PCDHASH(FSP, SC) (((unsigned)FSP + SC) % NPCHASH)
#endif
struct pchead {
struct pcnode *pch_forw;
struct pcnode *pch_back;
};
extern struct vnodeops *pcfs_fvnodeops;
extern struct vnodeops *pcfs_dvnodeops;
#ifdef _KERNEL
extern const struct fs_operation_def pcfs_fvnodeops_template[];
extern const struct fs_operation_def pcfs_dvnodeops_template[];
#endif
extern struct pchead pcfhead[];
extern struct pchead pcdhead[];
extern void pc_init(void);
extern struct pcnode *pc_getnode(struct pcfs *, daddr_t, int, struct pcdir *);
extern void pc_rele(struct pcnode *);
extern void pc_mark_mod(struct pcfs *, struct pcnode *);
extern void pc_mark_acc(struct pcfs *, struct pcnode *);
extern int pc_nodesync(struct pcnode *);
extern int pc_nodeupdate(struct pcnode *);
extern int pc_bmap(struct pcnode *, daddr_t, daddr_t *, uint_t *);
extern int pc_balloc(struct pcnode *, daddr_t, int, daddr_t *);
extern int pc_bfree(struct pcnode *, pc_cluster32_t);
extern int pc_verify(struct pcfs *);
extern void pc_diskchanged(struct pcfs *);
extern void pc_mark_irrecov(struct pcfs *);
extern int pc_dirlook(struct pcnode *, char *, struct pcnode **);
extern int pc_direnter(struct pcnode *, char *, struct vattr *,
struct pcnode **);
extern int pc_dirremove(struct pcnode *, char *, struct vnode *, enum vtype,
caller_context_t *);
extern int pc_rename(struct pcnode *, struct pcnode *, char *, char *,
caller_context_t *);
extern int pc_blkatoff(struct pcnode *, offset_t, struct buf **,
struct pcdir **);
extern int pc_truncate(struct pcnode *, uint_t);
extern int pc_fileclsize(struct pcfs *, pc_cluster32_t, pc_cluster32_t *);
extern int pcfs_putapage(struct vnode *, page_t *, u_offset_t *, size_t *, int,
struct cred *);
extern void pc_badfs(struct pcfs *);
#ifdef __cplusplus
}
#endif
#endif