devfs and tmpfs: don't have all files have the same inode

This commit is contained in:
Matheus
2022-10-13 13:31:45 -03:00
parent 36850332e4
commit 8efd2fc0e3
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -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;
+2
View File
@@ -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;