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)