diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-01-20 10:15:26 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-20 07:52:41 -0400 |
commit | 34ae2e47d97216d8c66a1c5dff5b530c29b746b8 (patch) | |
tree | 0e155e534ec47258522800ab36b609fbaadf550c /drivers/block | |
parent | b2167ba6dd89d55ced26a867fad8f0fe388fd595 (diff) |
xen-blkfront: use bitmap_set() and bitmap_clear()
Use bitmap_set and bitmap_clear rather than modifying individual bits
in a memory region.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xensource.com
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/xen-blkfront.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 2f22874c0a37..619868d91ca8 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
44 | #include <linux/mutex.h> | 44 | #include <linux/mutex.h> |
45 | #include <linux/scatterlist.h> | 45 | #include <linux/scatterlist.h> |
46 | #include <linux/bitmap.h> | ||
46 | 47 | ||
47 | #include <xen/xen.h> | 48 | #include <xen/xen.h> |
48 | #include <xen/xenbus.h> | 49 | #include <xen/xenbus.h> |
@@ -177,8 +178,7 @@ static int xlbd_reserve_minors(unsigned int minor, unsigned int nr) | |||
177 | 178 | ||
178 | spin_lock(&minor_lock); | 179 | spin_lock(&minor_lock); |
179 | if (find_next_bit(minors, end, minor) >= end) { | 180 | if (find_next_bit(minors, end, minor) >= end) { |
180 | for (; minor < end; ++minor) | 181 | bitmap_set(minors, minor, nr); |
181 | __set_bit(minor, minors); | ||
182 | rc = 0; | 182 | rc = 0; |
183 | } else | 183 | } else |
184 | rc = -EBUSY; | 184 | rc = -EBUSY; |
@@ -193,8 +193,7 @@ static void xlbd_release_minors(unsigned int minor, unsigned int nr) | |||
193 | 193 | ||
194 | BUG_ON(end > nr_minors); | 194 | BUG_ON(end > nr_minors); |
195 | spin_lock(&minor_lock); | 195 | spin_lock(&minor_lock); |
196 | for (; minor < end; ++minor) | 196 | bitmap_clear(minors, minor, nr); |
197 | __clear_bit(minor, minors); | ||
198 | spin_unlock(&minor_lock); | 197 | spin_unlock(&minor_lock); |
199 | } | 198 | } |
200 | 199 | ||