Commit Graph

10 Commits

Author SHA1 Message Date
Sven Anderson 87041ee7d8 gofmt: reformat everything with new gofmt of go 1.19
Signed-off-by: Sven Anderson <sven@redhat.com>
2023-02-20 20:50:24 +00:00
Robert Vasek 3eba56ce60 rados: use rados_write_op_omap_rm_keys2()
WriteOp.RmOmapKeys now uses rados_write_op_omap_rm_keys2().

The entirety of removeOmapKeysStep struct was removed as it's not necessary for
it to own the various C-allocated values passed to
rados_write_op_omap_rm_keys2() as arguments. rados_write_op_omap_rm_keys2()
makes copies of all the string-based args [1], so it's sufficient for them to
be short lived.

[1] 2bd3dd512a/src/librados/librados_c.cc (L3888-L3902)
2022-03-09 14:02:56 +00:00
Robert Vasek 044c3733e9 rados: use rados_write_op_omap_set2()
WriteOp.SetOmap now uses rados_write_op_omap_set2().

The entirety of setOmapStep struct was removed as it's not necessary for it to
own the various C-allocated values passed to rados_write_op_omap_set2()
as arguments. rados_write_op_omap_set2() makes copies of all the string-based
args [1], so it's sufficient for them to be short lived.

[1] 2bd3dd512a/src/librados/librados_c.cc (L3852-L3871)
2022-03-09 14:02:56 +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 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 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 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