Re: [PATCH 004 of 7] md: Allow devices to be shared between md arrays.

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

 



On Fri, 14 Dec 2007 17:26:28 +1100 NeilBrown <[email protected]> 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-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux