Replacing my_zero_fill_bio with zero_fill_bio
authorvenkat <venkat@fsl.cs.sunysb.edu>
Wed, 21 Dec 2016 22:53:28 +0000 (17:53 -0500)
committervenkat <venkat@fsl.cs.sunysb.edu>
Wed, 21 Dec 2016 22:53:28 +0000 (17:53 -0500)
Removed the my_zero_fill_bio fuction definition and used the kernel library function zero_fill_bio instead.

drivers/md/dm-dedup-rw.c

index 7947f7989849b8d1db1af9f44b81500bcbea2ea1..5981ff20b43d3c2d791672abc7e4e2096a43444a 100644 (file)
@@ -111,20 +111,6 @@ static void my_endio(struct bio *clone, int error)
        bio_put(clone);
 }
 
-/*
- * XXX: there  is existing zero_fill_bio() in the kernel,
- * should we use it?
- */
-static void my_zero_fill_bio(struct bio *bio)
-{
-       void *data;
-       unsigned int length;
-
-       data = bio_data(bio);
-       length = bio_cur_bytes(bio);
-       memset(data, 0, length);
-}
-
 static struct bio *create_bio(struct dedup_config *dc,
                              struct bio *bio)
 {
@@ -216,7 +202,7 @@ static struct bio *prepare_bio_without_pbn(struct dedup_config *dc,
        if (!clone)
                goto out;
 
-       my_zero_fill_bio(clone);
+       zero_fill_bio(clone);
 
        r = merge_data(dc, clone->bi_io_vec->bv_page, bio);
        if (r < 0)