Include common/likely.h in buffer.h

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Add safe-sharing to buffer::list and buffer::ptr.

Formerly known as "strong claim," this change introduces a new
sharable() property to ceph::buffer::raw objects, which can be
used to prevent unplanned sharing of buffers.

The default value of sharable() is true, but derived classes may
override this.  For example, Accelio message buffers may point to
registered or pool-allocated memory which should not be held for
long periods.

Cloning of non-sharable buffers is now the unmarked case, so is
performed automatically in the buffer::list copy constructor.
Low-level operations should allow explicit volatile sharing,
so copying a buffer::list:iterator or a buffer::ptr works as normal.

For explicit sharing of "non-sharable" buffers, a new boolean is added to
the public claim_* methods, and a buffer::list::share method is also
added, to share an entire sequence.

Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>

Conflicts:
	src/include/buffer.h

Signed-off-by: Matt Benjamin <matt@cohortfs.com>

Conflicts:
	src/common/buffer.cc

Signed-off-by: Matt Benjamin <matt@cohortfs.com>

new naming for "strong claim": clone_nonsharable

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Restore zero-copy buffers in OSD fast path.

This change restores volatile sharing semantics in the Message
decode path, and also in the OSD write path for FileStore/FileJournal.

This can be verified with a breakpoint set at the clone/COW case in
buffer::ptr::clone_nonsharable(currently buffer.cc:690).

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Message::set_data cannot preserve constness.

Signed-off-by: Matt Benjamin <matt@cohortfs.com>