]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: use assert_exists() to simplify copyup check
authorSage Weil <sage@inktank.com>
Tue, 23 Oct 2012 00:57:08 +0000 (17:57 -0700)
committerSage Weil <sage@inktank.com>
Tue, 23 Oct 2012 04:04:30 +0000 (21:04 -0700)
commit4240846f5cf1525952ac42c0d6eddf9dfa459ce4
tree59e42318dc626bd3b90e4935056ec83f847cf784
parente609c8ac54aade8b8afdfe9f0ad80308b9c89c2e
librbd: use assert_exists() to simplify copyup check

Previously we would explicitly STAT the object to see if it exists before
sending the write to the OSD.  Instead, send the write optimistically, and
assert that the object already exists.  This avoids an extra round trip in
the optimistic/common case, and makes the existence check in the initial
first-write case more expensive because we send the data payload along.

Signed-off-by: Sage Weil <sage@inktank.com>
src/librbd/AioRequest.cc
src/librbd/AioRequest.h