From owner-freebsd-current@FreeBSD.ORG Tue Sep 21 13:35:31 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D87D2106566C; Tue, 21 Sep 2010 13:35:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A7FFC8FC1F; Tue, 21 Sep 2010 13:35:31 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4E97E46C0B; Tue, 21 Sep 2010 09:35:31 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5922A8A04E; Tue, 21 Sep 2010 09:35:30 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 21 Sep 2010 09:15:46 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <20100921122033.GA22567@azathoth.lan> In-Reply-To: <20100921122033.GA22567@azathoth.lan> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009210915.46556.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 21 Sep 2010 09:35:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Baptiste Daroussin Subject: Re: Document EVFILT_FS and VQ_* X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 21 Sep 2010 13:35:31 -0000 On Tuesday, September 21, 2010 8:22:24 am Baptiste Daroussin wrote: > Hi, > > For a projects I needed to use EVFILT_FS and saw that it hasn't been documented > so here is a patch to document it http://planet.etoilebsd.net/kqueue.2.diff > > It is based on the commit message for the implementation of EVFILT_FS, sorry I > don't know how to better document it > (http://lists.freebsd.org/pipermail/cvs-src/2005-September/052288.html) Hmm, the code for this seems quite broken. For example, when an NFS mount is marked up, it posts an event saying it is down. Right now when the user gets an EVFILT_FS event, the info in the event contains a mask of states that have changed, but the code would still need to issue a VFS_CTL_QUERY sysctl to get the actual state. It would be more useful if the kevent could return two values: 1) would be a bitmask of changed flags, and 2) would be the current state of the vfs query flags. Perhaps 2) could be implemented in kn_data, but we would need to change the kernel to keep the current state of the vfs query flags in 'struct mount' (this could be done in vfs_event_signal()). Doing so would also allow VFS_CTL_QUERY to be implemented generically. > While using it I also discover that VQ_MOUNT, VQ_UMOUNT, VQ_NOTRESP and > VQ_NOTRESPLOCK are not documented either but I don't know where to document > them. VFS_CTL_QUERY is not really documented either. For now I think you could document all of this in kevent(2). At the very least, you should note that for EVFILT_FS, the 'flags' field is a bitmask of changed flags that can be queried via VFS_CTL_QUERY. If the code is changed to provide the current flags in 'data', then you could just document the flags explicitly and not bother mentioning VFS_CTL_QUERY. -- John Baldwin