Re: [PATCH 20/33] Added disk util functions

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

 



On Mon, 5 Jul 2010 10:34:29 +0100
"Czarnowska, Anna" <anna.czarnowska@xxxxxxxxx> wrote:

> Needed for checking suitability of a disk to use for rebuild.
> 
> 
> 
> Signed-off-by: Anna Czarnowska <anna.czarnowska@xxxxxxxxx<mailto:anna.czarnowska@xxxxxxxxx>>
> 
> ---
> 
>  mdadm.h       |   11 +++++++++++
> 
>  super-ddf.c   |   36 ++++++++++++++++++++++++++++++++++++
> 
>  super-intel.c |   31 +++++++++++++++++++++++++++++++
> 
>  util.c        |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
>  4 files changed, 133 insertions(+), 0 deletions(-)
> 
> 
> 
> diff --git a/mdadm.h b/mdadm.h
> 
> index b6d7933..86f5370 100644
> 
> --- a/mdadm.h
> 
> +++ b/mdadm.h
> 
> @@ -277,6 +277,12 @@ enum special_options {
> 
>       DetailPlatform,
> 
>  };
> 
> 
> 
> +enum disk_status {
> 
> +     unknown,
> 
> +     spare_disk,
> 
> +     failed_disk,
> 
> +};
> 
> +
> 
>  enum domain_actions {
> 
>       ignore,
> 
>       incremental,
> 
> @@ -656,6 +662,8 @@ extern struct superswitch {
> 
>       int (*load_super)(struct supertype *st, int fd, char *devname);
> 
>       struct supertype * (*match_metadata_desc)(char *arg);
> 
>       __u64 (*avail_size)(struct supertype *st, __u64 size);
> 
> +
> 
> +     enum disk_status (*get_disk_status)(struct supertype *st, int major,
> 
> +int minor);


I don't like the idea of identifying a device by major/minor in this context.

This disk_status information should all be loaded by 'load_super'.

i.e. we call 'load_super' giving an 'fd' for the container, and it loads all
the relevant details.  Then Monitor just looks through the mdinfo that was
loaded to find out the status of each device.
If the required status isn't currently available in mdinfo, we should change
load_super to put it there.

Thanks,
NeilBrown

--
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