Commit Graph

206 Commits

Author SHA1 Message Date
John Mulligan 402707f2f5 rados: naming conventions: fixes in WriteFull function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan b7b21273e3 rados: naming conventions: fixes in Write function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 396e8f32ff rados: naming conventions: fixes in Unlock function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan e7cdc8fa68 rados: naming conventions: fixes in Truncate function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 3a7c059e82 rados: naming conventions: fixes in Stat function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 86d8bee873 rados: naming conventions: fixes in SetXattr function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan c27c941bef rados: naming conventions: fixes in SetNamespace function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_ns -> cns" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan f4a114fdd6 rados: naming conventions: fixes in RmXattr function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 4dc59eed6a rados: naming conventions: fixes in Read function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 64bfa59378 rados: naming conventions: fixes in LockShared function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan b3cdd63c76 rados: naming conventions: fixes in LockExclusive function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 22b0d4636e rados: naming conventions: fixes in ListXattrs function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 9f1fdbbe9e rados: naming conventions: fixes in ListObjects function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_entry -> cEntry" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan c45780d58d rados: naming conventions: fixes in ListLockers function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 1cb879d9e0 rados: naming conventions: fixes in GetXattr function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 4307dc99ec rados: naming conventions: fixes in GetPoolStats function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_stat -> cStat" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan aba1bfef37 rados: naming conventions: fixes in Delete function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 35d991cf64 rados: naming conventions: fixes in BreakLock function
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_client -> cClient" rados/ioctx.go
Command: gofmt -w -r "c_cookie -> cCookie" rados/ioctx.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan 6485854703 rados: naming conventions: fixes in Append function
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-07-26 14:07:47 -04:00
John Mulligan e0727d9cf7 rados: naming conventions: fix c_entry, c_namespace
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_entry -> cEntry" rados/object_iter.go
Command: gofmt -w -r "c_namespace -> cNamespace" rados/object_iter.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan f25ee98e0a rados: naming conventions: fix c_cluster_name, c_name
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_cluster_name -> cClusterName" rados/rados.go
Command: gofmt -w -r "c_name -> cName" rados/rados.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan 7f77d82bab rados: naming conventions: c_user -> cUser
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_user -> cUser" rados/rados.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan 801a9cc498 rados: naming conventions: fix c_major, c_minor, c_patch
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_major -> cMajor" rados/rados.go
Command: gofmt -w -r "c_minor -> cMinor" rados/rados.go
Command: gofmt -w -r "c_patch -> cPatch" rados/rados.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan 4c12ff0fda rados: naming conventions: c_stat -> cStat
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_stat -> cStat" rados/conn.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan 9619de1d84 rados: naming conventions: c_opt/c_val -> cOpt/cVal
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_opt -> cOpt" rados/conn.go
Command: gofmt -w -r "c_val -> cVal" rados/conn.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan debaac7031 rados: naming conventions: c_id -> cid
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_id -> cid" rados/conn.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan 46c860c614 rados: naming conventions: c_pool -> cPool
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_pool -> cPool" rados/conn.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan 5cbf7c6514 rados: naming conventions: c_path -> cPath
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_path -> cPath" rados/conn.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
John Mulligan d7f73e112d rados: naming conventions: c_name -> cName
Fix up variable names that don't meet Go standards.

Command: gofmt -w -r "c_name -> cName" rados/conn.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-06-28 13:51:01 -04:00
Mudit Agarwal 444050570c rados: add SetPoolFullTry() and UnsetPoolFullTry()
SetPoolFullTry() implements rados_set_pool_full_try() and
UnsetPoolFullTry() implements rados_unset_pool_full_try() octopus onwards.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2021-06-02 06:16:01 +00:00
Mudit Agarwal 4955746fb2 rados: add SetPoolFullTry() and UnsetPoolFullTry() for nautilus
SetPoolFullTry implements rados_set_osdmap_full_try() and
UnsetPoolFullTry implements rados_unset_osdmap_full_try() in
nautilus.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2021-06-02 06:16:01 +00:00
Mudit Agarwal 39278e1dd0 rados: changed build tag in rados/ioctx_nautilus.go
changed build tag in rados/ioctx_nautilus.go and
rados/ioctx_nautilus_test.go in a way such that the
functions in these files are built for nautilus only.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2021-06-02 06:16:01 +00:00
Mudit Agarwal 76e4089806 rados: move GetNamespace() to rados/ioctx.go
Now, we don't support ceph versions < nautilus this function
can move to a generic file so that nautilus specific functions
can be written here. Moved GetNamespace() and the corresponding
test function.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2021-06-02 06:16:01 +00:00
Sven Anderson c45fa95b32 rados: remove pointer arithmetic on C-buffers
This change uses slices on top of C allocated array memory in order
to have a simple (no pointer arithmetic) and safe (boundary-checked)
access to its elements.

Signed-off-by: Sven Anderson <sven@redhat.com>
2021-05-03 16:20:34 +00:00
John Mulligan c91f54ef25 rados: add test cases for ReadOp type and functions
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 0a67ff8f5a rados: add an initial set of tests for WriteOp operations
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 315188eaef rados: add AssertExists function to ReadOp
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan c8d8d8c364 rados: add Write, WriteFull, and WriteSame WriteOp functions
Add Write implementing rados_write_op_write.
Add WriteFull implementing rados_write_op_write_full.
Add WriteSame implementing rados_write_op_writesame.

These are some of the basic functions needed to write data to
a rados object using a WriteOp.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan e4e1257768 rados: add AssertExists WriteOp function
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 570738b24c 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>
2021-01-12 14:47:30 +00:00
John Mulligan f4e0730b8f rados: add RmOmapKeys WriteOp function
Reimplement RmOmapKeys in term of a new RmOmapKeys function on the
WriteOp.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 701bb74897 rados: add GetOmapValues function to the ReadOp
Refactor the previous ListOmapValues logic into a new read op step
that can be used for iteration over the results of the operation. The
previous function is now based on the ReadOp.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan bc6cabbe9f rados: add SetOmap WriteOp function
Reimplement SetOmap in terms of a new SetOmap function on the WriteOp.
Now the actions of the write op can start to be atomically chained the
way WriteOps are supposed to.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 614806ad01 rados: add withRefs type
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 1d6366f008 rados: add an error to be used if data is requested too early
Add a new error that will be returned from a op step method if the
method is called before the step is ready to provide data - like
when the operation has not yet been performed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan dffdc11f1f rados: add an initial ReadOp type for rados read operations
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 557390fb1d rados: make ioctx create internally based on WriteOp Create
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 926e101171 rados: create a new WriteOp type around rados_write_op_t
The WriteOp type will manage librados write operations and the
corresponding functions that ceph names like rados_write_op_*.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan 2a31d6a411 rados: add a function for use as a finalizer for any opStep
This utility function avoids having to have a custom finalizer for every
op step. It calls the free() function to release any allocated C memory
the step may have.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00
John Mulligan f1934a5513 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 <jmulligan@redhat.com>
2021-01-12 14:47:30 +00:00