From owner-freebsd-current@FreeBSD.ORG Fri Aug 23 20:36:16 2013 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 25DD42A6; Fri, 23 Aug 2013 20:36:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB1752253; Fri, 23 Aug 2013 20:36:15 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VCy5Z-000KkT-0G; Fri, 23 Aug 2013 20:36:09 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r7NKa5oB048276; Fri, 23 Aug 2013 14:36:05 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19hn89JUu/HLwvQiSGlXL/q Subject: Re: How to best overload the fileops ? From: Ian Lepore To: Yuri In-Reply-To: <5217C0DC.8050107@rawbw.com> References: <521508F4.6030502@rawbw.com> <20130822001022.GA18115@dft-labs.eu> <52155B8D.1020807@rawbw.com> <201308231302.32800.jhb@freebsd.org> <5217C0DC.8050107@rawbw.com> Content-Type: text/plain; charset="us-ascii" Date: Fri, 23 Aug 2013 14:36:05 -0600 Message-ID: <1377290165.1111.85.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Mateusz Guzik , current@FreeBSD.org, John-Mark Gurney , freebsd-current@FreeBSD.org, Roman Divacky 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 20:36:16 -0000 On Fri, 2013-08-23 at 13:06 -0700, Yuri wrote: > On 08/23/2013 10:02, John Baldwin wrote: > > There is something similar: see devfs_ops_f in sys/fs/devfs/devfs_vnops.c. > > devfs_ops_f is a local static fileops object for devfs. I don't see how > is this similar to our situation. devfs doesn't overload any other file > system, they are a file system on their own. > I think the point is that devfs_ops_f provides several devfs-specific methods and then "inherits" the rest by referencing the standard vn_whatever functions. Since John recommended that you expose the fo_whatever methods, I think he's suggesting you build your ops table by providing your own close method and fill in the rest of the table with the now-exposed kqueue ops methods. It's not as neat and clean as "class epollops : public kqueueops {...}" but it's probably not as bad as using clever macros to try to turn C into a sort of C++Lite. -- Ian > > > > 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. > > In epoll case, fileops object as a whole should be exposed and used for > fp->f_ops, except fo_close which is overloaded. > > So would you think struct fileops* kqueue_fileops(); be ok then? > > Yuri > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"