Re: [PATCH 18/53] Treat feature as experimental

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

 



On Fri, 26 Nov 2010 09:06:08 +0100 Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote:

> Due to fact that IMSM Windows compatibility was not tested yet, feature has to be treated as experimental until compatibility verification will be performed.

I've applied most of this patch.
The addition to imsm_reshape_super cannot be added until that function itself
is added, and I didn't like that patch.

Also it is not correct to mark the function as 'inline', and mentioning
'IMSM' is the error message is not appropriate as experimental() could
eventually be used by other metadata handlers.

But with those changes, I have applied it.

Thanks,
NeilBrown


> 
> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
> ---
> 
>  mdadm.h       |    1 +
>  super-intel.c |    4 ++++
>  util.c        |   10 ++++++++++
>  3 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/mdadm.h b/mdadm.h
> index 64b32cc..bf3c1d3 100644
> --- a/mdadm.h
> +++ b/mdadm.h
> @@ -890,6 +890,7 @@ extern char *conf_word(FILE *file, int allow_key);
>  extern int conf_name_is_free(char *name);
>  extern int devname_matches(char *name, char *match);
>  extern struct mddev_ident_s *conf_match(struct mdinfo *info, struct supertype *st);
> +extern inline int experimental(void);
>  
>  extern void free_line(char *line);
>  extern int match_oneof(char *devices, char *devname);
> diff --git a/super-intel.c b/super-intel.c
> index 2434fa1..f092ccc 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5780,6 +5780,10 @@ int imsm_reshape_super(struct supertype *st, long long size, int level,
>  	int fd = -1;
>  	char buf[PATH_MAX];
>  
> +
> +	if (experimental() == 0)
> +		return ret_val;
> +
>  	snprintf(buf, PATH_MAX, "/dev/md%i", st->devnum);
>  	fd = open(buf , O_RDONLY | O_DIRECT);
>  	if (fd < 0) {
> diff --git a/util.c b/util.c
> index 8739278..f220792 100644
> --- a/util.c
> +++ b/util.c
> @@ -1859,3 +1859,13 @@ void append_metadata_update(struct supertype *st, void *buf, int len)
>  unsigned int __invalid_size_argument_for_IOC = 0;
>  #endif
>  
> +inline int experimental(void)
> +{
> +	if (check_env("MDADM_EXPERIMENTAL"))
> +		return 1;
> +	else {
> +		fprintf(stderr, Name "(IMSM): To use this feature MDADM_EXPERIMENTAL enviroment variable has to defined.\n");
> +		return 0;
> +	}
> +}
> +

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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