[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-raid
Subject:    Re: [PATCH 004 of 7] md: Allow devices to be shared between md
From:       Andrew Morton <akpm () linux-foundation ! org>
Date:       2007-12-25 22:04:05
Message-ID: 20071225140405.550369cd.akpm () linux-foundation ! org
[Download RAW message or body]

On Fri, 14 Dec 2007 17:26:28 +1100 NeilBrown <neilb@suse.de> wrote:

> +		mddev_unlock(rdev->mddev);
> +		ITERATE_MDDEV(mddev, tmp) {
> +			mdk_rdev_t *rdev2;
> +
> +			mddev_lock(mddev);
> +			ITERATE_RDEV(mddev, rdev2, tmp2)
> +				if (test_bit(AllReserved, &rdev2->flags) ||
> +				    (rdev->bdev == rdev2->bdev &&
> +				     rdev != rdev2 &&
> +				     overlaps(rdev->data_offset, rdev->size,
> +					    rdev2->data_offset, rdev2->size))) {
> +					overlap = 1;
> +					break;
> +				}
> +			mddev_unlock(mddev);
> +			if (overlap) {
> +				mddev_put(mddev);
> +				break;
> +			}
> +		}

eww, ITERATE_MDDEV() and ITERATE_RDEV() are an eyesore.

for_each_mddev() and for_each_rdev() would at least mean the reader doesn't
need to check the implementation when wondering what that `break' is
breaking from.

>  #define	In_sync		2		/* device is in_sync with rest of array */
>  #define	WriteMostly	4		/* Avoid reading if at all possible */
>  #define	BarriersNotsupp	5		/* BIO_RW_BARRIER is not supported */
> +#define	AllReserved	6		/* If whole device is reserved for

The naming style here is inconsistent.

A task for the keen would be to convert these to an enum and add some
namespacing prefix to them.  
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic