From f7bbc7e12d9d3a5799f2dd551323f23be682dfd9 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 18 Jun 2002 04:17:48 -0700 Subject: [PATCH] md 20 of 22 - Provide SMP safe locking for all_mddevs list. Provide SMP safe locking for all_mddevs list. the all_mddevs_lock is added to protect all_mddevs and mddev_map. ITERATE_MDDEV is moved to md.c (it isn't needed elsewhere) and enhanced to take the lock appropriately and always have a refcount on the object that is given to the body of the loop. mddev_find is changed so that the structure is allocated outside a lock, but test-and-set is done inside the lock. --- include/linux/raid/md_k.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 3352cbca5308..c1db880110c0 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -277,16 +277,6 @@ extern mdp_disk_t *get_spare(mddev_t *mddev); #define ITERATE_RDEV_PENDING(rdev,tmp) \ ITERATE_RDEV_GENERIC(pending_raid_disks,pending,rdev,tmp) -/* - * iterates through all used mddevs in the system. - */ -#define ITERATE_MDDEV(mddev,tmp) \ - \ - for (tmp = all_mddevs.next; \ - mddev = list_entry(tmp, mddev_t, all_mddevs), \ - tmp = tmp->next, tmp->prev != &all_mddevs \ - ; ) - #define xchg_values(x,y) do { __typeof__(x) __tmp = x; \ x = y; y = __tmp; } while (0) -- cgit v1.2.3