forked from Bananymous/banan-os
Kernel: Changed stat values from func to be field
- Removed virtual functions for all of the stat stuff. This did however introduce some issues, mainly with /proc becoming out of sync if you changed your ID. I propose we do the linux thing and just have a stat update function which is optional, but allows dynamic updates of stat fields for cases such as those in uid/gid in /proc. - Simplified the API, although still kind of annoying it is a bit simpler. - Moved some of the FS structure from having the FS inode inside the in memory inode to a Serialise <-> Deserialise model where Inodes are deserialised from disk into in memory ones and then back into on disk ones when it comes time for syncing. This makes it semantically better in my opinion, as it explicitly separates disk and non-disk functionality.
This commit is contained in:
@@ -18,20 +18,6 @@ namespace Kernel
|
||||
void on_close(int status_flags) override;
|
||||
void on_clone(int status_flags) override;
|
||||
|
||||
virtual ino_t ino() const override { return 0; } // FIXME
|
||||
virtual Mode mode() const override { return { Mode::IFIFO | Mode::IRUSR | Mode::IWUSR }; }
|
||||
virtual nlink_t nlink() const override { return 1; }
|
||||
virtual uid_t uid() const override { return m_uid; }
|
||||
virtual gid_t gid() const override { return m_gid; }
|
||||
virtual off_t size() const override { return 0; }
|
||||
virtual timespec atime() const override { return m_atime; }
|
||||
virtual timespec mtime() const override { return m_mtime; }
|
||||
virtual timespec ctime() const override { return m_ctime; }
|
||||
virtual blksize_t blksize() const override { return 4096; }
|
||||
virtual blkcnt_t blocks() const override { return 0; }
|
||||
virtual dev_t dev() const override { return 0; } // FIXME
|
||||
virtual dev_t rdev() const override { return 0; } // FIXME
|
||||
|
||||
virtual const FileSystem* filesystem() const override { return nullptr; }
|
||||
|
||||
protected:
|
||||
@@ -50,12 +36,6 @@ namespace Kernel
|
||||
Pipe(const Credentials&);
|
||||
|
||||
private:
|
||||
const uid_t m_uid;
|
||||
const gid_t m_gid;
|
||||
timespec m_atime {};
|
||||
timespec m_mtime {};
|
||||
timespec m_ctime {};
|
||||
|
||||
Mutex m_mutex;
|
||||
ThreadBlocker m_thread_blocker;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user