Skip to content

Commit a2daeab

Browse files
committed
Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.18/drivers
Pull MD fixes from Song: "Most of these changes are minor fixes and clean-ups." * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: use msleep() in md_notify_reboot() lib/raid6: Include <asm/ppc-opcode.h> for VPERMXOR lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3 lib/raid6/test: fix multiple definition linking error md: raid1/raid10: drop pending_cnt
2 parents a763706 + 7d959f6 commit a2daeab

9 files changed

Lines changed: 13 additions & 31 deletions

File tree

drivers/md/md.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9582,7 +9582,7 @@ static int md_notify_reboot(struct notifier_block *this,
95829582
* driver, we do want to have a safe RAID driver ...
95839583
*/
95849584
if (need_delay)
9585-
mdelay(1000*1);
9585+
msleep(1000);
95869586

95879587
return NOTIFY_DONE;
95889588
}

drivers/md/raid1-10.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ struct resync_pages {
2828
struct page *pages[RESYNC_PAGES];
2929
};
3030

31+
struct raid1_plug_cb {
32+
struct blk_plug_cb cb;
33+
struct bio_list pending;
34+
};
35+
3136
static void rbio_pool_free(void *rbio, void *data)
3237
{
3338
kfree(rbio);

drivers/md/raid1.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,6 @@ static void flush_pending_writes(struct r1conf *conf)
824824
struct bio *bio;
825825

826826
bio = bio_list_get(&conf->pending_bio_list);
827-
conf->pending_count = 0;
828827
spin_unlock_irq(&conf->device_lock);
829828

830829
/*
@@ -1167,12 +1166,6 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio,
11671166
bio_put(behind_bio);
11681167
}
11691168

1170-
struct raid1_plug_cb {
1171-
struct blk_plug_cb cb;
1172-
struct bio_list pending;
1173-
int pending_cnt;
1174-
};
1175-
11761169
static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule)
11771170
{
11781171
struct raid1_plug_cb *plug = container_of(cb, struct raid1_plug_cb,
@@ -1184,7 +1177,6 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule)
11841177
if (from_schedule || current->bio_list) {
11851178
spin_lock_irq(&conf->device_lock);
11861179
bio_list_merge(&conf->pending_bio_list, &plug->pending);
1187-
conf->pending_count += plug->pending_cnt;
11881180
spin_unlock_irq(&conf->device_lock);
11891181
wake_up(&conf->wait_barrier);
11901182
md_wakeup_thread(mddev->thread);
@@ -1588,11 +1580,9 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
15881580
plug = NULL;
15891581
if (plug) {
15901582
bio_list_add(&plug->pending, mbio);
1591-
plug->pending_cnt++;
15921583
} else {
15931584
spin_lock_irqsave(&conf->device_lock, flags);
15941585
bio_list_add(&conf->pending_bio_list, mbio);
1595-
conf->pending_count++;
15961586
spin_unlock_irqrestore(&conf->device_lock, flags);
15971587
md_wakeup_thread(mddev->thread);
15981588
}
@@ -3058,7 +3048,6 @@ static struct r1conf *setup_conf(struct mddev *mddev)
30583048
init_waitqueue_head(&conf->wait_barrier);
30593049

30603050
bio_list_init(&conf->pending_bio_list);
3061-
conf->pending_count = 0;
30623051
conf->recovery_disabled = mddev->recovery_disabled - 1;
30633052

30643053
err = -EIO;

drivers/md/raid1.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ struct r1conf {
8787

8888
/* queue pending writes to be submitted on unplug */
8989
struct bio_list pending_bio_list;
90-
int pending_count;
9190

9291
/* for use when syncing mirrors:
9392
* We don't allow both normal IO and resync/recovery IO at

drivers/md/raid10.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,6 @@ static void flush_pending_writes(struct r10conf *conf)
861861
struct bio *bio;
862862

863863
bio = bio_list_get(&conf->pending_bio_list);
864-
conf->pending_count = 0;
865864
spin_unlock_irq(&conf->device_lock);
866865

867866
/*
@@ -1054,24 +1053,16 @@ static sector_t choose_data_offset(struct r10bio *r10_bio,
10541053
return rdev->new_data_offset;
10551054
}
10561055

1057-
struct raid10_plug_cb {
1058-
struct blk_plug_cb cb;
1059-
struct bio_list pending;
1060-
int pending_cnt;
1061-
};
1062-
10631056
static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule)
10641057
{
1065-
struct raid10_plug_cb *plug = container_of(cb, struct raid10_plug_cb,
1066-
cb);
1058+
struct raid1_plug_cb *plug = container_of(cb, struct raid1_plug_cb, cb);
10671059
struct mddev *mddev = plug->cb.data;
10681060
struct r10conf *conf = mddev->private;
10691061
struct bio *bio;
10701062

10711063
if (from_schedule || current->bio_list) {
10721064
spin_lock_irq(&conf->device_lock);
10731065
bio_list_merge(&conf->pending_bio_list, &plug->pending);
1074-
conf->pending_count += plug->pending_cnt;
10751066
spin_unlock_irq(&conf->device_lock);
10761067
wake_up(&conf->wait_barrier);
10771068
md_wakeup_thread(mddev->thread);
@@ -1238,7 +1229,7 @@ static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_bio,
12381229
const unsigned long do_fua = (bio->bi_opf & REQ_FUA);
12391230
unsigned long flags;
12401231
struct blk_plug_cb *cb;
1241-
struct raid10_plug_cb *plug = NULL;
1232+
struct raid1_plug_cb *plug = NULL;
12421233
struct r10conf *conf = mddev->private;
12431234
struct md_rdev *rdev;
12441235
int devnum = r10_bio->devs[n_copy].devnum;
@@ -1280,16 +1271,14 @@ static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_bio,
12801271

12811272
cb = blk_check_plugged(raid10_unplug, mddev, sizeof(*plug));
12821273
if (cb)
1283-
plug = container_of(cb, struct raid10_plug_cb, cb);
1274+
plug = container_of(cb, struct raid1_plug_cb, cb);
12841275
else
12851276
plug = NULL;
12861277
if (plug) {
12871278
bio_list_add(&plug->pending, mbio);
1288-
plug->pending_cnt++;
12891279
} else {
12901280
spin_lock_irqsave(&conf->device_lock, flags);
12911281
bio_list_add(&conf->pending_bio_list, mbio);
1292-
conf->pending_count++;
12931282
spin_unlock_irqrestore(&conf->device_lock, flags);
12941283
md_wakeup_thread(mddev->thread);
12951284
}

drivers/md/raid10.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ struct r10conf {
7575

7676
/* queue pending writes and submit them on unplug */
7777
struct bio_list pending_bio_list;
78-
int pending_count;
7978

8079
spinlock_t resync_lock;
8180
atomic_t nr_pending;

lib/raid6/test/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# from userspace.
55
#
66

7+
pound := \#
8+
79
CC = gcc
810
OPTFLAGS = -O2 # Adjust as desired
911
CFLAGS = -I.. -I ../../../include -g $(OPTFLAGS)
@@ -42,7 +44,7 @@ else ifeq ($(HAS_NEON),yes)
4244
OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
4345
CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1
4446
else
45-
HAS_ALTIVEC := $(shell printf '\#include <altivec.h>\nvector int a;\n' |\
47+
HAS_ALTIVEC := $(shell printf '$(pound)include <altivec.h>\nvector int a;\n' |\
4648
gcc -c -x c - >/dev/null && rm ./-.o && echo yes)
4749
ifeq ($(HAS_ALTIVEC),yes)
4850
CFLAGS += -I../../../arch/powerpc/include

lib/raid6/test/test.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#define NDISKS 16 /* Including P and Q */
2020

2121
const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
22-
struct raid6_calls raid6_call;
2322

2423
char *dataptrs[NDISKS];
2524
char data[NDISKS][PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));

lib/raid6/vpermxor.uc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#ifdef CONFIG_ALTIVEC
2525

2626
#include <altivec.h>
27+
#include <asm/ppc-opcode.h>
2728
#ifdef __KERNEL__
2829
#include <asm/cputable.h>
29-
#include <asm/ppc-opcode.h>
3030
#include <asm/switch_to.h>
3131
#endif
3232

0 commit comments

Comments
 (0)