diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index 0198486cc..5629048a5 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -1155,7 +1155,7 @@ static int cache_mngt_update_core_uuid(ocf_cache_t cache, const char *core_name, bdvol = bd_object(vol); /* lookup block device object for device pointed by uuid */ - bdev = CAS_LOOKUP_BDEV(uuid->data); + bdev = CAS_LOOKUP_BDEV(uuid->data); if (IS_ERR(bdev)) { printk(KERN_ERR "failed to lookup bdev%s\n", (char*)uuid->data); return -ENODEV; @@ -1224,6 +1224,20 @@ static void _cache_mngt_add_core_complete(ocf_cache_t cache, static void _cache_mngt_remove_core_complete(void *priv, int error); +static void _blockdev_set_rotational_property(ocf_core_t core) +{ + struct block_device *bdev; + struct request_queue *q; + char holder[] = "CHECK CORE ROTATIONAL\n"; + const ocf_uuid_t core_uuid = (const ocf_uuid_t)ocf_core_get_uuid(core); + const char *core_path = (const char*)core_uuid->data; + + bdev = blkdev_get_by_path(core_path, (FMODE_READ), holder); + q = bdev_get_queue(bdev); + + ocf_core_set_rotational(core, (uint8_t)(!blk_queue_nonrot(q))); +} + int cache_mngt_add_core_to_cache(const char *cache_name, size_t name_len, struct ocf_mngt_core_config *cfg, struct kcas_insert_core *cmd_info) @@ -1301,6 +1315,7 @@ int cache_mngt_add_core_to_cache(const char *cache_name, size_t name_len, ocf_mngt_cache_put(cache); _cache_mngt_log_core_device_path(core); + _blockdev_set_rotational_property(core); return 0; diff --git a/ocf b/ocf index 5b3a9606d..ffda0feab 160000 --- a/ocf +++ b/ocf @@ -1 +1 @@ -Subproject commit 5b3a9606d3eab2e1157d2d692d1f4879fbb527ae +Subproject commit ffda0feab264294e74cbd232c20e99d6816144c8