X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/de355530ae67247cbd0da700edb3a2a1dae884c2..483a1d1004b64bbaaef2c64c17c6b999009a54d2:/bsd/sys/vnode.h?ds=sidebyside diff --git a/bsd/sys/vnode.h b/bsd/sys/vnode.h index 5023c875c..a6f13a11b 100644 --- a/bsd/sys/vnode.h +++ b/bsd/sys/vnode.h @@ -140,11 +140,12 @@ struct vnode { struct socket *vu_socket; /* unix ipc (VSOCK) */ struct specinfo *vu_specinfo; /* device (VCHR, VBLK) */ struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */ + char *vu_name; /* name (only for VREG) */ } v_un; struct ubc_info *v_ubcinfo; /* valid for (VREG) */ struct nqlease *v_lease; /* Soft reference to lease */ - daddr_t v_lastw; /* last write (write cluster) */ - daddr_t v_cstart; /* start block of cluster */ + void *v_scmap; /* pointer to sparse cluster map */ + int v_scdirty; /* number of dirty pages in the sparse cluster map */ daddr_t v_ciosiz; /* real size of I/O for cluster */ int v_clen; /* length of current cluster */ int v_ralen; /* Read-ahead length */ @@ -166,6 +167,11 @@ struct vnode { #define v_specinfo v_un.vu_specinfo #define v_fifoinfo v_un.vu_fifoinfo +// NOTE: Do not use these macros. They are for vfs internal use only. +#define VNAME(vp) ((char *)((vp)->v_type == VREG ? (vp)->v_un.vu_name : (vp)->v_scmap)) +#define VPARENT(vp) ((struct vnode *)((vp)->v_type == VREG ? (vp)->v_un1.v_cl.v_pad : (vp)->v_scdirty)) + + /* * Vnode flags. */ @@ -195,7 +201,9 @@ struct vnode { #define VTHROTTLED 0x400000 /* writes or pageouts have been throttled */ /* wakeup tasks waiting when count falls below threshold */ #define VNOFLUSH 0x800000 /* don't vflush() if SKIPSYSTEM */ - +#define VDELETED 0x1000000 /* this vnode is being deleted */ +#define VFULLFSYNC 0x2000000 /* ask the drive to write the data to the media */ +#define VHASBEENPAGED 0x4000000 /* vnode has been recently paged to */ /* * Vnode attributes. A field value of VNOVAL represents a field whose value @@ -502,6 +510,10 @@ int vn_close __P((struct vnode *vp, int flags, struct ucred *cred, struct proc *p)); int vn_lock __P((struct vnode *vp, int flags, struct proc *p)); int vn_open __P((struct nameidata *ndp, int fmode, int cmode)); +#ifndef __APPLE_API_PRIVATE +__private_extern__ int + vn_open_modflags __P((struct nameidata *ndp, int *fmode, int cmode)); +#endif /* __APPLE_API_PRIVATE */ int vn_rdwr __P((enum uio_rw rw, struct vnode *vp, caddr_t base, int len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *cred, int *aresid, struct proc *p)); @@ -517,7 +529,7 @@ void vrele __P((struct vnode *vp)); int vaccess __P((mode_t file_mode, uid_t uid, gid_t gid, mode_t acc_mode, struct ucred *cred)); int getvnode __P((struct proc *p, int fd, struct file **fpp)); -#endif __APPLE_API_EVOLVING +#endif /* __APPLE_API_EVOLVING */ #endif /* KERNEL */