From 673753e8befcfbb575380ed0d23fc6741b4e50a0 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 19 May 2024 23:05:21 -0400 Subject: kernel: vfs: Add support for open hook Signed-off-by: Ian Moffett --- sys/include/sys/device.h | 1 + sys/include/sys/vfs.h | 2 ++ sys/include/sys/vnode.h | 1 + 3 files changed, 4 insertions(+) (limited to 'sys/include') diff --git a/sys/include/sys/device.h b/sys/include/sys/device.h index 9851ee2..69e367f 100644 --- a/sys/include/sys/device.h +++ b/sys/include/sys/device.h @@ -42,6 +42,7 @@ struct device { int(*write)(struct device *dev, struct sio_txn *sio); int(*read)(struct device *dev, struct sio_txn *sio); int(*ioctl)(struct device *dev, uint32_t cmd, uintptr_t arg); + int(*open)(struct device *dev); paddr_t(*mmap)(struct device *dev, off_t off, vm_prot_t prot); TAILQ_ENTRY(device) link; }; diff --git a/sys/include/sys/vfs.h b/sys/include/sys/vfs.h index f5fede8..98aef3f 100644 --- a/sys/include/sys/vfs.h +++ b/sys/include/sys/vfs.h @@ -56,7 +56,9 @@ ssize_t vfs_hash_path(const char *path); ssize_t vfs_read(struct vnode *vp, struct sio_txn *sio); ssize_t vfs_write(struct vnode *vp, struct sio_txn *sio); + int vfs_getattr(struct vnode *vp, struct vattr *vattr); +int vfs_open(struct vnode *vp); uint64_t sys_mount(struct syscall_args *args); diff --git a/sys/include/sys/vnode.h b/sys/include/sys/vnode.h index 6dc2cbc..71fc5c2 100644 --- a/sys/include/sys/vnode.h +++ b/sys/include/sys/vnode.h @@ -44,6 +44,7 @@ struct vops { int(*read)(struct vnode *vp, struct sio_txn *sio); int(*write)(struct vnode *vp, struct sio_txn *sio); int(*getattr)(struct vnode *vp, struct vattr *vattr); + int(*open)(struct vnode *vp); }; struct vattr { -- cgit v1.2.3