aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2012-07-27 10:07:57 -0400
committerAlasdair G Kergon <agk@redhat.com>2012-07-27 10:07:57 -0400
commit17b7d63f7ed10376e762fdfadbc65da6687d569a (patch)
tree5de13953644dab7ca76b0b924558503f0c8a7860
parent7768ed33ccdc02801c4483fc5682dc66ace14aea (diff)
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: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r--drivers/md/dm-thin-metadata.c2
-rw-r--r--drivers/md/dm-thin-metadata.h2
-rw-r--r--drivers/md/dm-thin.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index 3e2907f0bc4..c858931d2dc 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -1262,7 +1262,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td)
1262 return td->id; 1262 return td->id;
1263} 1263}
1264 1264
1265static int __snapshotted_since(struct dm_thin_device *td, uint32_t time) 1265static bool __snapshotted_since(struct dm_thin_device *td, uint32_t time)
1266{ 1266{
1267 return td->snapshotted_time > time; 1267 return td->snapshotted_time > time;
1268} 1268}
diff --git a/drivers/md/dm-thin-metadata.h b/drivers/md/dm-thin-metadata.h
index b88918ccdaf..7b47c0a9a8e 100644
--- a/drivers/md/dm-thin-metadata.h
+++ b/drivers/md/dm-thin-metadata.h
@@ -119,7 +119,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td);
119 119
120struct dm_thin_lookup_result { 120struct dm_thin_lookup_result {
121 dm_block_t block; 121 dm_block_t block;
122 int shared; 122 unsigned shared:1;
123}; 123};
124 124
125/* 125/*
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 18f87b0def1..0bb9e646e21 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1218,7 +1218,7 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
1218 */ 1218 */
1219 m = get_next_mapping(pool); 1219 m = get_next_mapping(pool);
1220 m->tc = tc; 1220 m->tc = tc;
1221 m->pass_discard = (!lookup_result.shared) & pool->pf.discard_passdown; 1221 m->pass_discard = (!lookup_result.shared) && pool->pf.discard_passdown;
1222 m->virt_block = block; 1222 m->virt_block = block;
1223 m->data_block = lookup_result.block; 1223 m->data_block = lookup_result.block;
1224 m->cell = cell; 1224 m->cell = cell;