summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2019-06-28 19:59:55 +0800
committerJens Axboe <axboe@kernel.dk>2019-06-28 07:39:17 -0600
commite5ec5f4765ada9c75fb3eee93a6e72f0e50599d5 (patch)
treed084eba7ad58cc4852a9d6d58f4c539f4c155684 /Documentation
parent249a5f6da57c28a903c75d81505d58ec8c10030d (diff)
downloadlinux-e5ec5f4765ada9c75fb3eee93a6e72f0e50599d5.tar.gz
linux-e5ec5f4765ada9c75fb3eee93a6e72f0e50599d5.tar.bz2
linux-e5ec5f4765ada9c75fb3eee93a6e72f0e50599d5.zip
bcache: only clear BTREE_NODE_dirty bit when it is set
In bch_btree_cache_free() and btree_node_free(), BTREE_NODE_dirty is always set no matter btree node is dirty or not. The code looks like this, if (btree_node_dirty(b)) btree_complete_write(b, btree_current_write(b)); clear_bit(BTREE_NODE_dirty, &b->flags); Indeed if btree_node_dirty(b) returns false, it means BTREE_NODE_dirty bit is cleared, then it is unnecessary to clear the bit again. This patch only clears BTREE_NODE_dirty when btree_node_dirty(b) is true (the bit is set), to save a few CPU cycles. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions