mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
devfs and tmpfs: don't have all files have the same inode
This commit is contained in:
@@ -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_rdev = dev;
|
||||||
node->st.st_mode = MAKETYPE(type) | mode;
|
node->st.st_mode = MAKETYPE(type) | mode;
|
||||||
|
node->st.st_ino = fs->data;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@@ -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_mode = MAKETYPE(TYPE_DIR) | mode;
|
||||||
st->st_blksize = PAGE_SIZE;
|
st->st_blksize = PAGE_SIZE;
|
||||||
|
st->st_ino = parent->vnode.fs->data++;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -124,6 +125,7 @@ static int tmpfs_create(dirnode_t* parent, char* name, mode_t mode){
|
|||||||
st->st_blocks = 1;
|
st->st_blocks = 1;
|
||||||
st->st_mode = MAKETYPE(TYPE_REGULAR) | mode;
|
st->st_mode = MAKETYPE(TYPE_REGULAR) | mode;
|
||||||
st->st_nlink = 1;
|
st->st_nlink = 1;
|
||||||
|
st->st_ino = parent->vnode.fs->data++;
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user