All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Prem Karat <prem.karat@linux.vnet.ibm.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/1] nfs-utils: Don't hard code source and destination args
Date: Wed, 29 Jun 2011 10:28:23 -0400	[thread overview]
Message-ID: <4E0B3687.6060209@RedHat.com> (raw)
In-Reply-To: <20110628104138.GB6600@d6fc318.ibm.com>



On 06/28/2011 06:41 AM, Prem Karat wrote:
> 
> Currently souce and destination parameters should be passed as first and 
> second paramter while using mount.nfs. This patch allows them to be passed 
> anywhere while mounting.
> 
> Current functionality is
> 	mount.nfs source destn -o <options>
> This patch will allow to do this
> 	mount.nfs -o <options> source destn
> 		or
> 	mount.nfs -o <options> source -o <options> destn
> 
> Signed-off-by: Prem Karat <prem.karat@linux.vnet.ibm.com>
Committed...

steved.

> ---
>  utils/mount/mount.c |   13 +++++++++----
>  1 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/utils/mount/mount.c b/utils/mount/mount.c
> index f3f0a83..62115bb 100644
> --- a/utils/mount/mount.c
> +++ b/utils/mount/mount.c
> @@ -374,7 +374,7 @@ static int try_mount(char *spec, char *mount_point, int flags,
>  int main(int argc, char *argv[])
>  {
>  	int c, flags = 0, mnt_err = 1, fake = 0;
> -	char *spec, *mount_point, *fs_type = "nfs";
> +	char *spec = NULL, *mount_point = NULL, *fs_type = "nfs";
>  	char *extra_opts = NULL, *mount_opts = NULL;
>  	uid_t uid = getuid();
>  
> @@ -398,9 +398,6 @@ int main(int argc, char *argv[])
>  		exit(EX_USAGE);
>  	}
>  
> -	spec = argv[1];
> -	mount_point = argv[2];
> -
>  	mount_config_init(progname);
>  
>  	argv[2] = argv[0]; /* so that getopt error messages are correct */
> @@ -447,6 +444,14 @@ int main(int argc, char *argv[])
>  	if (optind != argc - 2) {
>  		mount_usage();
>  		goto out_usage;
> +	} else {
> +		while (optind < argc) {
> +			if (!spec)
> +				spec = argv[optind];
> +			else
> +				mount_point = argv[optind];
> +			optind++;
> +		}
>  	}
>  
>  	if (strcmp(progname, "mount.nfs4") == 0)

  parent reply	other threads:[~2011-06-29 14:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 10:41 [PATCH 1/1] nfs-utils: Don't hard code source and destination args Prem Karat
2011-06-28 16:02 ` Chuck Lever
2011-06-28 16:59   ` Prem Karat
2011-06-28 17:29     ` Steve Dickson
2011-06-28 17:49     ` Chuck Lever
2011-06-28 17:59       ` Luk Claes
2011-06-28 18:33         ` Chuck Lever
2011-06-29 14:28 ` Steve Dickson [this message]
2011-06-29 23:09   ` NeilBrown
2011-06-30 10:58     ` Steve Dickson
2011-06-30 11:10       ` NeilBrown
2011-06-30 11:19         ` Steve Dickson
2011-06-30 17:40           ` J. Bruce Fields
2011-07-01 20:04             ` Steve Dickson
2011-07-01 20:56               ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E0B3687.6060209@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=prem.karat@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.