From owner-cvs-src@FreeBSD.ORG Fri May 26 03:38:47 2006 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4AF416A4A3; Fri, 26 May 2006 03:38:47 +0000 (UTC) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc14.comcast.net (rwcrmhc14.comcast.net [204.127.192.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3113943D48; Fri, 26 May 2006 03:38:47 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-24-147-19-128.hsd1.ma.comcast.net (c-71-233-168-2.hsd1.ma.comcast.net[71.233.168.2](misconfigured sender)) by comcast.net (rwcrmhc14) with ESMTP id <20060526033841m1400kr6s0e>; Fri, 26 May 2006 03:38:46 +0000 Received: from c-24-147-19-128.hsd1.ma.comcast.net (localhost [127.0.0.1]) by c-24-147-19-128.hsd1.ma.comcast.net (8.13.6/8.13.1) with ESMTP id k4Q3cfpj009928; Thu, 25 May 2006 23:38:41 -0400 (EDT) (envelope-from rodrigc@c-24-147-19-128.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-24-147-19-128.hsd1.ma.comcast.net (8.13.6/8.13.1/Submit) id k4Q3cefi009927; Thu, 25 May 2006 23:38:40 -0400 (EDT) (envelope-from rodrigc) Date: Thu, 25 May 2006 23:38:40 -0400 From: Craig Rodrigues To: Scott Long Message-ID: <20060526033840.GA9864@crodrigues.org> References: <200605260121.k4Q1LqLd098354@repoman.freebsd.org> <44766E9B.6030000@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44766E9B.6030000@samsco.org> User-Agent: Mutt/1.4.2.1i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/udf udf_vfsops.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 May 2006 03:38:50 -0000 On Thu, May 25, 2006 at 08:57:31PM -0600, Scott Long wrote: > So is it no longer possible for a filesystem to veto or otherwise > massage an export request? It is still possible. This is because vfs_export() is only called in vfs_mount.c, only *after* the VFS_MOUNT() call for an individual filesystem is called. An individual filesystem can check the mount options being passed into its VFS_MOUNT() call, and do a vfs_getopt() and look for the "export" option, which contains a "struct export_args", which is eventually passed to vfs_export(). The specific filesystem can do: (1) If the mount options passed into the specific filesystem's VFS_MOUNT() call contains "export", the filesystem can return an error from VFS_MOUNT() if it doesn't want to deal with export requests at all. The code in vfs_mount.c checks for the return status of VFS_MOUNT, and if there is an error, it will *not* call vfs_export(). (2) If the mount options contains "export", the filesystem can do a vfs_getopt(), manipulate the contents of the struct export_args, then return 0 (for success). The code in VFS_MOUNT will then call vfs_export(), passing in the same struct export_args that the individual filesystem One example of a filesystem vetoing an "export" request is in fs/msdosfs/msdosfs_vfsops.c : if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0) { /* Process export requests. */ if ((pmp->pm_flags & MSDOSFS_LARGEFS) != 0) return (EOPNOTSUPP); else return (0); } Most of the filesystem code I saw looked like they had just cut-n-pasted their calls to vfs_export(), so it was fairly easy to consolidate everything in one place, vfs_mount.c With my recent changes to mountd, to convert to nmount() and remove hardcoded dependencies on ufs, cd9660, ntfs, and msdosfs, it should be easier to export different filesystems from FreeBSD. For example, it should now be possible to NFS export an ext2fs from FreeBSD. -- Craig Rodrigues rodrigc@crodrigues.org