Correct format error

Signed-off-by: Derek Su <derek.su@suse.com>
This commit is contained in:
Derek Su 2023-09-25 14:11:39 +08:00 committed by Damiano Cipriani
parent 44fdc5864a
commit 11a8d36765
11 changed files with 55 additions and 16 deletions

View File

@ -496,6 +496,8 @@ Example response:
"bdev_lvol_rename_lvstore", "bdev_lvol_rename_lvstore",
"bdev_lvol_create_lvstore", "bdev_lvol_create_lvstore",
"bdev_lvol_shallow_copy", "bdev_lvol_shallow_copy",
"bdev_lvol_set_xattr",
"bdev_lvol_get_xattr",
"bdev_lvol_get_fragmap", "bdev_lvol_get_fragmap",
"bdev_daos_delete", "bdev_daos_delete",
"bdev_daos_create", "bdev_daos_create",
@ -10016,6 +10018,29 @@ Name | Optional | Type | Description
src_lvol_name | Required | string | UUID or alias of lvol to create a copy from src_lvol_name | Required | string | UUID or alias of lvol to create a copy from
dst_bdev_name | Required | string | Name of the bdev that acts as destination for the copy dst_bdev_name | Required | string | Name of the bdev that acts as destination for the copy
### bdev_lvol_set_xattr {#rpc_bdev_lvol_set_xattr}
Set xattr for lvol bdev
#### Parameters
Name | Optional | Type | Description
----------------------- | -------- | ----------- | -----------
name | Required | string | UUID or alias of lvol
xattr_name | Required | string | Name of the xattr
xattr_value | Required | string | Value of the xattr
### bdev_lvol_get_xattr {#rpc_bdev_lvol_get_xattr}
Get xattr for lvol bdev
#### Parameters
Name | Optional | Type | Description
----------------------- | -------- | ----------- | -----------
name | Required | string | UUID or alias of lvol
xattr_name | Required | string | Name of the xattr
#### Example #### Example
Example request: Example request:

View File

@ -197,4 +197,12 @@ bdev_lvol_decouple_parent [-h] name
Decouple parent of a logical volume Decouple parent of a logical volume
optional arguments: optional arguments:
-h, --help show help -h, --help show help
bdev_lvol_set_xattr [-h] name xattr_name xattr_value
Set xattr for lvol bdev
optional arguments:
-h, --help show help
bdev_lvol_get_xattr [-h] name xattr_name
Get xattr for lvol bdev
optional arguments:
-h, --help show help
``` ```

View File

@ -331,7 +331,8 @@ spdk_is_divisible_by(uint64_t dividend, uint64_t divisor)
* \return void * \return void
*/ */
static inline void static inline void
spdk_current_utc_time_rfc3339(char *buf, size_t buf_size) { spdk_current_utc_time_rfc3339(char *buf, size_t buf_size)
{
struct tm *utc; struct tm *utc;
time_t rawtime; time_t rawtime;

View File

@ -109,7 +109,7 @@ struct spdk_lvol {
char name[SPDK_LVOL_NAME_MAX]; char name[SPDK_LVOL_NAME_MAX];
struct spdk_uuid uuid; struct spdk_uuid uuid;
char uuid_str[SPDK_UUID_STRING_LEN]; char uuid_str[SPDK_UUID_STRING_LEN];
char creation_time[SPDK_CREATION_TIME_MAX]; char creation_time[SPDK_CREATION_TIME_MAX];
struct spdk_bdev *bdev; struct spdk_bdev *bdev;
int ref_count; int ref_count;
bool action_in_progress; bool action_in_progress;

View File

@ -516,7 +516,9 @@ spdk_bit_array_to_base64_string(const struct spdk_bit_array *array)
for (uint32_t i = 0; i < bit_count; i++) { for (uint32_t i = 0; i < bit_count; i++) {
if (spdk_bit_array_get(array, i)) { if (spdk_bit_array_get(array, i)) {
// Set the bit in bytes's correct position /*
* Set the bit in bytes's correct position
*/
((uint8_t *)bytes)[i / 8] |= 1 << (i % 8); ((uint8_t *)bytes)[i / 8] |= 1 << (i % 8);
} }
} }

View File

@ -2218,7 +2218,9 @@ vbdev_lvol_get_fragmap(struct spdk_lvol *lvol, uint64_t offset, uint64_t size,
uint64_t cluster_size, num_clusters, block_size, num_blocks, lvol_size, segment_size; uint64_t cluster_size, num_clusters, block_size, num_blocks, lvol_size, segment_size;
int rc; int rc;
// Create a bitmap recording the allocated clusters /*
* Create a bitmap recording the allocated clusters
*/
cluster_size = spdk_bs_get_cluster_size(lvol->lvol_store->blobstore); cluster_size = spdk_bs_get_cluster_size(lvol->lvol_store->blobstore);
block_size = spdk_bdev_get_block_size(lvol->bdev); block_size = spdk_bdev_get_block_size(lvol->bdev);
num_blocks = spdk_bdev_get_num_blocks(lvol->bdev); num_blocks = spdk_bdev_get_num_blocks(lvol->bdev);
@ -2252,7 +2254,9 @@ vbdev_lvol_get_fragmap(struct spdk_lvol *lvol, uint64_t offset, uint64_t size,
return; return;
} }
// Construct a fragmap of the lvol /*
* Construct a fragmap of the lvol
*/
rc = spdk_bdev_open_ext(lvol->bdev->name, false, rc = spdk_bdev_open_ext(lvol->bdev->name, false,
dummy_bdev_event_cb, NULL, &desc); dummy_bdev_event_cb, NULL, &desc);
if (rc != 0) { if (rc != 0) {

View File

@ -88,7 +88,7 @@ void vbdev_lvol_set_xattr(struct spdk_lvol *lvol, const char *name,
* \param value_len Xattr value length * \param value_len Xattr value length
*/ */
int vbdev_lvol_get_xattr(struct spdk_lvol *lvol, const char *name, int vbdev_lvol_get_xattr(struct spdk_lvol *lvol, const char *name,
const void **value, size_t *value_len); const void **value, size_t *value_len);
/** /**
* Destroy a logical volume * Destroy a logical volume
@ -166,8 +166,7 @@ void vbdev_lvol_shallow_copy(struct spdk_lvol *lvol, const char *bdev_name,
* @param cb_fn Completion callback * @param cb_fn Completion callback
* @param cb_arg Completion callback custom arguments * @param cb_arg Completion callback custom arguments
*/ */
void void vbdev_lvol_get_fragmap(struct spdk_lvol *lvol, uint64_t offset, uint64_t size,
vbdev_lvol_get_fragmap(struct spdk_lvol *lvol, uint64_t offset, uint64_t size, spdk_lvol_op_with_fragmap_handle_complete cb_fn, void *cb_arg);
spdk_lvol_op_with_fragmap_handle_complete cb_fn, void *cb_arg);
#endif /* SPDK_VBDEV_LVOL_H */ #endif /* SPDK_VBDEV_LVOL_H */

View File

@ -740,7 +740,7 @@ invalid:
static void static void
rpc_bdev_lvol_set_xattr(struct spdk_jsonrpc_request *request, rpc_bdev_lvol_set_xattr(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params) const struct spdk_json_val *params)
{ {
struct rpc_bdev_lvol_set_xattr req = {}; struct rpc_bdev_lvol_set_xattr req = {};
struct spdk_bdev *bdev; struct spdk_bdev *bdev;