Aquila icon indicating copy to clipboard operation
Aquila copied to clipboard

changed fds to array of pointers

Open nagyation opened this issue 6 years ago • 6 comments

~~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

nagyation avatar May 22 '18 15:05 nagyation

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

thethumbler avatar May 22 '18 23:05 thethumbler

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

nagyation avatar May 23 '18 01:05 nagyation

I was thinking about caching the fd instead of kfree it, for not wasting a lot of time allocating and deallocating

nagyation avatar May 23 '18 01:05 nagyation

@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

thethumbler avatar May 23 '18 02:05 thethumbler

@mohamed-anwar check it now :thinking:

nagyation avatar May 27 '18 13:05 nagyation

@nagyation checked it, will pull it when I push my local changes. Nice work!

thethumbler avatar May 27 '18 17:05 thethumbler