diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-07-28 18:35:09 -0700 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2014-01-08 13:05:12 -0800 |
commit | 911c9610099f26e9e6ea3d1962ce24f53890b163 (patch) | |
tree | 21dc0ae5850dc64756974aedacc0380a3e01b12e /drivers/md/bcache/btree.c | |
parent | fafff81cead78157099df1ee10af16cc51893ddc (diff) | |
download | op-kernel-dev-911c9610099f26e9e6ea3d1962ce24f53890b163.zip op-kernel-dev-911c9610099f26e9e6ea3d1962ce24f53890b163.tar.gz |
bcache: Split out sort_extent_cmp()
Only use extent comparison for comparing extents, so we're not using
START_KEY() on other key types (i.e. btree pointers)
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r-- | drivers/md/bcache/btree.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 8aaaf16..e1e36e7 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -1854,10 +1854,16 @@ static bool fix_overlapping_extents(struct btree *b, struct bkey *insert, while (1) { struct bkey *k = bch_btree_iter_next(iter); - if (!k || - bkey_cmp(&START_KEY(k), insert) >= 0) + if (!k) break; + if (bkey_cmp(&START_KEY(k), insert) >= 0) { + if (KEY_SIZE(k)) + break; + else + continue; + } + if (bkey_cmp(k, &START_KEY(insert)) <= 0) continue; |