On Wed, Oct 25, 2023 at 07:58:41AM +0000, Marcin Cieslak wrote: > Hello, > > is there any documentation for cdevsw methods? > I am interested in knowing how d_map_single should > be written. > > Most specifically, I want to know if the driver > has a chance to track mmaped allocations on its own > (as far as I can see there unmap(2) does not call > any of the driver's methods).
You need d_map_single + managed cdev pager to get something like that. You cannot get unmaps reported, only last reference drop is communicated. See struct cdev_pager_ops for an idea what is provided.