From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trond Myklebust Subject: Re: Adding mount option to kernel for NFS filesystem Date: Wed, 29 Apr 2009 13:02:26 -0400 Message-ID: <1241024546.12464.17.camel@heimdal.trondhjem.org> References: <49F86F5A.7030903@oudelohuis.nl> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Gertjan Oude Lohuis Return-path: Received: from mail-out2.uio.no ([129.240.10.58]:54220 "EHLO mail-out2.uio.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760893AbZD2RC3 (ORCPT ); Wed, 29 Apr 2009 13:02:29 -0400 In-Reply-To: <49F86F5A.7030903@oudelohuis.nl> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2009-04-29 at 17:16 +0200, Gertjan Oude Lohuis wrote: > Hi guys, > > For fun and learning purposes I'm trying to add an mountflag for > NFS-mounts to the kernel and mount. The flag's semantics are identical > to ac/noac: 'flag' is default but has no special meaning, 'noflag' > triggers a certain action. > > I have a small question about adding the flag to > include/linux/nfs_mount.h. Since NFS_MOUNT_FLAGMASK is defined as > 0xFFFF, and all bits up until 0xFFFF are occupied by existing > NFS_MOUNT-flags, how could I add my own flag? > Would it be ok to define NFS_MOUNT_FLAGMASK as 0xFFFFF and my own flag > as 0x10000? Or will this have other side effects? It seems to be working > though ;-). > How would this be done if a real flag should be added by kernel maintainers? The policy is that we don't add any more flags or features to the legacy binary mount interface. NFS_MOUNT_FLAGMASK is there to enforce that rule, so changing it is not acceptable. All new mount features should be added using the text-based mount interface (see nfs_parse_mount_options()), which is supported by recent versions of the mount.nfs program in the nfs-utils package. Cheers Trond