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 */
#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.
*/
#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
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));
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 */