From owner-freebsd-fs@FreeBSD.ORG Mon May 16 23:58:36 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2AFD106564A for ; Mon, 16 May 2011 23:58:36 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6648FC14 for ; Mon, 16 May 2011 23:58:36 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0EAOi50U2DaFvO/2dsb2JhbAAwhCmiNacJjiCRNoErgWyBe4EHBJARhyuHZg X-IronPort-AV: E=Sophos;i="4.65,222,1304308800"; d="scan'208";a="120899282" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 16 May 2011 19:58:35 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 37C4DB3EB1 for ; Mon, 16 May 2011 19:58:35 -0400 (EDT) Date: Mon, 16 May 2011 19:58:35 -0400 (EDT) From: Rick Macklem To: FreeBSD FS Message-ID: <256284561.428250.1305590315172.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Subject: RFC: adding a lock flags argument to VFS_FHTOVP() for FreeBSD9 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 23:58:36 -0000 Hi, Down the road, I would like the NFS server to be able to do a VFS_FHTOVP(mp, &fhp->fh_fid, LK_SHARED, vpp); similar to what is already supported for VFS_VGET(). The reason is that, currently, when a client does read-aheads, these reads are basically serialized because the VFS_FHTOVP() gets an LK_EXCLUSIVE locked vnode for each RPC on the server. Like VFS_VGET(), the underlying file system can still choose to return a LK_EXCLUSIVE locked vnode even when LK_SHARED is specified. (Some file systems, such as FFS, just call VFS_VGET() in VFS_FHTOVP(), so all that happens is that the flag is passed through to VFS_VGET() for those ones.) To minimize the risk of the patch breaking something, I have it setting LK_EXCLUSIVE for all VFS_FHTOVP() calls so that the semantics don't actually change. (Changing the NFS server to use LK_SHARED is a trivial patch, but will need extensive testing, so I'm not planning on that change for 9.0.) If you are interested, my current patch is at: http://people.freebsd.org/~rmacklem/fhtovp.patch So, does this sound like a reasonable thing to commit, once the patch is reviewed? rick