]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
buffer: make 0-length splice() a no-op
authorSage Weil <sage@inktank.com>
Tue, 28 Jan 2014 18:26:12 +0000 (10:26 -0800)
committerSage Weil <sage@inktank.com>
Tue, 28 Jan 2014 18:30:53 +0000 (10:30 -0800)
commit2528186c0dd327607b1e76a51581df72aeea52f2
treef9f97828117c1abd5651e922518c7976d56fa3af
parentfe9539e118a830aa71bc5846ad2693543213fc59
buffer: make 0-length splice() a no-op

This was causing a problem in the Striper, but fixing it here will avoid
corner cases all over the tree.  Note that we have to bail out before
the end-of-buffer check to avoid hitting that check when the bufferlist is
also empty.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit ff5abfbdae07ae8a56fa83ebaa92000896f793c2)
src/common/buffer.cc
src/test/bufferlist.cc