From 8efd2fc0e3ebf413eca95ab647518db7c1a38a9f Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 13 Oct 2022 13:31:45 -0300 Subject: [PATCH] devfs and tmpfs: don't have all files have the same inode --- src/fs/devfs.c | 1 + src/fs/tmpfs.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/fs/devfs.c b/src/fs/devfs.c index c0e5afe7..aed19d1d 100644 --- a/src/fs/devfs.c +++ b/src/fs/devfs.c @@ -103,6 +103,7 @@ int devfs_newdevice(char* name, int type, dev_t dev, mode_t mode){ node->st.st_rdev = dev; node->st.st_mode = MAKETYPE(type) | mode; + node->st.st_ino = fs->data; return 0; diff --git a/src/fs/tmpfs.c b/src/fs/tmpfs.c index 921b1e3e..18c2b901 100644 --- a/src/fs/tmpfs.c +++ b/src/fs/tmpfs.c @@ -91,6 +91,7 @@ static int tmpfs_mkdir(dirnode_t* parent, char* name, mode_t mode){ st->st_mode = MAKETYPE(TYPE_DIR) | mode; st->st_blksize = PAGE_SIZE; + st->st_ino = parent->vnode.fs->data++; return 0; @@ -124,6 +125,7 @@ static int tmpfs_create(dirnode_t* parent, char* name, mode_t mode){ st->st_blocks = 1; st->st_mode = MAKETYPE(TYPE_REGULAR) | mode; st->st_nlink = 1; + st->st_ino = parent->vnode.fs->data++; return 0;