diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-10-08 11:53:46 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-10-09 11:18:04 +1000 |
commit | ba0c5b3b8a635ce671778b630787bce857ee81c7 (patch) | |
tree | 310b148d676bcc053bd5e93f0b1d6b0ea9e402c1 | |
parent | e8232ab2cfd9d5b6669c5ba47d423925bdc25e12 (diff) | |
download | nfs-utils-ba0c5b3b8a635ce671778b630787bce857ee81c7.tar.gz nfs-utils-ba0c5b3b8a635ce671778b630787bce857ee81c7.tar.xz nfs-utils-ba0c5b3b8a635ce671778b630787bce857ee81c7.zip |
text-based mount.nfs: refactor mandatory mount option processing
We're about to combine nfsmount_s() and nfs4mount_s(). Refactor the
version-specific mount option processing into a separate function.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r-- | utils/mount/stropts.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 3d83f9e..6270312 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -215,6 +215,29 @@ static int fix_mounthost_option(struct mount_options *options) } /* + * Set up mandatory mount options. + * + * Returns 1 if successful; otherwise zero. + */ +static int set_mandatory_options(const char *type, + struct sockaddr_in *saddr, + struct mount_options *options) +{ + if (!append_addr_option(saddr, options)) + return 0; + + if (strncmp(type, "nfs4", 4) == 0) { + if (!append_clientaddr_option(saddr, options)) + return 0; + } else { + if (!fix_mounthost_option(options)) + return 0; + } + + return 1; +} + +/* * nfsmount_s - Mount an NFSv2 or v3 file system using C string options * * @spec: C string hostname:path specifying remoteshare to mount |