Date: Wed, 21 Aug 2013 17:30:05 -0700 From: Yuri <yuri@rawbw.com> To: Mateusz Guzik <mjguzik@gmail.com> Cc: John-Mark Gurney <jmg@funkthat.com>, Roman Divacky <rdivacky@freebsd.org>, current@freebsd.org Subject: Re: How to best overload the fileops ? Message-ID: <52155B8D.1020807@rawbw.com> In-Reply-To: <20130822001022.GA18115@dft-labs.eu> References: <521508F4.6030502@rawbw.com> <20130821232113.GD94127@funkthat.com> <521552E2.2000008@rawbw.com> <20130822001022.GA18115@dft-labs.eu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 08/21/2013 17:10, Mateusz Guzik wrote: > Short answer is provide epollops with your own fo_close and the rest as > it is currently in kqueueops. All function are static, but this is not a > real problem since you have to modify kern_event.c anyway. This is exactly what this code I am asking about is doing. kqueueops functions are all static. This modification allows to export fileops to child modules. Since there is nothing similar in the kernel code, I am asking does this way look ugly or not. > > I don't know how your code looks like in general, so in case its not > clear, simply wrapping sys_kqueue is inherently racy (some other thread > may close the fd or even reuse it for something else by the time you try > to do anything with it), thus modification of current code is > unavoidable. No, sys_kqueue calling code is all protected by the lock on this file object. So nobody can close or reuse it. Yuri
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52155B8D.1020807>