bcache: remove bch_crc64_update
authorChristoph Hellwig <hch@lst.de>
Wed, 20 Oct 2021 14:38:12 +0000 (22:38 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Oct 2021 14:40:54 +0000 (08:40 -0600)
bch_crc64_update is an entirely pointless wrapper around crc64_be.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20211020143812.6403-9-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/btree.c
drivers/md/bcache/request.c
drivers/md/bcache/util.h

index 0595559..93b67b8 100644 (file)
@@ -141,7 +141,7 @@ static uint64_t btree_csum_set(struct btree *b, struct bset *i)
        uint64_t crc = b->key.ptr[0];
        void *data = (void *) i + 8, *end = bset_bkey_last(i);
 
-       crc = bch_crc64_update(crc, data, end - data);
+       crc = crc64_be(crc, data, end - data);
        return crc ^ 0xffffffffffffffffULL;
 }
 
index f86909a..d15aae6 100644 (file)
@@ -46,7 +46,7 @@ static void bio_csum(struct bio *bio, struct bkey *k)
        bio_for_each_segment(bv, bio, iter) {
                void *d = kmap(bv.bv_page) + bv.bv_offset;
 
-               csum = bch_crc64_update(csum, d, bv.bv_len);
+               csum = crc64_be(csum, d, bv.bv_len);
                kunmap(bv.bv_page);
        }
 
index b64460a..6274d6a 100644 (file)
@@ -548,14 +548,6 @@ static inline uint64_t bch_crc64(const void *p, size_t len)
        return crc ^ 0xffffffffffffffffULL;
 }
 
-static inline uint64_t bch_crc64_update(uint64_t crc,
-                                       const void *p,
-                                       size_t len)
-{
-       crc = crc64_be(crc, p, len);
-       return crc;
-}
-
 /*
  * A stepwise-linear pseudo-exponential.  This returns 1 << (x >>
  * frac_bits), with the less-significant bits filled in by linear