From 3e98f2fb3d7dd2496667353713317ae353a89522 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 22 Aug 2002 21:26:27 -0700 Subject: [PATCH] md: Keep track of number of pending requests on each component device on an MD array This will allow us to know, in the event of a device failure, when the device is completely unused and so can be disconnected from the array. Currently this isn't a problem as drives aren't normally disconnect until after a repacement has been rebuilt, which is a LONG TIME, but that will change shortly... We always increment the count under a spinlock after checking that it hasn't been disconnected already (rdev!= NULL). We disconnect under the same spinlock after checking that the count is zero. --- include/linux/raid/md_k.h | 5 +++++ include/linux/raid/raid1.h | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include/linux/raid') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index b2d38ac30780..4fb0e1a51155 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -160,6 +160,11 @@ struct mdk_rdev_s int desc_nr; /* descriptor index in the superblock */ int raid_disk; /* role of device in array */ + + atomic_t nr_pending; /* number of pending requests. + * only maintained for arrays that + * support hot removal + */ }; typedef struct mdk_personality_s mdk_personality_t; diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index a27ed231c596..9cd479ad2acb 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h @@ -8,7 +8,6 @@ typedef struct mirror_info mirror_info_t; struct mirror_info { mdk_rdev_t *rdev; sector_t head_position; - atomic_t nr_pending; /* * State bits: -- cgit v1.2.3