Messages in this thread | | | Date | Sun, 22 Jul 2007 04:39:14 -0700 (PDT) | From | Jacob A <> | Subject | Re: 2.4 Q: list of open files per inode? |
| |
Al,
I'm using the open/close call as a way for processes to register/unregister with a watchdog driver that I'm writing. I thought that I can save the housekeeping within the driver, but it looks like It would be easier just to maintain my own list and be done with it.
Jacob
----- Original Message ---- From: Al Viro <viro@ftp.linux.org.uk> To: Jan Engelhardt <jengelh@computergmbh.de> Cc: Jacob A <jacoba51-tmp@yahoo.com>; linux-kernel@vger.kernel.org Sent: Thursday, July 19, 2007 7:38:10 PM Subject: Re: 2.4 Q: list of open files per inode?
On Thu, Jul 19, 2007 at 01:41:03PM +0200, Jan Engelhardt wrote: > > On Jul 19 2007 02:01, Jacob A wrote: > > > > 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;
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...
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |