Date: Sat, 01 Feb 1997 13:31:40 +0100 From: Poul-Henning Kamp <phk@critter.dk.tfs.com> To: current@freebsd.org Subject: device driver open semantics... Message-ID: <3050.854800300@critter.dk.tfs.com>
next in thread | raw e-mail | index | archive | help
The way things work now, this scenario exists: Proc A Proc B Device foo ------------------------------------------ open(foo,RD) \__________________ \ ->open(foo, RD,A) open(foo,WR) \__ \ ->open(foo, WR,B) close(foo) >>nothing<< close(foo) \____________________ \ ->close(foo,A) I'm dissatisfied with the >>nothing<< step. At this time there is nobody who has the device open for writing but we fail to communicate this to the driver. Many drivers don't really care who opened them, and it would generally be sufficient to be informed of the current agregate open mode: Proc A Proc B Device foo ------------------------------------------ open(foo,RD) \__________________ \ ->isopen(foo, RD) open(foo,WR) \__ \ ->isopen(foo, RD|WR) close(foo) \____ \ ->isopen(foo, RD) close(foo) \____________________ \ ->isopen(foo,0) (we would still have to pass a proc * argument in case we need to sleep, but it does not necessarily correspond to the process that effected the change in status) Comments ? I realize that changing this behaviour in general would probably surprise most if not all of our device-drivers, So we're probably talking about a per-driver flag or possibly a different open/close entry point in the [cb]devsw structure. Preferences ? Objections ? -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3050.854800300>