1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 06:15:07 +00:00

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.
This commit is contained in:
Andreas Kling 2018-10-29 21:54:11 +01:00
parent bea106fdb2
commit e6284a8774
24 changed files with 195 additions and 77 deletions

View file

@ -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;
}