Date: Mon, 27 Aug 2012 12:27:54 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: Luigi Rizzo <rizzo@iet.unipi.it>, current@freebsd.org, Andriy Gapon <avg@freebsd.org> Subject: Re: per file descriptor device callbacks ? Message-ID: <201208271227.54785.jhb@freebsd.org> In-Reply-To: <503B2803.1010104@FreeBSD.org> References: <20120827073403.GA49223@onelab2.iet.unipi.it> <503B2803.1010104@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, August 27, 2012 3:55:47 am Andriy Gapon wrote: > on 27/08/2012 10:34 Luigi Rizzo said the following: > > This requires to track calls to open/ioctl/poll/mmap/close. > > The difficulty i have is with mmap() and close(), because FreeBSD > > seems to handle these calls per-cdev rather than per-file-descriptor > > (for instance, no 'struct file' argument is available in mmap(), and > > the d_close method is only called on the last close() on the device). > > devfs_set_cdevpriv(9), etc mmap() is still problematic, but if you have the freedom to create your own VM objects, then d_mmap_single() can let you handle that fairly easily. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208271227.54785.jhb>