]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: add new extent comparison op
authorMike Christie <michaelc@cs.wisc.edu>
Wed, 29 Jul 2015 09:25:45 +0000 (04:25 -0500)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2015 10:24:18 +0000 (11:24 +0100)
commit745f3617d3ec3c41e5c3401e20c92a4c2d9ae774
tree19cebb4632e251f2bd383bb10969fe9c8aaead13
parent9246b1e776a646254f42ff4117ef0e8efeee6702
osd: add new extent comparison op

This goes with kernel patch
    libceph: add support for CMPEXT compare extent requests
and
    rbd: add support for COMPARE_AND_WRITE/CMPEXT

This adds support for the CMPEXT request. The request will compare
extent.length bytes and compare them to extent.length bytes at
extent.offset on disk. If there is a miscompare the osd will return
-EILSEQ, the offset in the buffer where it occurred, and the buffer.

This op is going to be used for SCSI COMPARE_AND_WRITE support. For this
SCSI command, we are required to atomically do the CMPEXT operation and if
successful do a WRITE operation. The kernel rbd client is sending those
two ops in a multi op request.

Note: I am still working on the locking for this operation. Is there
a local lock I can take?

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: David Disseldorp <ddiss@suse.de>
(cherry picked from commit 54fbbe64754d2641c84605159122168ecd144bec)
src/include/rados.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h