diff options
author | Mike Snitzer <snitzer@redhat.com> | 2015-08-31 15:41:34 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-08-31 15:50:28 -0400 |
commit | dc9cee5db50afaf38506bc12eb479fb8ea536dba (patch) | |
tree | 2460e688bbd6a0eb26eb891ab5668e660e4fa4e1 /drivers/md/dm-cache-target.c | |
parent | 9153df7405ae04c1b0466de720e0a685cfea1a3a (diff) |
dm cache: small cleanups related to deferred prison cell cleanup
Eliminate __cell_release() since it only had one caller that always
released the cell holder.
Switch cell_error_with_code() to using free_prison_cell() for the sake
of consistency.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-target.c')
-rw-r--r-- | drivers/md/dm-cache-target.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 2f60cbf404e5..e13e5edf2298 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -1063,14 +1063,6 @@ static void dec_io_migrations(struct cache *cache) | |||
1063 | atomic_dec(&cache->nr_io_migrations); | 1063 | atomic_dec(&cache->nr_io_migrations); |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | static void __cell_release(struct cache *cache, struct dm_bio_prison_cell *cell, | ||
1067 | bool holder, struct bio_list *bios) | ||
1068 | { | ||
1069 | (holder ? dm_cell_release : dm_cell_release_no_holder) | ||
1070 | (cache->prison, cell, bios); | ||
1071 | free_prison_cell(cache, cell); | ||
1072 | } | ||
1073 | |||
1074 | static bool discard_or_flush(struct bio *bio) | 1066 | static bool discard_or_flush(struct bio *bio) |
1075 | { | 1067 | { |
1076 | return bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD); | 1068 | return bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD); |
@@ -1078,14 +1070,13 @@ static bool discard_or_flush(struct bio *bio) | |||
1078 | 1070 | ||
1079 | static void __cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell) | 1071 | static void __cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell) |
1080 | { | 1072 | { |
1081 | if (discard_or_flush(cell->holder)) | 1073 | if (discard_or_flush(cell->holder)) { |
1082 | /* | 1074 | /* |
1083 | * We have to handle these bios | 1075 | * We have to handle these bios individually. |
1084 | * individually. | ||
1085 | */ | 1076 | */ |
1086 | __cell_release(cache, cell, true, &cache->deferred_bios); | 1077 | dm_cell_release(cache->prison, cell, &cache->deferred_bios); |
1087 | 1078 | free_prison_cell(cache, cell); | |
1088 | else | 1079 | } else |
1089 | list_add_tail(&cell->user_list, &cache->deferred_cells); | 1080 | list_add_tail(&cell->user_list, &cache->deferred_cells); |
1090 | } | 1081 | } |
1091 | 1082 | ||
@@ -1112,7 +1103,7 @@ static void cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell, boo | |||
1112 | static void cell_error_with_code(struct cache *cache, struct dm_bio_prison_cell *cell, int err) | 1103 | static void cell_error_with_code(struct cache *cache, struct dm_bio_prison_cell *cell, int err) |
1113 | { | 1104 | { |
1114 | dm_cell_error(cache->prison, cell, err); | 1105 | dm_cell_error(cache->prison, cell, err); |
1115 | dm_bio_prison_free_cell(cache->prison, cell); | 1106 | free_prison_cell(cache, cell); |
1116 | } | 1107 | } |
1117 | 1108 | ||
1118 | static void cell_requeue(struct cache *cache, struct dm_bio_prison_cell *cell) | 1109 | static void cell_requeue(struct cache *cache, struct dm_bio_prison_cell *cell) |