From f1934a551338d3f82630fed67f48b5b361cb064a Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 1 Dec 2020 11:50:54 -0500 Subject: [PATCH] rados: add a file to expose librados operation flags to our rados pkg These flags are passed to the *_op_operate calls in the C API. Signed-off-by: John Mulligan --- rados/operation_flags.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 rados/operation_flags.go diff --git a/rados/operation_flags.go b/rados/operation_flags.go new file mode 100644 index 0000000..957f4f2 --- /dev/null +++ b/rados/operation_flags.go @@ -0,0 +1,37 @@ +package rados + +// #cgo LDFLAGS: -lrados +// #include +// #include +// #include +// +import "C" + +// OperationFlags control the behavior of read and write operations. +type OperationFlags int + +const ( + // OperationNoFlag indicates no special behavior is requested. + OperationNoFlag = OperationFlags(C.LIBRADOS_OPERATION_NOFLAG) + // OperationBalanceReads TODO + OperationBalanceReads = OperationFlags(C.LIBRADOS_OPERATION_BALANCE_READS) + // OperationLocalizeReads TODO + OperationLocalizeReads = OperationFlags(C.LIBRADOS_OPERATION_LOCALIZE_READS) + // OperationOrderReadsWrites TODO + OperationOrderReadsWrites = OperationFlags(C.LIBRADOS_OPERATION_ORDER_READS_WRITES) + // OperationIgnoreCache TODO + OperationIgnoreCache = OperationFlags(C.LIBRADOS_OPERATION_IGNORE_CACHE) + // OperationSkipRWLocks TODO + OperationSkipRWLocks = OperationFlags(C.LIBRADOS_OPERATION_SKIPRWLOCKS) + // OperationIgnoreOverlay TODO + OperationIgnoreOverlay = OperationFlags(C.LIBRADOS_OPERATION_IGNORE_OVERLAY) + // OperationFullTry send request to a full cluster or pool, ops such as delete + // can succeed while other ops will return out-of-space errors. + OperationFullTry = OperationFlags(C.LIBRADOS_OPERATION_FULL_TRY) + // OperationFullForce TODO + OperationFullForce = OperationFlags(C.LIBRADOS_OPERATION_FULL_FORCE) + // OperationIgnoreRedirect TODO + OperationIgnoreRedirect = OperationFlags(C.LIBRADOS_OPERATION_IGNORE_REDIRECT) + // OperationOrderSnap TODO + OperationOrderSnap = OperationFlags(C.LIBRADOS_OPERATION_ORDERSNAP) +)