summaryrefslogtreecommitdiff
path: root/VirtualFileSystem/SyntheticFileSystem.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-29 21:54:11 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-10-29 22:04:26 +0100
commite6284a8774b387ec23cda03b2af0ba3dcc09286f (patch)
treeb92a7dcae807f4b5c086f6f23f06748bf6181956 /VirtualFileSystem/SyntheticFileSystem.cpp
parentbea106fdb2fa29be294e088189aafcd19eb83be3 (diff)
downloadserenity-e6284a8774b387ec23cda03b2af0ba3dcc09286f.zip
Fix broken SpinLock.
The SpinLock was all backwards and didn't actually work. Fixing it exposed how wrong most of the locking here is. I need to come up with a better granularity here.
Diffstat (limited to 'VirtualFileSystem/SyntheticFileSystem.cpp')
-rw-r--r--VirtualFileSystem/SyntheticFileSystem.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/VirtualFileSystem/SyntheticFileSystem.cpp b/VirtualFileSystem/SyntheticFileSystem.cpp
index db8b34e8d5..743e10a3d5 100644
--- a/VirtualFileSystem/SyntheticFileSystem.cpp
+++ b/VirtualFileSystem/SyntheticFileSystem.cpp
@@ -2,6 +2,11 @@
#include "FileHandle.h"
#include <AK/StdLib.h>
+#ifndef SERENITY
+typedef int InterruptDisabler;
+#define ASSERT_INTERRUPTS_DISABLED()
+#endif
+
//#define SYNTHFS_DEBUG
RetainPtr<SyntheticFileSystem> SyntheticFileSystem::create()
@@ -31,11 +36,10 @@ bool SyntheticFileSystem::initialize()
rootDir->metadata.mtime = mepoch;
m_inodes.set(RootInodeIndex, move(rootDir));
-#if 0
#ifndef SERENITY
addFile(createTextFile("file", "I'm a synthetic file!\n"));
addFile(createTextFile("message", "Hey! This isn't my bottle!\n"));
-#endif
+ addFile(createGeneratedFile("lunk", [] { return String("/home/andreas/file1").toByteBuffer(); }, 00120777));
#endif
return true;
}
@@ -60,7 +64,7 @@ auto SyntheticFileSystem::createTextFile(String&& name, String&& text) -> OwnPtr
file->metadata.size = file->data.size();
file->metadata.uid = 100;
file->metadata.gid = 200;
- file->metadata.mode = 0040644;
+ file->metadata.mode = 0010644;
file->metadata.mtime = mepoch;
return file;
}