diff options
Diffstat (limited to 'src/sys/include/os/vnode.h')
-rw-r--r-- | src/sys/include/os/vnode.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/sys/include/os/vnode.h b/src/sys/include/os/vnode.h index 868e137..1bef1e2 100644 --- a/src/sys/include/os/vnode.h +++ b/src/sys/include/os/vnode.h @@ -72,11 +72,13 @@ struct vop_lookup_args { * * @data: Buffer containing I/O data * @len: Length of buffer + * @off: Offset of operation * @vp: Current vnode */ struct vop_rw_data { void *data; size_t len; + off_t off; struct vnode *vp; }; @@ -86,6 +88,7 @@ struct vop_rw_data { */ struct vop { int(*lookup)(struct vop_lookup_args *args); + int(*reclaim)(struct vnode *vp, int flags); ssize_t(*write)(struct vop_rw_data *data); ssize_t(*read)(struct vop_rw_data *data); }; @@ -141,23 +144,36 @@ int vfs_vrel(struct vnode *vp, int flags); * * @vp: Vnode to write to * @data: Data to write + * @off: Offset to write at * @len: Length of bytes to write * * Returns the number of bytes written on success, otherwise * a less than zero value on failure. */ -ssize_t vop_write(struct vnode *vp, char *data, size_t len); +ssize_t vop_write(struct vnode *vp, char *data, off_t off, size_t len); /* * Wrapper for the read write callback * * @vp: Vnode to read from * @data: Read data written here + * @off: Offset to read at * @len: Length of bytes to read * * Returns the number of bytes read on success, otherwise * a less than zero value on failure. */ -ssize_t vop_read(struct vnode *vp, char *data, size_t len); +ssize_t vop_read(struct vnode *vp, char *data, off_t off, size_t len); + +/* + * Reclaim the resources tied to a specific vnode + * + * @vp: Vnode to reclaim + * @flags: Optional flags + * + * Returns zero on success, otherwise a less than zero value + * on failure. + */ +int vop_reclaim(struct vnode *vp, int flags); #endif /* !_OS_VNODE_H_ */ |