Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   UBUNTU: ubuntu: Add dm-raid4-5 driver -- port to 2.6.28 (http://www.linux-archive.org/ubuntu-kernel-team/217634-ubuntu-ubuntu-add-dm-raid4-5-driver-port-2-6-28-a.html)

Andy Whitcroft 12-24-2008 09:53 AM

UBUNTU: ubuntu: Add dm-raid4-5 driver -- port to 2.6.28
 
Bug: #309378

The dm-raid4-5 driver was disabled as it did not cleanly compile when
rebased to 2.6.28. This was due to two errors:

1) the removal of {set,clear}_page_locked() as the atomic versions were
no longer used elsewhere in the kernel, and
2) the array_too_big() function was renamed to dm_array_too_big() to
allow it to be exported.

As raid is a highly critical subsystem I have taken the safest possible
approach and assumed that RAID does require the atomic flag modifiers.
This patch therefore reinstates {set,clear}_page_locked() and moves the
code to using the new dm_array_too_big() interface. Finally it reenabled
the raid support.

I have deliberatly re-introduced {set,clear}_page_locked() into the
original headers next to their corresponding unlocked form such that
should those change again we will conflict and detect the change.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
include/linux/pagemap.h | 8 ++++++++
ubuntu/dm-raid4-5/Makefile | 2 +-
ubuntu/dm-raid4-5/dm-raid4-5.c | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 709742b..f09e3b2 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -303,11 +303,19 @@ static inline void __set_page_locked(struct page *page)
{
__set_bit(PG_locked, &page->flags);
}
+static inline void set_page_locked(struct page *page)
+{
+ set_bit(PG_locked, &page->flags);
+}

static inline void __clear_page_locked(struct page *page)
{
__clear_bit(PG_locked, &page->flags);
}
+static inline void clear_page_locked(struct page *page)
+{
+ clear_bit(PG_locked, &page->flags);
+}

static inline int trylock_page(struct page *page)
{
diff --git a/ubuntu/dm-raid4-5/Makefile b/ubuntu/dm-raid4-5/Makefile
index b33ce8d..3a7e2fb 100644
--- a/ubuntu/dm-raid4-5/Makefile
+++ b/ubuntu/dm-raid4-5/Makefile
@@ -1,3 +1,3 @@
EXTRA_CFLAGS += -I$(srctree)/drivers/md

-#obj-$(CONFIG_DM_RAID45) += dm-raid4-5.o dm-mem-cache.o dm-region_hash.o dm-message.o
+obj-$(CONFIG_DM_RAID45) += dm-raid4-5.o dm-mem-cache.o dm-region_hash.o dm-message.o
diff --git a/ubuntu/dm-raid4-5/dm-raid4-5.c b/ubuntu/dm-raid4-5/dm-raid4-5.c
index 156a219..73dc5e2 100644
--- a/ubuntu/dm-raid4-5/dm-raid4-5.c
+++ b/ubuntu/dm-raid4-5/dm-raid4-5.c
@@ -3296,7 +3296,7 @@ context_alloc(struct raid_set **raid_set, struct raid_type *raid_type,

/* Size and allocate the RAID set structure. */
len = sizeof(*rs->data) + sizeof(*rs->dev);
- if (array_too_big(sizeof(*rs), len, raid_devs))
+ if (dm_array_too_big(sizeof(*rs), len, raid_devs))
goto bad_array;

len = sizeof(*rs) + raid_devs * len;
--
1.6.0.4.911.gc990


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team


All times are GMT. The time now is 04:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.