2.4 Q: list of open files per inode?
How can a device driver go over the list of all the files that are open on a specific inode instance?
I'd like to avoid doing my own housekeeping.
The question is about 2.4 kernel.
Thanks,
Jacob
Quoted 3 lines · Jacob A
How can a device driver go over the list of all the files that are open on a specific inode instance?
pseudo-code:
task_list_lock;
for each process; do
lock_fdtable; for each filedescriptor; do do_something(fd->file_ptr); unlock_fdtable;
task_list_unlock;
Though, you really don't want to do that.
Jan
Quoted 8 lines · Jan Engelhardt
Quoted 3 lines · Jacob A
How can a device driver go over the list of all the files that are open on a specific inode instance?
pseudo-code:
Quoted 7 lines
task_list_lock;
for each process; dolock_fdtable; for each filedescriptor; do do_something(fd->file_ptr); unlock_fdtable;
task_list_unlock;
Not again...
There are other things that can keep file open. SCM_RIGHTS, references held by syscall in progress, etc., etc.
The real question is why does driver want to do that? Details, please...