aboutsummaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-19 23:05:21 -0400
committerIan Moffett <ian@osmora.org>2024-05-19 23:05:21 -0400
commit673753e8befcfbb575380ed0d23fc6741b4e50a0 (patch)
tree087ef9499c52523601b8d95d74eec709885a0899 /sys/include
parentf9a6fc6f474ced84a78df50e2b105bd7da052d06 (diff)
kernel: vfs: Add support for open hook
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/device.h1
-rw-r--r--sys/include/sys/vfs.h2
-rw-r--r--sys/include/sys/vnode.h1
3 files changed, 4 insertions, 0 deletions
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 {