Aquila
Aquila copied to clipboard
changed fds to array of pointers
~~added fd_count
to count the number of childs or others who are using the fd, so won't deallocate it unless no one is using it.~~
still working on it to enhance it
You can't use inode->ref
because multiple file descriptors can point to the same inode, use file->ref
instead. Some parts need to be reworked, but overall, good work.
And Nagy, consistency, please :"D
Yea I was going through the code to understand more, at first I used fd_count, but okay I will rename it to ref if that matches the consistency 😂 And really I try my best to match with your code style, And we can make a test for that if possible would be great :'D
I was thinking about caching the fd instead of kfree it, for not wasting a lot of time allocating and deallocating
@nagyation caching is only effective if the resource is used frequently, applications don't usually open/close files 1000 times a second, so caching would be an over complication, and mostly a waste.
Also we would use SLxB allocator later, the caching would be embedded in the allocator itself for many object types.
About ref, it's literally there :"D I was gonna do it but had more important stuff to work on :"D
@mohamed-anwar check it now :thinking:
@nagyation checked it, will pull it when I push my local changes. Nice work!