aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-crypt.c2
-rw-r--r--drivers/md/dm-io.c2
-rw-r--r--drivers/md/dm-ioctl.c9
-rw-r--r--drivers/md/dm-mpath.c16
-rw-r--r--drivers/md/dm-raid1.c2
-rw-r--r--drivers/md/md.c4
-rw-r--r--drivers/md/multipath.c2
-rw-r--r--drivers/md/raid1.c4
-rw-r--r--drivers/md/raid10.c4
-rw-r--r--drivers/md/raid6.h4
-rw-r--r--drivers/md/raid6algos.c1
-rw-r--r--drivers/md/raid6altivec.uc18
-rw-r--r--drivers/md/raid6test/Makefile27
13 files changed, 70 insertions, 25 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index b82bc3150476..b6148f6f7836 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -96,7 +96,7 @@ static kmem_cache_t *_crypt_io_pool;
96/* 96/*
97 * Mempool alloc and free functions for the page 97 * Mempool alloc and free functions for the page
98 */ 98 */
99static void *mempool_alloc_page(unsigned int __nocast gfp_mask, void *data) 99static void *mempool_alloc_page(gfp_t gfp_mask, void *data)
100{ 100{
101 return alloc_page(gfp_mask); 101 return alloc_page(gfp_mask);
102} 102}
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index 9de000131a8a..4809b209fbb1 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -32,7 +32,7 @@ struct io {
32static unsigned _num_ios; 32static unsigned _num_ios;
33static mempool_t *_io_pool; 33static mempool_t *_io_pool;
34 34
35static void *alloc_io(unsigned int __nocast gfp_mask, void *pool_data) 35static void *alloc_io(gfp_t gfp_mask, void *pool_data)
36{ 36{
37 return kmalloc(sizeof(struct io), gfp_mask); 37 return kmalloc(sizeof(struct io), gfp_mask);
38} 38}
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 200a0688f717..54ec737195e0 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -230,11 +230,20 @@ static int dm_hash_insert(const char *name, const char *uuid, struct mapped_devi
230 230
231static void __hash_remove(struct hash_cell *hc) 231static void __hash_remove(struct hash_cell *hc)
232{ 232{
233 struct dm_table *table;
234
233 /* remove from the dev hash */ 235 /* remove from the dev hash */
234 list_del(&hc->uuid_list); 236 list_del(&hc->uuid_list);
235 list_del(&hc->name_list); 237 list_del(&hc->name_list);
236 unregister_with_devfs(hc); 238 unregister_with_devfs(hc);
237 dm_set_mdptr(hc->md, NULL); 239 dm_set_mdptr(hc->md, NULL);
240
241 table = dm_get_table(hc->md);
242 if (table) {
243 dm_table_event(table);
244 dm_table_put(table);
245 }
246
238 dm_put(hc->md); 247 dm_put(hc->md);
239 if (hc->new_map) 248 if (hc->new_map)
240 dm_table_put(hc->new_map); 249 dm_table_put(hc->new_map);
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 785806bdb248..f9b7b32d5d5c 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -329,13 +329,17 @@ static int map_io(struct multipath *m, struct bio *bio, struct mpath_io *mpio,
329/* 329/*
330 * If we run out of usable paths, should we queue I/O or error it? 330 * If we run out of usable paths, should we queue I/O or error it?
331 */ 331 */
332static int queue_if_no_path(struct multipath *m, unsigned queue_if_no_path) 332static int queue_if_no_path(struct multipath *m, unsigned queue_if_no_path,
333 unsigned save_old_value)
333{ 334{
334 unsigned long flags; 335 unsigned long flags;
335 336
336 spin_lock_irqsave(&m->lock, flags); 337 spin_lock_irqsave(&m->lock, flags);
337 338
338 m->saved_queue_if_no_path = m->queue_if_no_path; 339 if (save_old_value)
340 m->saved_queue_if_no_path = m->queue_if_no_path;
341 else
342 m->saved_queue_if_no_path = queue_if_no_path;
339 m->queue_if_no_path = queue_if_no_path; 343 m->queue_if_no_path = queue_if_no_path;
340 if (!m->queue_if_no_path && m->queue_size) 344 if (!m->queue_if_no_path && m->queue_size)
341 queue_work(kmultipathd, &m->process_queued_ios); 345 queue_work(kmultipathd, &m->process_queued_ios);
@@ -677,7 +681,7 @@ static int parse_features(struct arg_set *as, struct multipath *m,
677 return 0; 681 return 0;
678 682
679 if (!strnicmp(shift(as), MESG_STR("queue_if_no_path"))) 683 if (!strnicmp(shift(as), MESG_STR("queue_if_no_path")))
680 return queue_if_no_path(m, 1); 684 return queue_if_no_path(m, 1, 0);
681 else { 685 else {
682 ti->error = "Unrecognised multipath feature request"; 686 ti->error = "Unrecognised multipath feature request";
683 return -EINVAL; 687 return -EINVAL;
@@ -1077,7 +1081,7 @@ static void multipath_presuspend(struct dm_target *ti)
1077{ 1081{
1078 struct multipath *m = (struct multipath *) ti->private; 1082 struct multipath *m = (struct multipath *) ti->private;
1079 1083
1080 queue_if_no_path(m, 0); 1084 queue_if_no_path(m, 0, 1);
1081} 1085}
1082 1086
1083/* 1087/*
@@ -1222,9 +1226,9 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)
1222 1226
1223 if (argc == 1) { 1227 if (argc == 1) {
1224 if (!strnicmp(argv[0], MESG_STR("queue_if_no_path"))) 1228 if (!strnicmp(argv[0], MESG_STR("queue_if_no_path")))
1225 return queue_if_no_path(m, 1); 1229 return queue_if_no_path(m, 1, 0);
1226 else if (!strnicmp(argv[0], MESG_STR("fail_if_no_path"))) 1230 else if (!strnicmp(argv[0], MESG_STR("fail_if_no_path")))
1227 return queue_if_no_path(m, 0); 1231 return queue_if_no_path(m, 0, 0);
1228 } 1232 }
1229 1233
1230 if (argc != 2) 1234 if (argc != 2)
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 863282513753..2375709a392c 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -122,7 +122,7 @@ static inline sector_t region_to_sector(struct region_hash *rh, region_t region)
122/* FIXME move this */ 122/* FIXME move this */
123static void queue_bio(struct mirror_set *ms, struct bio *bio, int rw); 123static void queue_bio(struct mirror_set *ms, struct bio *bio, int rw);
124 124
125static void *region_alloc(unsigned int __nocast gfp_mask, void *pool_data) 125static void *region_alloc(gfp_t gfp_mask, void *pool_data)
126{ 126{
127 return kmalloc(sizeof(struct region), gfp_mask); 127 return kmalloc(sizeof(struct region), gfp_mask);
128} 128}
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2897df90df44..e9476075aa13 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3063,6 +3063,7 @@ static int md_thread(void * arg)
3063 * many dirty RAID5 blocks. 3063 * many dirty RAID5 blocks.
3064 */ 3064 */
3065 3065
3066 allow_signal(SIGKILL);
3066 complete(thread->event); 3067 complete(thread->event);
3067 while (!kthread_should_stop()) { 3068 while (!kthread_should_stop()) {
3068 void (*run)(mddev_t *); 3069 void (*run)(mddev_t *);
@@ -3111,7 +3112,7 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev,
3111 thread->mddev = mddev; 3112 thread->mddev = mddev;
3112 thread->name = name; 3113 thread->name = name;
3113 thread->timeout = MAX_SCHEDULE_TIMEOUT; 3114 thread->timeout = MAX_SCHEDULE_TIMEOUT;
3114 thread->tsk = kthread_run(md_thread, thread, mdname(thread->mddev)); 3115 thread->tsk = kthread_run(md_thread, thread, name, mdname(thread->mddev));
3115 if (IS_ERR(thread->tsk)) { 3116 if (IS_ERR(thread->tsk)) {
3116 kfree(thread); 3117 kfree(thread);
3117 return NULL; 3118 return NULL;
@@ -3569,6 +3570,7 @@ static void md_do_sync(mddev_t *mddev)
3569 try_again: 3570 try_again:
3570 if (signal_pending(current)) { 3571 if (signal_pending(current)) {
3571 flush_signals(current); 3572 flush_signals(current);
3573 set_bit(MD_RECOVERY_INTR, &mddev->recovery);
3572 goto skip; 3574 goto skip;
3573 } 3575 }
3574 ITERATE_MDDEV(mddev2,tmp) { 3576 ITERATE_MDDEV(mddev2,tmp) {
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 286342375fb7..1151c3ed3006 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -38,7 +38,7 @@
38static mdk_personality_t multipath_personality; 38static mdk_personality_t multipath_personality;
39 39
40 40
41static void *mp_pool_alloc(unsigned int __nocast gfp_flags, void *data) 41static void *mp_pool_alloc(gfp_t gfp_flags, void *data)
42{ 42{
43 struct multipath_bh *mpb; 43 struct multipath_bh *mpb;
44 mpb = kmalloc(sizeof(*mpb), gfp_flags); 44 mpb = kmalloc(sizeof(*mpb), gfp_flags);
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index a93ca478142a..0e1f148dd41d 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -52,7 +52,7 @@ static mdk_personality_t raid1_personality;
52static void unplug_slaves(mddev_t *mddev); 52static void unplug_slaves(mddev_t *mddev);
53 53
54 54
55static void * r1bio_pool_alloc(unsigned int __nocast gfp_flags, void *data) 55static void * r1bio_pool_alloc(gfp_t gfp_flags, void *data)
56{ 56{
57 struct pool_info *pi = data; 57 struct pool_info *pi = data;
58 r1bio_t *r1_bio; 58 r1bio_t *r1_bio;
@@ -79,7 +79,7 @@ static void r1bio_pool_free(void *r1_bio, void *data)
79#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) 79#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
80#define RESYNC_WINDOW (2048*1024) 80#define RESYNC_WINDOW (2048*1024)
81 81
82static void * r1buf_pool_alloc(unsigned int __nocast gfp_flags, void *data) 82static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
83{ 83{
84 struct pool_info *pi = data; 84 struct pool_info *pi = data;
85 struct page *page; 85 struct page *page;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 5bd1e9ec899d..28dd028415e4 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -47,7 +47,7 @@
47 47
48static void unplug_slaves(mddev_t *mddev); 48static void unplug_slaves(mddev_t *mddev);
49 49
50static void * r10bio_pool_alloc(unsigned int __nocast gfp_flags, void *data) 50static void * r10bio_pool_alloc(gfp_t gfp_flags, void *data)
51{ 51{
52 conf_t *conf = data; 52 conf_t *conf = data;
53 r10bio_t *r10_bio; 53 r10bio_t *r10_bio;
@@ -81,7 +81,7 @@ static void r10bio_pool_free(void *r10_bio, void *data)
81 * one for write (we recover only one drive per r10buf) 81 * one for write (we recover only one drive per r10buf)
82 * 82 *
83 */ 83 */
84static void * r10buf_pool_alloc(unsigned int __nocast gfp_flags, void *data) 84static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)
85{ 85{
86 conf_t *conf = data; 86 conf_t *conf = data;
87 struct page *page; 87 struct page *page;
diff --git a/drivers/md/raid6.h b/drivers/md/raid6.h
index f80ee6350edf..31cbee71365f 100644
--- a/drivers/md/raid6.h
+++ b/drivers/md/raid6.h
@@ -69,9 +69,13 @@ extern const char raid6_empty_zero_page[PAGE_SIZE];
69#define __init 69#define __init
70#define __exit 70#define __exit
71#define __attribute_const__ __attribute__((const)) 71#define __attribute_const__ __attribute__((const))
72#define noinline __attribute__((noinline))
72 73
73#define preempt_enable() 74#define preempt_enable()
74#define preempt_disable() 75#define preempt_disable()
76#define cpu_has_feature(x) 1
77#define enable_kernel_altivec()
78#define disable_kernel_altivec()
75 79
76#endif /* __KERNEL__ */ 80#endif /* __KERNEL__ */
77 81
diff --git a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c
index acf386fc4b4f..51c63c0cf1c9 100644
--- a/drivers/md/raid6algos.c
+++ b/drivers/md/raid6algos.c
@@ -19,6 +19,7 @@
19#include "raid6.h" 19#include "raid6.h"
20#ifndef __KERNEL__ 20#ifndef __KERNEL__
21#include <sys/mman.h> 21#include <sys/mman.h>
22#include <stdio.h>
22#endif 23#endif
23 24
24struct raid6_calls raid6_call; 25struct raid6_calls raid6_call;
diff --git a/drivers/md/raid6altivec.uc b/drivers/md/raid6altivec.uc
index 1de8f030eee0..b9afd35b8812 100644
--- a/drivers/md/raid6altivec.uc
+++ b/drivers/md/raid6altivec.uc
@@ -27,16 +27,20 @@
27#ifdef CONFIG_ALTIVEC 27#ifdef CONFIG_ALTIVEC
28 28
29#include <altivec.h> 29#include <altivec.h>
30#include <asm/system.h> 30#ifdef __KERNEL__
31#include <asm/cputable.h> 31# include <asm/system.h>
32# include <asm/cputable.h>
33#endif
32 34
33/* 35/*
34 * This is the C data type to use 36 * This is the C data type to use. We use a vector of
37 * signed char so vec_cmpgt() will generate the right
38 * instruction.
35 */ 39 */
36 40
37typedef vector unsigned char unative_t; 41typedef vector signed char unative_t;
38 42
39#define NBYTES(x) ((vector unsigned char) {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x}) 43#define NBYTES(x) ((vector signed char) {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x})
40#define NSIZE sizeof(unative_t) 44#define NSIZE sizeof(unative_t)
41 45
42/* 46/*
@@ -108,7 +112,11 @@ int raid6_have_altivec(void);
108int raid6_have_altivec(void) 112int raid6_have_altivec(void)
109{ 113{
110 /* This assumes either all CPUs have Altivec or none does */ 114 /* This assumes either all CPUs have Altivec or none does */
115# ifdef __KERNEL__
111 return cpu_has_feature(CPU_FTR_ALTIVEC); 116 return cpu_has_feature(CPU_FTR_ALTIVEC);
117# else
118 return 1;
119# endif
112} 120}
113#endif 121#endif
114 122
diff --git a/drivers/md/raid6test/Makefile b/drivers/md/raid6test/Makefile
index 557806728609..78e0396adf2a 100644
--- a/drivers/md/raid6test/Makefile
+++ b/drivers/md/raid6test/Makefile
@@ -8,6 +8,8 @@ OPTFLAGS = -O2 # Adjust as desired
8CFLAGS = -I.. -g $(OPTFLAGS) 8CFLAGS = -I.. -g $(OPTFLAGS)
9LD = ld 9LD = ld
10PERL = perl 10PERL = perl
11AR = ar
12RANLIB = ranlib
11 13
12.c.o: 14.c.o:
13 $(CC) $(CFLAGS) -c -o $@ $< 15 $(CC) $(CFLAGS) -c -o $@ $<
@@ -18,18 +20,33 @@ PERL = perl
18%.uc: ../%.uc 20%.uc: ../%.uc
19 cp -f $< $@ 21 cp -f $< $@
20 22
21all: raid6.o raid6test 23all: raid6.a raid6test
22 24
23raid6.o: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \ 25raid6.a: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \
24 raid6int32.o \ 26 raid6int32.o \
25 raid6mmx.o raid6sse1.o raid6sse2.o \ 27 raid6mmx.o raid6sse1.o raid6sse2.o \
28 raid6altivec1.o raid6altivec2.o raid6altivec4.o raid6altivec8.o \
26 raid6recov.o raid6algos.o \ 29 raid6recov.o raid6algos.o \
27 raid6tables.o 30 raid6tables.o
28 $(LD) -r -o $@ $^ 31 rm -f $@
32 $(AR) cq $@ $^
33 $(RANLIB) $@
29 34
30raid6test: raid6.o test.c 35raid6test: test.c raid6.a
31 $(CC) $(CFLAGS) -o raid6test $^ 36 $(CC) $(CFLAGS) -o raid6test $^
32 37
38raid6altivec1.c: raid6altivec.uc ../unroll.pl
39 $(PERL) ../unroll.pl 1 < raid6altivec.uc > $@
40
41raid6altivec2.c: raid6altivec.uc ../unroll.pl
42 $(PERL) ../unroll.pl 2 < raid6altivec.uc > $@
43
44raid6altivec4.c: raid6altivec.uc ../unroll.pl
45 $(PERL) ../unroll.pl 4 < raid6altivec.uc > $@
46
47raid6altivec8.c: raid6altivec.uc ../unroll.pl
48 $(PERL) ../unroll.pl 8 < raid6altivec.uc > $@
49
33raid6int1.c: raid6int.uc ../unroll.pl 50raid6int1.c: raid6int.uc ../unroll.pl
34 $(PERL) ../unroll.pl 1 < raid6int.uc > $@ 51 $(PERL) ../unroll.pl 1 < raid6int.uc > $@
35 52
@@ -52,7 +69,7 @@ raid6tables.c: mktables
52 ./mktables > raid6tables.c 69 ./mktables > raid6tables.c
53 70
54clean: 71clean:
55 rm -f *.o mktables mktables.c raid6int.uc raid6*.c raid6test 72 rm -f *.o *.a mktables mktables.c raid6int.uc raid6*.c raid6test
56 73
57spotless: clean 74spotless: clean
58 rm -f *~ 75 rm -f *~