From: Linus Torvalds Date: Wed, 22 Aug 2018 20:38:05 +0000 (-0700) Subject: Merge tag 'for-4.19/post-20180822' of git://git.kernel.dk/linux-block X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5bed49adfe899667887db0739830190309c9011b;p=linux.git Merge tag 'for-4.19/post-20180822' of git://git.kernel.dk/linux-block Pull more block updates from Jens Axboe: - Set of bcache fixes and changes (Coly) - The flush warn fix (me) - Small series of BFQ fixes (Paolo) - wbt hang fix (Ming) - blktrace fix (Steven) - blk-mq hardware queue count update fix (Jianchao) - Various little fixes * tag 'for-4.19/post-20180822' of git://git.kernel.dk/linux-block: (31 commits) block/DAC960.c: make some arrays static const, shrinks object size blk-mq: sync the update nr_hw_queues with blk_mq_queue_tag_busy_iter blk-mq: init hctx sched after update ctx and hctx mapping block: remove duplicate initialization tracing/blktrace: Fix to allow setting same value pktcdvd: fix setting of 'ret' error return for a few cases block: change return type to bool block, bfq: return nbytes and not zero from struct cftype .write() method block, bfq: improve code of bfq_bfqq_charge_time block, bfq: reduce write overcharge block, bfq: always update the budget of an entity when needed block, bfq: readd missing reset of parent-entity service blk-wbt: fix IO hang in wbt_wait() block: don't warn for flush on read-only device bcache: add the missing comments for smp_mb()/smp_wmb() bcache: remove unnecessary space before ioctl function pointer arguments bcache: add missing SPDX header bcache: move open brace at end of function definitions to next line bcache: add static const prefix to char * array declarations bcache: fix code comments style ... --- 5bed49adfe899667887db0739830190309c9011b diff --cc block/blk-core.c index 12550340418d9,5832c4003cfb7..dee56c282efb0 --- a/block/blk-core.c +++ b/block/blk-core.c @@@ -2162,10 -2161,12 +2161,12 @@@ static inline bool should_fail_request( static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part) { - if (part->policy && op_is_write(bio_op(bio))) { + const int op = bio_op(bio); + + if (part->policy && (op_is_write(op) && !op_is_flush(op))) { char b[BDEVNAME_SIZE]; - printk(KERN_ERR + WARN_ONCE(1, "generic_make_request: Trying to write " "to read-only block-device %s (partno %d)\n", bio_devname(bio, b), part->partno); diff --cc drivers/md/bcache/Kconfig index af247298409aa,817b9fba50db5..f6e0a8b3a61ed --- a/drivers/md/bcache/Kconfig +++ b/drivers/md/bcache/Kconfig @@@ -1,8 -1,7 +1,8 @@@ config BCACHE tristate "Block device as cache" + select CRC64 - ---help--- + help Allows a block device to be used as cache for other devices; uses a btree for indexing and the layout is optimized for SSDs. diff --cc drivers/md/bcache/util.h index 5ff055f0a653f,4e0ed19e32d3f..00aab6abcfe4f --- a/drivers/md/bcache/util.h +++ b/drivers/md/bcache/util.h @@@ -543,26 -543,11 +544,27 @@@ dup: #define RB_PREV(ptr, member) \ container_of_or_null(rb_prev(&(ptr)->member), typeof(*ptr), member) +static inline uint64_t bch_crc64(const void *p, size_t len) +{ + uint64_t crc = 0xffffffffffffffffULL; + + crc = crc64_be(crc, p, 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; +} + /* Does linear interpolation between powers of two */ - static inline unsigned fract_exp_two(unsigned x, unsigned fract_bits) + static inline unsigned int fract_exp_two(unsigned int x, + unsigned int fract_bits) { - unsigned fract = x & ~(~0 << fract_bits); + unsigned int fract = x & ~(~0 << fract_bits); x >>= fract_bits; x = 1 << x;