Skip to content

Commit 692d0eb

Browse files
Mikulas Patockakergon
authored andcommitted
dm: remove limited barrier support
Prepare for full barrier implementation: first remove the restricted support. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent 9c47008 commit 692d0eb

5 files changed

Lines changed: 10 additions & 27 deletions

File tree

‎drivers/md/dm-linear.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ static struct target_type linear_target = {
142142
.status = linear_status,
143143
.ioctl = linear_ioctl,
144144
.merge = linear_merge,
145-
.features = DM_TARGET_SUPPORTS_BARRIERS,
146145
};
147146

148147
int __init dm_linear_init(void)

‎drivers/md/dm-table.c‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ struct dm_table {
5252
sector_t *highs;
5353
struct dm_target *targets;
5454

55-
unsigned barriers_supported:1;
56-
5755
/*
5856
* Indicates the rw permissions for the new logical
5957
* device. This should be a combination of FMODE_READ
@@ -243,7 +241,6 @@ int dm_table_create(struct dm_table **result, fmode_t mode,
243241

244242
INIT_LIST_HEAD(&t->devices);
245243
atomic_set(&t->holders, 0);
246-
t->barriers_supported = 1;
247244

248245
if (!num_targets)
249246
num_targets = KEYS_PER_NODE;
@@ -751,10 +748,6 @@ int dm_table_add_target(struct dm_table *t, const char *type,
751748
/* FIXME: the plan is to combine high here and then have
752749
* the merge fn apply the target level restrictions. */
753750
combine_restrictions_low(&t->limits, &tgt->limits);
754-
755-
if (!(tgt->type->features & DM_TARGET_SUPPORTS_BARRIERS))
756-
t->barriers_supported = 0;
757-
758751
return 0;
759752

760753
bad:
@@ -799,12 +792,6 @@ int dm_table_complete(struct dm_table *t)
799792

800793
check_for_valid_limits(&t->limits);
801794

802-
/*
803-
* We only support barriers if there is exactly one underlying device.
804-
*/
805-
if (!list_is_singular(&t->devices))
806-
t->barriers_supported = 0;
807-
808795
/* how many indexes will the btree have ? */
809796
leaf_nodes = dm_div_up(t->num_targets, KEYS_PER_NODE);
810797
t->depth = 1 + int_log(leaf_nodes, CHILDREN_PER_NODE);
@@ -1059,12 +1046,6 @@ struct mapped_device *dm_table_get_md(struct dm_table *t)
10591046
return t->md;
10601047
}
10611048

1062-
int dm_table_barrier_ok(struct dm_table *t)
1063-
{
1064-
return t->barriers_supported;
1065-
}
1066-
EXPORT_SYMBOL(dm_table_barrier_ok);
1067-
10681049
EXPORT_SYMBOL(dm_vcalloc);
10691050
EXPORT_SYMBOL(dm_get_device);
10701051
EXPORT_SYMBOL(dm_put_device);

‎drivers/md/dm.c‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -851,11 +851,7 @@ static void __split_and_process_bio(struct mapped_device *md, struct bio *bio)
851851
bio_io_error(bio);
852852
return;
853853
}
854-
if (unlikely(bio_barrier(bio) && !dm_table_barrier_ok(ci.map))) {
855-
dm_table_put(ci.map);
856-
bio_endio(bio, -EOPNOTSUPP);
857-
return;
858-
}
854+
859855
ci.md = md;
860856
ci.bio = bio;
861857
ci.io = alloc_io(md);
@@ -937,6 +933,15 @@ static int dm_request(struct request_queue *q, struct bio *bio)
937933
struct mapped_device *md = q->queuedata;
938934
int cpu;
939935

936+
/*
937+
* There is no use in forwarding any barrier request since we can't
938+
* guarantee it is (or can be) handled by the targets correctly.
939+
*/
940+
if (unlikely(bio_barrier(bio))) {
941+
bio_endio(bio, -EOPNOTSUPP);
942+
return 0;
943+
}
944+
940945
down_read(&md->io_lock);
941946

942947
cpu = part_stat_lock();

‎drivers/md/dm.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ int dm_table_any_congested(struct dm_table *t, int bdi_bits);
5252
* To check the return value from dm_table_find_target().
5353
*/
5454
#define dm_target_is_valid(t) ((t)->table)
55-
int dm_table_barrier_ok(struct dm_table *t);
5655

5756
/*-----------------------------------------------------------------
5857
* A registry of target types.

‎include/linux/device-mapper.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d);
116116
/*
117117
* Target features
118118
*/
119-
#define DM_TARGET_SUPPORTS_BARRIERS 0x00000001
120119

121120
struct target_type {
122121
uint64_t features;

0 commit comments

Comments
 (0)