Do compound update to a tmap object, inserting or deleting some
number of records. cmdbuf is a series of operation byte
codes, following by command payload. Each command is a single-byte
command code, whose value is one of CEPH_OSD_TMAP_*.
- update tmap 'header'
- 1 byte = CEPH_OSD_TMAP_HDR
- 4 bytes = data length (little endian)
- N bytes = data
- insert/update one key/value pair
- 1 byte = CEPH_OSD_TMAP_SET
- 4 bytes = key name length (little endian)
- N bytes = key name
- 4 bytes = data length (little endian)
- M bytes = data
- insert one key/value pair; return -EEXIST if it already exists.
- 1 byte = CEPH_OSD_TMAP_CREATE
- 4 bytes = key name length (little endian)
- N bytes = key name
- 4 bytes = data length (little endian)
- M bytes = data
- remove one key/value pair
- 1 byte = CEPH_OSD_TMAP_RM
- 4 bytes = key name length (little endian)
- N bytes = key name
Restrictions:
- The HDR update must preceed any key/value updates.
- All key/value updates must be in lexicographically sorted order
in cmdbuf.
- You can read/write to a tmap object via the regular APIs, but
you should be careful not to corrupt it. Also be aware that the
object format may change without notice.
@param io ioctx
@param o object name
@param cmdbuf command buffer
@param cmdbuflen command buffer length in bytes
@returns 0 on success, negative error code on failure
Update tmap (trivial map)
Do compound update to a tmap object, inserting or deleting some number of records. cmdbuf is a series of operation byte codes, following by command payload. Each command is a single-byte command code, whose value is one of CEPH_OSD_TMAP_*.
- update tmap 'header' - 1 byte = CEPH_OSD_TMAP_HDR - 4 bytes = data length (little endian) - N bytes = data
- insert/update one key/value pair - 1 byte = CEPH_OSD_TMAP_SET - 4 bytes = key name length (little endian) - N bytes = key name - 4 bytes = data length (little endian) - M bytes = data
- insert one key/value pair; return -EEXIST if it already exists. - 1 byte = CEPH_OSD_TMAP_CREATE - 4 bytes = key name length (little endian) - N bytes = key name - 4 bytes = data length (little endian) - M bytes = data
- remove one key/value pair - 1 byte = CEPH_OSD_TMAP_RM - 4 bytes = key name length (little endian) - N bytes = key name
Restrictions: - The HDR update must preceed any key/value updates. - All key/value updates must be in lexicographically sorted order in cmdbuf. - You can read/write to a tmap object via the regular APIs, but you should be careful not to corrupt it. Also be aware that the object format may change without notice.
@param io ioctx @param o object name @param cmdbuf command buffer @param cmdbuflen command buffer length in bytes @returns 0 on success, negative error code on failure