From 2df3bcd48260e3038cc3a84d244e3814c8debc0e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 21 Sep 2025 20:11:58 -0400 Subject: kern: vfs: Add support for image-like paths Typically filesystems are tree-like, however certain filesystems in the form of images have fixed paths baked into them. This optimizes handling so there isn't a need to unpack it into a rootfs/tmpfs Signed-off-by: Ian Moffett --- src/sys/include/sys/mount.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/sys/include') diff --git a/src/sys/include/sys/mount.h b/src/sys/include/sys/mount.h index c93eb2b..c9f686c 100644 --- a/src/sys/include/sys/mount.h +++ b/src/sys/include/sys/mount.h @@ -48,6 +48,7 @@ #define MOUNT_INITRD "initrd" /* Initial ramdisk */ /* Forward declarations */ +struct fs_info; struct vfsops; struct mount; @@ -58,11 +59,13 @@ extern struct vfsops g_omar_vfsops; * Represents a mountpoint * * @vp: Vnode of mount + * @fs: The filesystem backing this mountpoint * @name: Mountname * @link: TAILQ link */ struct mount { struct vnode *vp; + struct fs_info *fs; char name[FSNAME_MAX]; TAILQ_ENTRY(mount) link; }; @@ -98,14 +101,26 @@ struct mount_args { * * @name: Filesystem type name * @vfsops: VFS operations vector + * @attr: Attribute mask that may be set by fs * @refcount: Mount count of this type + * + * XXX: The attributes mask is set by the filesystem and + * intended as an optimization to provide a way for + * filesystems set flags to modify behavior during + * things like the lookup stage. */ struct fs_info { char name[FSNAME_MAX]; const struct vfsops *vfsops; + uint16_t attr; int refcount; }; +/* + * Filesystem attributes mask + */ +#define FS_ATTR_IMAGE BIT (0) /* Is an image kind e.g., OSMORA OMAR */ + /* * VFS operations vector * -- cgit v1.2.3