Re: [PATCH 3/4] Add --initrd argument to mdmon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 17 Jan 2012 11:48:49 +0100 Jes.Sorensen@xxxxxxxxxx wrote:

> From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
> ---
>  mdmon.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/mdmon.c b/mdmon.c
> index a65c4a4..139bd85 100644
> --- a/mdmon.c
> +++ b/mdmon.c
> @@ -276,6 +276,12 @@ void usage(void)
>  	exit(2);
>  }
>  
> +/*
> + * Option values that don't have a short version, to avoid clashing\
> + * with ascii values

The purpose of the trailing slosh (back slash) is ....?

> + */
> +#define INITRD_OPT	0x100

Can we make this an enum just like in mdadm??

> +
>  static int mdmon(char *devname, int devnum, int must_fork, int takeover);
>  
>  int main(int argc, char *argv[])
> @@ -283,6 +289,7 @@ int main(int argc, char *argv[])
>  	char *container_name = NULL;
>  	int devnum;
>  	char *devname;
> +	char *c;
>  	int status = 0;
>  	int opt;
>  	int all = 0;
> @@ -291,6 +298,7 @@ int main(int argc, char *argv[])
>  		{"all", 0, NULL, 'a'},
>  		{"takeover", 0, NULL, 't'},
>  		{"help", 0, NULL, 'h'},
> +		{"initrd", 0, NULL, INITRD_OPT},
>  		{NULL, 0, NULL, 0}
>  	};
>  
> @@ -304,6 +312,11 @@ int main(int argc, char *argv[])
>  			container_name = optarg;
>  			takeover = 1;
>  			break;
> +		case INITRD_OPT:
> +			c = argv[0];
> +			c[0] = '@';
> +			continue;

And can we use
                        argv[0][0] = '@';

here too?

Otherwise looks good.

Thanks,
NeilBrown

> +			
>  		case 'h':
>  		default:
>  			usage();

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux