mirror of https://github.com/ceph/go-ceph
rados: add CleanOmap WriteOp function
Reimplement CleanOmap in term of a new CleanOmap function on the WriteOp. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
f4e0730b8f
commit
570738b24c
|
@ -320,14 +320,8 @@ func (ioctx *IOContext) RmOmapKeys(oid string, keys []string) error {
|
|||
|
||||
// CleanOmap clears the omap `oid`
|
||||
func (ioctx *IOContext) CleanOmap(oid string) error {
|
||||
c_oid := C.CString(oid)
|
||||
defer C.free(unsafe.Pointer(c_oid))
|
||||
|
||||
op := C.rados_create_write_op()
|
||||
C.rados_write_op_omap_clear(op)
|
||||
|
||||
ret := C.rados_write_op_operate(op, ioctx.ioctx, c_oid, nil, 0)
|
||||
C.rados_release_write_op(op)
|
||||
|
||||
return getError(ret)
|
||||
op := CreateWriteOp()
|
||||
defer op.Release()
|
||||
op.CleanOmap()
|
||||
return op.operateCompat(ioctx, oid)
|
||||
}
|
||||
|
|
|
@ -111,3 +111,8 @@ func (w *WriteOp) RmOmapKeys(keys []string) {
|
|||
roks.cKeys,
|
||||
roks.cNum)
|
||||
}
|
||||
|
||||
// CleanOmap clears the omap `oid`.
|
||||
func (w *WriteOp) CleanOmap() {
|
||||
C.rados_write_op_omap_clear(w.op)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue