Correct format error
Signed-off-by: Derek Su <derek.su@suse.com>
This commit is contained in:
parent
44fdc5864a
commit
11a8d36765
@ -496,6 +496,8 @@ Example response:
|
||||
"bdev_lvol_rename_lvstore",
|
||||
"bdev_lvol_create_lvstore",
|
||||
"bdev_lvol_shallow_copy",
|
||||
"bdev_lvol_set_xattr",
|
||||
"bdev_lvol_get_xattr",
|
||||
"bdev_lvol_get_fragmap",
|
||||
"bdev_daos_delete",
|
||||
"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
|
||||
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 request:
|
||||
|
@ -197,4 +197,12 @@ bdev_lvol_decouple_parent [-h] name
|
||||
Decouple parent of a logical volume
|
||||
optional arguments:
|
||||
-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
|
||||
```
|
||||
|
@ -515,7 +515,7 @@ struct spdk_bdev {
|
||||
|
||||
/**
|
||||
* Creation time for this bdev.
|
||||
*
|
||||
*
|
||||
* If not provided, it will be NULL.
|
||||
*/
|
||||
const char *creation_time;
|
||||
|
@ -119,7 +119,7 @@ typedef void (*spdk_lvol_op_complete)(void *cb_arg, int lvolerrno);
|
||||
|
||||
/**
|
||||
* Callback definition for lvol operations with handle to fragmap
|
||||
*
|
||||
*
|
||||
* @param cb_arg Custom arguments
|
||||
* @param fragmap Handle to fragmap or NULL when lvolerrno is set
|
||||
* @param lvolerrno Error
|
||||
|
@ -324,14 +324,15 @@ spdk_is_divisible_by(uint64_t dividend, uint64_t divisor)
|
||||
|
||||
/*
|
||||
* Get the UTC time string in RFC3339 format.
|
||||
*
|
||||
*
|
||||
* \param buf Buffer to store the UTC time string.
|
||||
* \param buf_size Size of the buffer.
|
||||
*
|
||||
*
|
||||
* \return 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;
|
||||
time_t rawtime;
|
||||
|
||||
|
@ -109,7 +109,7 @@ struct spdk_lvol {
|
||||
char name[SPDK_LVOL_NAME_MAX];
|
||||
struct spdk_uuid uuid;
|
||||
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;
|
||||
int ref_count;
|
||||
bool action_in_progress;
|
||||
|
@ -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++) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -537,4 +539,4 @@ spdk_bit_array_to_base64_string(const struct spdk_bit_array *array)
|
||||
|
||||
free(bytes);
|
||||
return encoded;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
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);
|
||||
block_size = spdk_bdev_get_block_size(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;
|
||||
}
|
||||
|
||||
// Construct a fragmap of the lvol
|
||||
/*
|
||||
* Construct a fragmap of the lvol
|
||||
*/
|
||||
rc = spdk_bdev_open_ext(lvol->bdev->name, false,
|
||||
dummy_bdev_event_cb, NULL, &desc);
|
||||
if (rc != 0) {
|
||||
|
@ -88,7 +88,7 @@ void vbdev_lvol_set_xattr(struct spdk_lvol *lvol, const char *name,
|
||||
* \param value_len Xattr value length
|
||||
*/
|
||||
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
|
||||
@ -166,8 +166,7 @@ void vbdev_lvol_shallow_copy(struct spdk_lvol *lvol, const char *bdev_name,
|
||||
* @param cb_fn Completion callback
|
||||
* @param cb_arg Completion callback custom arguments
|
||||
*/
|
||||
void
|
||||
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);
|
||||
void 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);
|
||||
|
||||
#endif /* SPDK_VBDEV_LVOL_H */
|
||||
|
@ -740,7 +740,7 @@ invalid:
|
||||
|
||||
static void
|
||||
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 spdk_bdev *bdev;
|
||||
|
@ -212,4 +212,4 @@ run_test "test_fragmap_hole_data_hole" test_fragmap_hole_data_hole
|
||||
run_test "test_fragmap_data_hole_data" test_fragmap_data_hole_data
|
||||
|
||||
trap - SIGINT SIGTERM EXIT
|
||||
killprocess $spdk_pid
|
||||
killprocess $spdk_pid
|
||||
|
Loading…
Reference in New Issue
Block a user