ext2: extend inode block searching
This commit is contained in:
parent
9aea93214a
commit
4c040f280f
4 changed files with 129 additions and 23 deletions
5
fs/vfs.c
5
fs/vfs.c
|
|
@ -72,11 +72,14 @@ int open(const char *pathname, int flags)
|
|||
if (result < 0) {
|
||||
kprintf(LOG_ERROR "Failed to open %s\n", pathname);
|
||||
return result;
|
||||
} else if (result == VFSE_IS_BDEV) {
|
||||
/* TODO: continue search into mounted filesystems */
|
||||
}
|
||||
|
||||
/* add the file descriptor to the tree */
|
||||
fd->fd = fd_counter;
|
||||
fd->fs = rootfs;
|
||||
fd->file = file;
|
||||
fd_counter += 1;
|
||||
|
||||
struct rbnode *fdnode = rbt_insert(kfd, fd->fd);
|
||||
|
|
@ -89,7 +92,7 @@ int close(int fd)
|
|||
{
|
||||
struct rbnode *fdnode = rbt_search(kfd, fd);
|
||||
|
||||
if (!fdnode)
|
||||
if (!fdnode)
|
||||
return -EBADF;
|
||||
|
||||
struct file_descriptor *fdesc = (struct file_descriptor *)fdnode->value;
|
||||
|
|
|
|||
Loading…
Reference in a new issue