]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
denc: add need_contiguous to denc_traits 15224/head
authorKefu Chai <kchai@redhat.com>
Tue, 23 May 2017 07:28:23 +0000 (15:28 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 24 May 2017 03:29:07 +0000 (11:29 +0800)
commit77fbfc29d15e3b9b05f7434bea8792077a18aa42
tree96140ae316c1f4cc8ce7048b381c0233cd864c06
parent5731e5fa8e27b0aaaabd3193b1a001b8d2cfd8a8
denc: add need_contiguous to denc_traits

so the decode() will not try to copy the bufferlist for a continous one
if the bufferlist is segmented *and* its length is greater than
CEPH_PAGE_SIZE (4K) if the decoded object does not "need_contiguous" per
its denc_traits<>.

copying a memory chunk could be expensive if the decoded bufferlist is
huge, so we should try to avoid this. this could happen when we read the
buffer from bluestore.

and drop the partial specialization for denc() which tries to differentiate
traits::featured and !traits::featured, it does not matter to
decode() if the type supports feature or not. the encode() does.

also use denc() in interval_set<>::decode(). unlike encode(), decode(),
encode_nohead() or decode_nohead(), denc() is not part of our legacy
dencoder, so i think it's fine and encouraged to use it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/denc.h
src/include/fs_types.h
src/include/interval_set.h
src/include/object.h
src/os/bluestore/bluestore_types.h
src/test/test_denc.cc