summaryrefslogtreecommitdiff
path: root/include/linux/raid
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-06-18 04:17:26 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-06-18 04:17:26 -0700
commitbc0eea3349079301d6d3ae4dee265e065f58e653 (patch)
tree5f6cb3f17fd4301bc88ba1d8394dc803571ad35e /include/linux/raid
parentee3208bff4e58f4865f872389c667c8a5c492df3 (diff)
[PATCH] md 17 of 22 - Strengthen the locking of mddev.
Strengthen the locking of mddev. mddev is only ever locked in md.c, so we move {,un}lock_mddev out of the header and into md.c, and rename to mddev_{,un}lock for consistancy with mddev_{get,put,find}. When building arrays (typically at boot time) we now lock, and unlock as it is the "right" thing to do. The lock should never fail. When generating /proc/mdstat, we lock each array before inspecting it. In md_ioctl, we lock the mddev early and unlock at the end, rather than locking in two different places. In md_open we make sure we can get a lock before completing the open. This ensures that we sync with do_md_stop properly. In md_do_recovery, we lock each mddev before checking it's status. md_do_recovery must unlock while recovery happens, and a do_md_stop at this point will deadlock when md_do_recovery tries to regain the lock. This will be fixed in a later patch.
Diffstat (limited to 'include/linux/raid')
-rw-r--r--include/linux/raid/md_k.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index d29630ebec43..9984edf26032 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -283,16 +283,6 @@ extern mdp_disk_t *get_spare(mddev_t *mddev);
tmp = tmp->next, tmp->prev != &all_mddevs \
; )
-static inline int lock_mddev (mddev_t * mddev)
-{
- return down_interruptible(&mddev->reconfig_sem);
-}
-
-static inline void unlock_mddev (mddev_t * mddev)
-{
- up(&mddev->reconfig_sem);
-}
-
#define xchg_values(x,y) do { __typeof__(x) __tmp = x; \
x = y; y = __tmp; } while (0)