From owner-freebsd-current@FreeBSD.ORG Fri Aug 23 18:55:13 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2957350F; Fri, 23 Aug 2013 18:55:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED1F82BD3; Fri, 23 Aug 2013 18:55:12 +0000 (UTC) Received: from jhbbsd.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BC63BB999; Fri, 23 Aug 2013 14:55:11 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: How to best overload the fileops ? Date: Fri, 23 Aug 2013 13:02:32 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <521508F4.6030502@rawbw.com> <20130822001022.GA18115@dft-labs.eu> <52155B8D.1020807@rawbw.com> In-Reply-To: <52155B8D.1020807@rawbw.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201308231302.32800.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 23 Aug 2013 14:55:11 -0400 (EDT) Cc: Yuri , John-Mark Gurney , Mateusz Guzik , Roman Divacky , current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:55:13 -0000 On Wednesday, August 21, 2013 8:30:05 pm Yuri wrote: > 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. There is something similar: see devfs_ops_f in sys/fs/devfs/devfs_vnops.c. I don't think we need a generic framework for this, just expose the relevant fo_ methods for kqueue ops and use them in your epoll_ops. -- John Baldwin