diff options
author | Nicholas Swenson <nks@daterainc.com> | 2013-11-11 19:36:25 -0800 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2014-01-08 13:05:14 -0800 |
commit | 3bdad1e40d11aad31f2322f21e943c31ef20d9da (patch) | |
tree | 2b268d6b0944b97338d3b7a190443551b565e562 /drivers/md/bcache/extents.c | |
parent | 0f49cf3d83fbf038534c9302095b66b07b9838c3 (diff) |
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.c | 3 |
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 */ |