dm thin: clean up compiler warning
authorMike Snitzer <snitzer@redhat.com>
Fri, 27 Jul 2012 14:07:57 +0000 (15:07 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Fri, 27 Jul 2012 14:07:57 +0000 (15:07 +0100)
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>
drivers/md/dm-thin-metadata.c
drivers/md/dm-thin-metadata.h
drivers/md/dm-thin.c

index 3e2907f0bc462e261c05fab97cb0bff272649868..c858931d2dcbca7df8eb9026ae9d6d0fbff843f5 100644 (file)
@@ -1262,7 +1262,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td)
        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;
 }
index b88918ccdaf688e3bc5f10478023276893cc3521..7b47c0a9a8e3bf5fbe6eacfa1fa8d3c1e3b0959d 100644 (file)
@@ -119,7 +119,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td);
 
 struct dm_thin_lookup_result {
        dm_block_t block;
-       int shared;
+       unsigned shared:1;
 };
 
 /*
index 18f87b0def1266eac12bf798ed036b4aa8e8f4ce..0bb9e646e215cf82c7592dc61bc33e9d4c0638bd 100644 (file)
@@ -1218,7 +1218,7 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
                         */
                        m = get_next_mapping(pool);
                        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->data_block = lookup_result.block;
                        m->cell = cell;