grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 7/8] Make more generic the code for raid6 rebuilding


From: Daniel Kiper
Subject: Re: [PATCH 7/8] Make more generic the code for raid6 rebuilding
Date: Mon, 14 May 2018 20:57:10 +0200
User-agent: Mutt/1.3.28i

On Fri, May 11, 2018 at 09:24:45PM +0200, Goffredo Baroncelli wrote:
> The original grub code which handles the recovery of a raid6 disks array
> assumes that all the read are multiple of 1 << GRUB_DISK_SECTOR_BITS and

s/the read/reads/

> it also assumes that all the I/O is done via the struct
> grub_diskfilter_segment.
> This is not true for the btrfs code. In order to reuse the native
> grub_raid6_recover() code, it is modified to not call
> grub_diskfilter_read_node directly, but to call an handler passed
> as argument.

Could you fix the formating? Currently it is difficult to read.

> Signed-off-by: Goffredo Baroncelli <address@hidden>
> ---
>  grub-core/disk/raid6_recover.c | 52 ++++++++++++++++++++++------------
>  include/grub/diskfilter.h      |  9 ++++++
>  2 files changed, 43 insertions(+), 18 deletions(-)
>
> diff --git a/grub-core/disk/raid6_recover.c b/grub-core/disk/raid6_recover.c
> index aa674f6ca..1b37d0552 100644
> --- a/grub-core/disk/raid6_recover.c
> +++ b/grub-core/disk/raid6_recover.c
> @@ -74,14 +74,25 @@ mod_255 (unsigned x)
>  }
>
>  static grub_err_t
> -grub_raid6_recover (struct grub_diskfilter_segment *array, int disknr, int p,
> -                    char *buf, grub_disk_addr_t sector, grub_size_t size)
> +raid_recover_read_diskfilter_array (void *data, int disk_nr,

s/raid_recover_read_diskfilter_array/raid6_read_node_gen/

> +                                 grub_uint64_t sector,
> +                                 void *buf, grub_size_t size)
> +{
> +    struct grub_diskfilter_segment *array = data;

Please add empty line here.

> +    return grub_diskfilter_read_node (&array->nodes[disk_nr],
> +                                   (grub_disk_addr_t)sector,
> +                                   size >> GRUB_DISK_SECTOR_BITS, buf);
> +}
> +
> +grub_err_t
> +grub_raid6_recover_generic (void *data, grub_uint64_t nstripes, int disknr, 
> int p,

s/grub_raid6_recover_generic/grub_raid6_recover_gen/

> +                         char *buf, grub_uint64_t sector, grub_size_t size,
> +                         raid_recover_read_t read_func, int layout)

s/read_func/read_node/

Hmmm... Could not you create a struct for this call?

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]