* Adding mount option to kernel for NFS filesystem
@ 2009-04-29 15:16 Gertjan Oude Lohuis
2009-04-29 17:02 ` Trond Myklebust
0 siblings, 1 reply; 4+ messages in thread
From: Gertjan Oude Lohuis @ 2009-04-29 15:16 UTC (permalink / raw)
To: linux-fsdevel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Adding mount option to kernel for NFS filesystem
2009-04-29 15:16 Adding mount option to kernel for NFS filesystem Gertjan Oude Lohuis
@ 2009-04-29 17:02 ` Trond Myklebust
0 siblings, 0 replies; 4+ messages in thread
From: Trond Myklebust @ 2009-04-29 17:02 UTC (permalink / raw)
To: Gertjan Oude Lohuis; +Cc: linux-fsdevel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Adding mount option to kernel for NFS filesystem
@ 2009-04-29 17:03 Gertjan Oude Lohuis
[not found] ` <49F8884A.8050402-yZ1RIXqxfwWWrUy98/Atqw@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Gertjan Oude Lohuis @ 2009-04-29 17:03 UTC (permalink / raw)
To: linux-fsdevel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Adding mount option to kernel for NFS filesystem
[not found] ` <49F8884A.8050402-yZ1RIXqxfwWWrUy98/Atqw@public.gmane.org>
@ 2009-04-30 18:58 ` Jeff Layton
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2009-04-30 18:58 UTC (permalink / raw)
To: Gertjan Oude Lohuis
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
linux-nfs-u79uwXL29TY76Z2rM5mHXA
On Wed, 29 Apr 2009 19:03:06 +0200
Gertjan Oude Lohuis <gertjan-yZ1RIXqxfwWWrUy98/Atqw@public.gmane.org> 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?
>
> 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
>
It's probably better to post questions like this to
linux-nfs-u79uwXL29TaiAVqoAR/hOA@public.gmane.org cc'ing that on the response...
Newer kernels and mount.nfs progs use text-based mount options by
default. My suggestion would be to avoid worrying about the legacy
mount option code and to just make the new option work with the text
based ones only.
Cheers,
--
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-30 18:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-29 15:16 Adding mount option to kernel for NFS filesystem Gertjan Oude Lohuis
2009-04-29 17:02 ` Trond Myklebust
-- strict thread matches above, loose matches on Subject: below --
2009-04-29 17:03 Gertjan Oude Lohuis
[not found] ` <49F8884A.8050402-yZ1RIXqxfwWWrUy98/Atqw@public.gmane.org>
2009-04-30 18:58 ` Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).