Re: mmap(), close(), and dget()

Jason McMullan (jmcc@beans.visus.com)
3 Feb 1998 17:42:23 GMT


Bill Hawes (whawes@star.net) wrote with confidence:
> Itai Nahshon wrote:
> > That is real problem only for a small set of character devices which
> > have both mmap and release functions pointed by their file_operations.
> > I know about sound and about fbmem (fbmem is never used in x86 systems).
> > Does it raise new problems in GGI?

> You might want to look into defining a vma close op to defer device closing
> until the vma goes away. Each vma could hold an open count for the device, and
> the device wouldn't go away until the last vma had been closed.

[^----- this is our current solution]

Shouldn't the proper semantics be that unmapping the vma does
a dput(), sysctl_close() does a dput(), and that dput() itself
calls inode->op.close() when the use count is zero???

--
Jason McMullan - Linux - GGI - http://beans.visus.com/~jmcc
NT 5.0 is the last nail in the Unix coffin. Interestingly, Unix
isn't in the coffin... It's wondering what the heck is sealing 
itself into a wooden box 6 feet underground...