Commit 17b7d63f authored by Mike Snitzer's avatar Mike Snitzer Committed by Alasdair G Kergon

dm thin: clean up compiler warning

Clean up "warning: dubious: !x & y".  Also make it clear that
__snapshotted_since() returns a bool and that dm_thin_lookup_result's
'shared' member is a flag.
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 7768ed33
...@@ -1262,7 +1262,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td) ...@@ -1262,7 +1262,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td)
return td->id; return td->id;
} }
static int __snapshotted_since(struct dm_thin_device *td, uint32_t time) static bool __snapshotted_since(struct dm_thin_device *td, uint32_t time)
{ {
return td->snapshotted_time > time; return td->snapshotted_time > time;
} }
......
...@@ -119,7 +119,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td); ...@@ -119,7 +119,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td);
struct dm_thin_lookup_result { struct dm_thin_lookup_result {
dm_block_t block; dm_block_t block;
int shared; unsigned shared:1;
}; };
/* /*
......
...@@ -1218,7 +1218,7 @@ static void process_discard(struct thin_c *tc, struct bio *bio) ...@@ -1218,7 +1218,7 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
*/ */
m = get_next_mapping(pool); m = get_next_mapping(pool);
m->tc = tc; m->tc = tc;
m->pass_discard = (!lookup_result.shared) & pool->pf.discard_passdown; m->pass_discard = (!lookup_result.shared) && pool->pf.discard_passdown;
m->virt_block = block; m->virt_block = block;
m->data_block = lookup_result.block; m->data_block = lookup_result.block;
m->cell = cell; m->cell = cell;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment