On Fri, May 22, 2009 at 1:29 AM, Andre Noll <maan@xxxxxxxxxxxxxxx> wrote: > On Mon, May 18, 2009 at 06:00:22PM -0700, Dan Williams wrote: >> +static char disk_type(int d) >> +{ >> + switch (d) { >> + case NDISKS-2: >> + return 'P'; >> + case NDISKS-1: >> + return 'Q'; >> + default: >> + return 'D'; >> + } >> +} > > I like this function very much because "if (disk_type(faila) == 'Q')" > is so much more readable than "if (faila == num_disks - 1)". It's a > pity that we only have it in this test module ;) I do not see too many places outside this file where it would be helpful... but an incremental patch for this cleanup would be welcome. In general this code tries to duplicate the look of drivers/md/raid6test/test.c, so any cleanups would be applicable in both locations. > How hard would it be to also test the fallback code for the synchronous > paths? AFAICS this test module wouldn't notice errors in the fallback > logic. It does. Simply omit loading an offload driver and the api will by necessity fallback to the synchronous path. Thanks, Dan -- 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