summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/extents.c
diff options
context:
space:
mode:
authorNicholas Swenson <nks@daterainc.com>2013-11-12 07:36:25 +0400
committerKent Overstreet <kmo@daterainc.com>2014-01-09 01:05:14 +0400
commit3bdad1e40d11aad31f2322f21e943c31ef20d9da (patch)
tree2b268d6b0944b97338d3b7a190443551b565e562 /drivers/md/bcache/extents.c
parent0f49cf3d83fbf038534c9302095b66b07b9838c3 (diff)
downloadlinux-3bdad1e40d11aad31f2322f21e943c31ef20d9da.tar.xz
bcache: Add bch_bkey_equal_header()
Checks if two keys have equivalent header fields. (good enough for replacement or merging) Used in bch_bkey_try_merge, and replacing a key in the btree. Signed-off-by: Nicholas Swenson <nks@daterainc.com> Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/extents.c')
-rw-r--r--drivers/md/bcache/extents.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c
index 7d73d8625522..c3ead586dc27 100644
--- a/drivers/md/bcache/extents.c
+++ b/drivers/md/bcache/extents.c
@@ -372,8 +372,7 @@ static bool bch_extent_insert_fixup(struct btree_keys *b,
if (KEY_START(k) > KEY_START(insert) + sectors_found)
goto check_failed;
- if (KEY_PTRS(k) != KEY_PTRS(replace_key) ||
- KEY_DIRTY(k) != KEY_DIRTY(replace_key))
+ if (!bch_bkey_equal_header(k, replace_key))
goto check_failed;
/* skip past gen */