From owner-freebsd-current@FreeBSD.ORG Tue Sep 21 14:16:58 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 2F7E810656A6 for ; Tue, 21 Sep 2010 14:16:58 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id DA5BC8FC20 for ; Tue, 21 Sep 2010 14:16:57 +0000 (UTC) Received: by iwn34 with SMTP id 34so6214424iwn.13 for ; Tue, 21 Sep 2010 07:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=hDwZ8kFIyIuu/um0QbRwTy3CgMSAco7Z0zhAMxszuI8=; b=Z5riHP/TaUiFYK/zu3ztFgV7BB23K4vxYSoaxCirpPYXh/EJ1RlbEh50pcknuUULKQ Fy/8smM6/Vm/XDS6T0AdKymlSZmFmrHVxl2nocOqXLkhNKCD+IIJQVsly62CIB+4xmiz JoYel+mLwx+5ZlFLh8BZT2e97WhMBLM3OUr1U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ec3yFgKOHBKoES8BCsv+bRfPUm6yQSEKiQDqo70XKRM1DFTdfGLDqA//QSHoK/Zzka VREo9Rtktndft4oVUQLGTy5OBL3Kvx0U4HODdIHnEvH4uEF+/fU5SN/Uf91u/o74//hY 6JZvxJNaq9aOolH/D5VW34qoOlMfk20YHScfU= MIME-Version: 1.0 Received: by 10.231.174.65 with SMTP id s1mr12112977ibz.153.1285078614706; Tue, 21 Sep 2010 07:16:54 -0700 (PDT) Sender: baptiste.daroussin@gmail.com Received: by 10.231.196.79 with HTTP; Tue, 21 Sep 2010 07:16:54 -0700 (PDT) In-Reply-To: <201009210915.46556.jhb@freebsd.org> References: <20100921122033.GA22567@azathoth.lan> <201009210915.46556.jhb@freebsd.org> Date: Tue, 21 Sep 2010 14:16:54 +0000 X-Google-Sender-Auth: X9aR5NypJpdI1cKDCdvc8z1jau4 Message-ID: From: Baptiste Daroussin To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org 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 14:16:58 -0000 2010/9/21 John Baldwin : > 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 doc= umented >> so here is a patch to document it http://planet.etoilebsd.net/kqueue.2.d= iff >> >> It is based on the commit message for the implementation of EVFILT_FS, s= orry 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. =A0For example, when an NFS mo= unt is > marked up, it posts an event saying it is down. =A0Right now when the use= r 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. =A0It would be more useful if the kevent could return t= wo > values: 1) would be a bitmask of changed flags, and 2) would be the curre= nt > state of the vfs query flags. =A0Perhaps 2) could be implemented in kn_da= ta, > 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 docum= ent >> them. > > VFS_CTL_QUERY is not really documented either. =A0For now I think you cou= ld > document all of this in kevent(2). =A0At the very least, you should note = that > for EVFILT_FS, the 'flags' field is a bitmask of changed flags that can b= e > queried via VFS_CTL_QUERY. =A0If the code is changed to provide the curre= nt > flags in 'data', then you could just document the flags explicitly and no= t > bother mentioning VFS_CTL_QUERY. > *Ouch* I'm far from understanding everything, I think I won't be able to document all that without a real comprehension of it. At the begining I just wanted to point out that some parts wasn't documented, and try to document what I could :) regards, Bapt