⛏️ index : haiku.git

author X512 <danger_mail@list.ru> 2022-11-05 20:13:46.0 +09:00:00
committer waddlesplash <waddlesplash@gmail.com> 2022-12-01 2:09:54.0 +00:00:00
commit
2c6cf678e6aca10bc3357ff225faedf2bc6216ee [patch]
tree
4a4fd4660c8133113c33955da8b50786ce2c980c
parent
1b2c521e914d364d2261e2aef7bf731b2316ca61
download
2c6cf678e6aca10bc3357ff225faedf2bc6216ee.tar.gz

kernel: enable ramfs build and automount to shared_memory directory

This will allow proper operation of POSIX SHM API (shm_open etc.).
Now memory files are stored fully in memory and do not affect disk
storage (except swap if enabled).

Change-Id: Iae3ce1afa968df72e82198e598a273cbf7cb0269
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5802
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
(cherry picked from commit bf2786efaebcda175697936e70d237c5e3ddd38f)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5851

Diff

 build/jam/images/definitions/minimum | 1 +
 src/system/kernel/fs/vfs_boot.cpp    | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/build/jam/images/definitions/minimum b/build/jam/images/definitions/minimum
index 2276fee..f8f1988 100644
--- a/build/jam/images/definitions/minimum
+++ b/build/jam/images/definitions/minimum
@@ -243,6 +243,7 @@
	log_overlay
	ntfs
	packagefs
	ramfs
	reiserfs
	udf
	write_overlay
diff --git a/src/system/kernel/fs/vfs_boot.cpp b/src/system/kernel/fs/vfs_boot.cpp
index 45e7fb7..504d38f 100644
--- a/src/system/kernel/fs/vfs_boot.cpp
+++ b/src/system/kernel/fs/vfs_boot.cpp
@@ -555,6 +555,10 @@
		}
	}

	status = _kern_mount("/boot/system/var/shared_memory", NULL, "ramfs", 0, NULL, 0);
	if (status < B_OK)
		dprintf("Failed to mount shared memory FS: %s\n", strerror(status));

	// Now that packagefs is mounted, the boot volume is really ready.
	gBootDevice = bootDevice;