aboutsummaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-27 19:27:12 -0400
committerIan Moffett <ian@osmora.org>2024-03-27 19:27:12 -0400
commit380da5fe2e8ef39cfca6e92ef53c1b3f44ab77c6 (patch)
tree70c770fd0dd82a173c5da8c0003c9c735dc3910e /sys/include
parent7f27268c86bcb54a79854bb16d3c2631cb10ff80 (diff)
kernel: vfs: Add getattr vop
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/vfs.h1
-rw-r--r--sys/include/sys/vnode.h7
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/include/sys/vfs.h b/sys/include/sys/vfs.h
index b454d39..d79409e 100644
--- a/sys/include/sys/vfs.h
+++ b/sys/include/sys/vfs.h
@@ -52,6 +52,7 @@ int vfs_rootname(const char *path, char **new_path);
bool vfs_is_valid_path(const char *path);
ssize_t vfs_hash_path(const char *path);
ssize_t vfs_read(struct vnode *vp, struct sio_txn *sio);
+int vfs_getattr(struct vnode *vp, struct vattr *vattr);
#endif /* defined(_KERNEL) */
diff --git a/sys/include/sys/vnode.h b/sys/include/sys/vnode.h
index 0352312..ac66044 100644
--- a/sys/include/sys/vnode.h
+++ b/sys/include/sys/vnode.h
@@ -36,11 +36,18 @@
#include <sys/sio.h>
struct vnode;
+struct vattr;
struct vops {
int(*vget)(struct vnode *parent, const char *name, struct vnode **vp);
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);
+};
+
+struct vattr {
+ size_t size; /* File size in bytes */
+ int type; /* Vnode type */
};
struct vnode {