From: Gertjan Oude Lohuis Subject: Adding mount option to kernel for NFS filesystem Date: Wed, 29 Apr 2009 19:03:06 +0200 Message-ID: <49F8884A.8050402@oudelohuis.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from gw.c1.byte.nl ([82.94.214.64]:47635 "EHLO smtp.byte.nl" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760939AbZD2RDI (ORCPT ); Wed, 29 Apr 2009 13:03:08 -0400 Received: from smtp.byte.nl (localhost [127.0.0.1]) by smtp.byte.nl (Postfix) with ESMTP id D13C138081 for ; Wed, 29 Apr 2009 19:03:06 +0200 (CEST) Received: from [192.168.1.115] (a82-95-102-2.adsl.xs4all.nl [82.95.102.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: byte0015) by smtp.byte.nl (Postfix) with ESMTP id C424438079 for ; Wed, 29 Apr 2009 19:03:06 +0200 (CEST) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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? I guess another option would be to create a new entry in the nfs_mount_data struct and treat it as an option (rsize-, wsize-, timeo-alike), but I'd like to do keep it the same as other flags. Please advice! ;-) Thanks in advance for your time. Sincerely, Gertjan