Spdk/scripts/rpc/blobfs.py
Xiaodong Liu 6433c1037d blobfs: add blobfs_create RPC as mkfs
Following test/blobfs/mkfs case, add it as one RPC
method to let build a new blobfs on given block
device.

Change-Id: I0ffbb1add95dfbc8655e0238ed6f3cd519dd945b
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466485
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 05:02:00 +00:00

29 lines
778 B
Python

def blobfs_detect(client, bdev_name):
"""Detect whether a blobfs exists on bdev.
Args:
bdev_name: block device name to detect blobfs
Returns:
True if a blobfs exists on the bdev; False otherwise.
"""
params = {
'bdev_name': bdev_name
}
return client.call('blobfs_detect', params)
def blobfs_create(client, bdev_name, cluster_sz=None):
"""Build blobfs on bdev.
Args:
bdev_name: block device name to build blobfs
cluster_sz: Size of cluster in bytes (Optional). Must be multiple of 4KB page size. Default and minimal value is 1M.
"""
params = {
'bdev_name': bdev_name
}
if cluster_sz:
params['cluster_sz'] = cluster_sz
return client.call('blobfs_create', params)