aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2024-01-26 21:45:31 -0500
committerMike Snitzer <snitzer@kernel.org>2024-02-20 13:43:17 -0500
commit97b6f0e752ce862759c95ab0e83d84623236bb8d (patch)
tree6d14d23080a7cad29dec3a865412fcd1c81c265d /drivers/md
parentf7c1c2e085cd8232e24ebae6a0a72998010ea8cc (diff)
downloadlinux-97b6f0e752ce862759c95ab0e83d84623236bb8d.tar.gz
dm vdo data-vio: rename is_trim flag to is_discard
Eliminate use of "trim" in favor of "discard" since it reflects the top-level Linux discard primative rather than the ATA specific ditto. Signed-off-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Matthew Sakai <msakai@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/block-map.c4
-rw-r--r--drivers/md/dm-vdo/data-vio.c16
-rw-r--r--drivers/md/dm-vdo/data-vio.h2
-rw-r--r--drivers/md/dm-vdo/types.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c
index 50dda7ae70741..54ad6939cab72 100644
--- a/drivers/md/dm-vdo/block-map.c
+++ b/drivers/md/dm-vdo/block-map.c
@@ -2194,8 +2194,8 @@ static void allocate_block_map_page(struct block_map_zone *zone,
{
int result;
- if (!data_vio->write || data_vio->is_trim) {
- /* This is a pure read or a trim, so there's nothing left to do here. */
+ if (!data_vio->write || data_vio->is_discard) {
+ /* This is a pure read or a discard, so there's nothing left to do here. */
finish_lookup(data_vio, VDO_SUCCESS);
return;
}
diff --git a/drivers/md/dm-vdo/data-vio.c b/drivers/md/dm-vdo/data-vio.c
index 7d8100f29e134..328b645dee162 100644
--- a/drivers/md/dm-vdo/data-vio.c
+++ b/drivers/md/dm-vdo/data-vio.c
@@ -553,7 +553,7 @@ static void launch_bio(struct vdo *vdo, struct data_vio *data_vio, struct bio *b
if (bio_op(bio) == REQ_OP_DISCARD) {
data_vio->remaining_discard = bio->bi_iter.bi_size;
data_vio->write = true;
- data_vio->is_trim = true;
+ data_vio->is_discard = true;
if (data_vio->is_partial) {
vdo_count_bios(&vdo->stats.bios_in_partial, bio);
data_vio->read = true;
@@ -1990,10 +1990,10 @@ static void handle_allocation_error(struct vdo_completion *completion)
handle_data_vio_error(completion);
}
-static int assert_is_trim(struct data_vio *data_vio)
+static int assert_is_discard(struct data_vio *data_vio)
{
- int result = ASSERT(data_vio->is_trim,
- "data_vio with no block map page is a trim");
+ int result = ASSERT(data_vio->is_discard,
+ "data_vio with no block map page is a discard");
return ((result == VDO_SUCCESS) ? result : VDO_READ_ONLY);
}
@@ -2019,19 +2019,19 @@ void continue_data_vio_with_block_map_slot(struct vdo_completion *completion)
if (data_vio->tree_lock.tree_slots[0].block_map_slot.pbn == VDO_ZERO_BLOCK) {
/*
- * This is a trim for a block on a block map page which has not been allocated, so
+ * This is a discard for a block on a block map page which has not been allocated, so
* there's nothing more we need to do.
*/
completion->callback = complete_data_vio;
- continue_data_vio_with_error(data_vio, assert_is_trim(data_vio));
+ continue_data_vio_with_error(data_vio, assert_is_discard(data_vio));
return;
}
/*
- * We need an allocation if this is neither a full-block trim nor a
+ * We need an allocation if this is neither a full-block discard nor a
* full-block zero write.
*/
- if (!data_vio->is_zero && (!data_vio->is_trim || data_vio->is_partial)) {
+ if (!data_vio->is_zero && (!data_vio->is_discard || data_vio->is_partial)) {
data_vio_allocate_data_block(data_vio, VIO_WRITE_LOCK, allocate_block,
handle_allocation_error);
return;
diff --git a/drivers/md/dm-vdo/data-vio.h b/drivers/md/dm-vdo/data-vio.h
index f5a683968d1c0..78744d064e963 100644
--- a/drivers/md/dm-vdo/data-vio.h
+++ b/drivers/md/dm-vdo/data-vio.h
@@ -199,7 +199,7 @@ struct data_vio {
u16 write : 1;
u16 fua : 1;
u16 is_zero : 1;
- u16 is_trim : 1;
+ u16 is_discard : 1;
u16 is_partial : 1;
u16 is_duplicate : 1;
u16 first_reference_operation_complete : 1;
diff --git a/drivers/md/dm-vdo/types.h b/drivers/md/dm-vdo/types.h
index abc6d36f65225..dbe892b10f265 100644
--- a/drivers/md/dm-vdo/types.h
+++ b/drivers/md/dm-vdo/types.h
@@ -144,7 +144,7 @@ struct block_map_slot {
/*
* Four bits of each five-byte block map entry contain a mapping state value used to distinguish
- * unmapped or trimmed logical blocks (which are treated as mapped to the zero block) from entries
+ * unmapped or discarded logical blocks (which are treated as mapped to the zero block) from entries
* that have been mapped to a physical block, including the zero block.
*
* FIXME: these should maybe be defines.