]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: change diff_iterate interface to be more C-friendly
authorJosh Durgin <josh.durgin@inktank.com>
Sun, 31 Mar 2013 00:25:18 +0000 (17:25 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Mon, 1 Apr 2013 15:56:07 +0000 (08:56 -0700)
commitc680531e070aef46bde50a8185d3a48ff9f2d9df
tree6645437f14ffd9de8b793731b46e2f0ee8b9c6bc
parent8a1cbf3e742cf5f61446e28fd31268d93ab48bde
librbd: change diff_iterate interface to be more C-friendly

Use int instead of bool for the callback, and make it represent
whether the data exists, rather than the opposite, since callers
are likely to test for whether it's data instead of whether its zeroes.

Change the return value to 0, since an int64_t will wrap around
for large reads, and there's no value in reporting the length
read when it will always be the length requested clipped to the
size of the image.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/include/rbd/librbd.hpp
src/librbd/internal.cc
src/librbd/internal.h
src/librbd/librbd.cc
src/rbd.cc
src/test/librbd/test_librbd.cc