@@ -340,7 +340,7 @@ _module_fini_cache_visitor(ocf_cache_t cache, void *cb_arg)
340340 SPDK_DEBUGLOG (vbdev_ocf , "OCF cache '%s': module stop visit\n" , ocf_cache_get_name (cache ));
341341
342342 if (!ocf_cache_get_core_count (cache ) ||
343- ocf_cache_get_core_count (cache ) == ocf_cache_get_core_inactive_count (cache )) {
343+ ocf_cache_get_core_count (cache ) == ocf_cache_get_core_inactive_count (cache )) {
344344 /* If there are no cores or all of them are detached,
345345 * then cache stop can be triggered already. */
346346 ocf_mngt_cache_lock (cache , _cache_stop_lock_cb , NULL );
@@ -975,7 +975,7 @@ vbdev_ocf_submit_io(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io, ui
975975
976976 /* OCF core should be added before vbdev register and removed after vbdev unregister. */
977977 assert (core );
978-
978+
979979 io = ocf_volume_new_io (ocf_core_get_front_volume (core ), ch_ctx -> queue ,
980980 offset , len , dir , 0 , flags );
981981 if (!io ) {
@@ -1158,7 +1158,7 @@ _cache_start_rpc_attach_cb(ocf_cache_t cache, void *cb_arg, int error)
11581158 ocf_mngt_cache_unlock (cache );
11591159 vbdev_ocf_core_add_from_waitlist (cache );
11601160 }
1161-
1161+
11621162 mngt_ctx -> rpc_cb_fn (ocf_cache_get_name (cache ), mngt_ctx -> rpc_cb_arg , error );
11631163 free (mngt_ctx );
11641164}
@@ -1279,7 +1279,7 @@ vbdev_ocf_cache_stop(const char *cache_name, vbdev_ocf_rpc_mngt_cb rpc_cb_fn, vo
12791279 mngt_ctx -> cache = cache ;
12801280
12811281 if (!ocf_cache_get_core_count (cache ) ||
1282- ocf_cache_get_core_count (cache ) == ocf_cache_get_core_inactive_count (cache )) {
1282+ ocf_cache_get_core_count (cache ) == ocf_cache_get_core_inactive_count (cache )) {
12831283 /* If there are no cores or all of them are detached,
12841284 * then cache stop can be triggered already. */
12851285 ocf_mngt_cache_lock (cache , _cache_stop_lock_cb , mngt_ctx );
@@ -1966,8 +1966,9 @@ _promotion_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
19661966 }
19671967
19681968 if (mngt_ctx -> u .promotion .nhit_insertion_threshold >= 0 ) {
1969- if ((rc = ocf_mngt_cache_promotion_set_param (cache , ocf_promotion_nhit , ocf_nhit_insertion_threshold ,
1970- mngt_ctx -> u .promotion .nhit_insertion_threshold ))) {
1969+ if ((rc = ocf_mngt_cache_promotion_set_param (cache , ocf_promotion_nhit ,
1970+ ocf_nhit_insertion_threshold ,
1971+ mngt_ctx -> u .promotion .nhit_insertion_threshold ))) {
19711972 SPDK_ERRLOG ("OCF cache '%s': failed to set promotion nhit_insertion_threshold param (OCF error: %d)\n" ,
19721973 ocf_cache_get_name (cache ), rc );
19731974 goto err_param ;
@@ -1976,7 +1977,7 @@ _promotion_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
19761977
19771978 if (mngt_ctx -> u .promotion .nhit_trigger_threshold >= 0 ) {
19781979 if ((rc = ocf_mngt_cache_promotion_set_param (cache , ocf_promotion_nhit , ocf_nhit_trigger_threshold ,
1979- mngt_ctx -> u .promotion .nhit_trigger_threshold ))) {
1980+ mngt_ctx -> u .promotion .nhit_trigger_threshold ))) {
19801981 SPDK_ERRLOG ("OCF cache '%s': failed to set promotion nhit_trigger_threshold param (OCF error: %d)\n" ,
19811982 ocf_cache_get_name (cache ), rc );
19821983 goto err_param ;
@@ -2073,7 +2074,7 @@ _cleaning_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
20732074
20742075 if (mngt_ctx -> u .cleaning .acp_wake_up_time >= 0 ) {
20752076 if ((rc = ocf_mngt_cache_cleaning_set_param (cache , ocf_cleaning_acp , ocf_acp_wake_up_time ,
2076- mngt_ctx -> u .cleaning .acp_wake_up_time ))) {
2077+ mngt_ctx -> u .cleaning .acp_wake_up_time ))) {
20772078 SPDK_ERRLOG ("OCF cache '%s': failed to set cleaning acp_wake_up_time param (OCF error: %d)\n" ,
20782079 ocf_cache_get_name (cache ), rc );
20792080 goto err_param ;
@@ -2082,7 +2083,7 @@ _cleaning_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
20822083
20832084 if (mngt_ctx -> u .cleaning .acp_flush_max_buffers >= 0 ) {
20842085 if ((rc = ocf_mngt_cache_cleaning_set_param (cache , ocf_cleaning_acp , ocf_acp_flush_max_buffers ,
2085- mngt_ctx -> u .cleaning .acp_flush_max_buffers ))) {
2086+ mngt_ctx -> u .cleaning .acp_flush_max_buffers ))) {
20862087 SPDK_ERRLOG ("OCF cache '%s': failed to set cleaning acp_flush_max_buffers param (OCF error: %d)\n" ,
20872088 ocf_cache_get_name (cache ), rc );
20882089 goto err_param ;
@@ -2091,7 +2092,7 @@ _cleaning_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
20912092
20922093 if (mngt_ctx -> u .cleaning .alru_wake_up_time >= 0 ) {
20932094 if ((rc = ocf_mngt_cache_cleaning_set_param (cache , ocf_cleaning_alru , ocf_alru_wake_up_time ,
2094- mngt_ctx -> u .cleaning .alru_wake_up_time ))) {
2095+ mngt_ctx -> u .cleaning .alru_wake_up_time ))) {
20952096 SPDK_ERRLOG ("OCF cache '%s': failed to set cleaning alru_wake_up_time param (OCF error: %d)\n" ,
20962097 ocf_cache_get_name (cache ), rc );
20972098 goto err_param ;
@@ -2100,7 +2101,7 @@ _cleaning_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
21002101
21012102 if (mngt_ctx -> u .cleaning .alru_flush_max_buffers >= 0 ) {
21022103 if ((rc = ocf_mngt_cache_cleaning_set_param (cache , ocf_cleaning_alru , ocf_alru_flush_max_buffers ,
2103- mngt_ctx -> u .cleaning .alru_flush_max_buffers ))) {
2104+ mngt_ctx -> u .cleaning .alru_flush_max_buffers ))) {
21042105 SPDK_ERRLOG ("OCF cache '%s': failed to set cleaning alru_flush_max_buffers param (OCF error: %d)\n" ,
21052106 ocf_cache_get_name (cache ), rc );
21062107 goto err_param ;
@@ -2109,7 +2110,7 @@ _cleaning_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
21092110
21102111 if (mngt_ctx -> u .cleaning .alru_staleness_time >= 0 ) {
21112112 if ((rc = ocf_mngt_cache_cleaning_set_param (cache , ocf_cleaning_alru , ocf_alru_stale_buffer_time ,
2112- mngt_ctx -> u .cleaning .alru_staleness_time ))) {
2113+ mngt_ctx -> u .cleaning .alru_staleness_time ))) {
21132114 SPDK_ERRLOG ("OCF cache '%s': failed to set cleaning alru_staleness_time param (OCF error: %d)\n" ,
21142115 ocf_cache_get_name (cache ), rc );
21152116 goto err_param ;
@@ -2118,7 +2119,7 @@ _cleaning_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
21182119
21192120 if (mngt_ctx -> u .cleaning .alru_activity_threshold >= 0 ) {
21202121 if ((rc = ocf_mngt_cache_cleaning_set_param (cache , ocf_cleaning_alru , ocf_alru_activity_threshold ,
2121- mngt_ctx -> u .cleaning .alru_activity_threshold ))) {
2122+ mngt_ctx -> u .cleaning .alru_activity_threshold ))) {
21222123 SPDK_ERRLOG ("OCF cache '%s': failed to set cleaning alru_activity_threshold param (OCF error: %d)\n" ,
21232124 ocf_cache_get_name (cache ), rc );
21242125 goto err_param ;
@@ -2127,7 +2128,7 @@ _cleaning_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
21272128
21282129 if (mngt_ctx -> u .cleaning .alru_max_dirty_ratio >= 0 ) {
21292130 if ((rc = ocf_mngt_cache_cleaning_set_param (cache , ocf_cleaning_alru , ocf_alru_max_dirty_ratio ,
2130- mngt_ctx -> u .cleaning .alru_max_dirty_ratio ))) {
2131+ mngt_ctx -> u .cleaning .alru_max_dirty_ratio ))) {
21312132 SPDK_ERRLOG ("OCF cache '%s': failed to set cleaning alru_max_dirty_ratio param (OCF error: %d)\n" ,
21322133 ocf_cache_get_name (cache ), rc );
21332134 goto err_param ;
@@ -2238,15 +2239,17 @@ _seqcutoff_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
22382239 }
22392240
22402241 if (mngt_ctx -> u .seqcutoff .promotion_count >= 0 ) {
2241- if ((rc = ocf_mngt_core_set_seq_cutoff_promotion_count (core , mngt_ctx -> u .seqcutoff .promotion_count ))) {
2242+ if ((rc = ocf_mngt_core_set_seq_cutoff_promotion_count (core ,
2243+ mngt_ctx -> u .seqcutoff .promotion_count ))) {
22422244 SPDK_ERRLOG ("OCF core '%s': failed to set sequential cut-off promotion_count (OCF error: %d)\n" ,
22432245 ocf_core_get_name (core ), rc );
22442246 goto err_param ;
22452247 }
22462248 }
22472249
22482250 if (mngt_ctx -> u .seqcutoff .promote_on_threshold >= 0 ) {
2249- if ((rc = ocf_mngt_core_set_seq_cutoff_promote_on_threshold (core , mngt_ctx -> u .seqcutoff .promote_on_threshold ))) {
2251+ if ((rc = ocf_mngt_core_set_seq_cutoff_promote_on_threshold (core ,
2252+ mngt_ctx -> u .seqcutoff .promote_on_threshold ))) {
22502253 SPDK_ERRLOG ("OCF core '%s': failed to set sequential cut-off promote_on_threshold (OCF error: %d)\n" ,
22512254 ocf_core_get_name (core ), rc );
22522255 goto err_param ;
@@ -2268,23 +2271,26 @@ _seqcutoff_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
22682271 }
22692272
22702273 if (mngt_ctx -> u .seqcutoff .threshold >= 0 ) {
2271- if ((rc = ocf_mngt_core_set_seq_cutoff_threshold_all (cache , mngt_ctx -> u .seqcutoff .threshold * KiB ))) {
2274+ if ((rc = ocf_mngt_core_set_seq_cutoff_threshold_all (cache ,
2275+ mngt_ctx -> u .seqcutoff .threshold * KiB ))) {
22722276 SPDK_ERRLOG ("OCF cache '%s': failed to set sequential cut-off threshold (OCF error: %d)\n" ,
22732277 ocf_cache_get_name (cache ), rc );
22742278 goto err_param ;
22752279 }
22762280 }
22772281
22782282 if (mngt_ctx -> u .seqcutoff .promotion_count >= 0 ) {
2279- if ((rc = ocf_mngt_core_set_seq_cutoff_promotion_count_all (cache , mngt_ctx -> u .seqcutoff .promotion_count ))) {
2283+ if ((rc = ocf_mngt_core_set_seq_cutoff_promotion_count_all (cache ,
2284+ mngt_ctx -> u .seqcutoff .promotion_count ))) {
22802285 SPDK_ERRLOG ("OCF cache '%s': failed to set sequential cut-off promotion_count (OCF error: %d)\n" ,
22812286 ocf_cache_get_name (cache ), rc );
22822287 goto err_param ;
22832288 }
22842289 }
22852290
22862291 if (mngt_ctx -> u .seqcutoff .promote_on_threshold >= 0 ) {
2287- if ((rc = ocf_mngt_core_set_seq_cutoff_promote_on_threshold_all (cache , mngt_ctx -> u .seqcutoff .promote_on_threshold ))) {
2292+ if ((rc = ocf_mngt_core_set_seq_cutoff_promote_on_threshold_all (cache ,
2293+ mngt_ctx -> u .seqcutoff .promote_on_threshold ))) {
22882294 SPDK_ERRLOG ("OCF cache '%s': failed to set sequential cut-off promote_on_threshold (OCF error: %d)\n" ,
22892295 ocf_cache_get_name (cache ), rc );
22902296 goto err_param ;
@@ -2311,8 +2317,8 @@ _seqcutoff_lock_cb(ocf_cache_t cache, void *cb_arg, int error)
23112317/* RPC entry point. */
23122318void
23132319vbdev_ocf_set_seqcutoff (const char * bdev_name , const char * policy , int32_t threshold ,
2314- int32_t promotion_count , int32_t promote_on_threshold ,
2315- vbdev_ocf_rpc_mngt_cb rpc_cb_fn , void * rpc_cb_arg )
2320+ int32_t promotion_count , int32_t promote_on_threshold ,
2321+ vbdev_ocf_rpc_mngt_cb rpc_cb_fn , void * rpc_cb_arg )
23162322{
23172323 struct vbdev_ocf_mngt_ctx * mngt_ctx ;
23182324 int rc ;
@@ -2629,13 +2635,13 @@ dump_promotion_info(struct spdk_json_write_ctx *w, ocf_cache_t cache)
26292635
26302636 if (promotion_policy == ocf_promotion_nhit ) {
26312637 if ((rc = ocf_mngt_cache_promotion_get_param (cache , ocf_promotion_nhit ,
2632- ocf_nhit_insertion_threshold , & param_val ))) {
2638+ ocf_nhit_insertion_threshold , & param_val ))) {
26332639 return rc ;
26342640 }
26352641 spdk_json_write_named_uint32 (w , "insertion_threshold" , param_val );
26362642
26372643 if ((rc = ocf_mngt_cache_promotion_get_param (cache , ocf_promotion_nhit ,
2638- ocf_nhit_trigger_threshold , & param_val ))) {
2644+ ocf_nhit_trigger_threshold , & param_val ))) {
26392645 return rc ;
26402646 }
26412647 spdk_json_write_named_uint32 (w , "trigger_threshold" , param_val );
@@ -2663,44 +2669,44 @@ dump_cleaning_info(struct spdk_json_write_ctx *w, ocf_cache_t cache)
26632669
26642670 if (cleaning_policy == ocf_cleaning_acp ) {
26652671 if ((rc = ocf_mngt_cache_cleaning_get_param (cache , ocf_cleaning_acp ,
2666- ocf_acp_wake_up_time , & param_val ))) {
2672+ ocf_acp_wake_up_time , & param_val ))) {
26672673 return rc ;
26682674 }
26692675 spdk_json_write_named_uint32 (w , "wake_up_time" , param_val );
26702676
26712677 if ((rc = ocf_mngt_cache_cleaning_get_param (cache , ocf_cleaning_acp ,
2672- ocf_acp_flush_max_buffers , & param_val ))) {
2678+ ocf_acp_flush_max_buffers , & param_val ))) {
26732679 return rc ;
26742680 }
26752681 spdk_json_write_named_uint32 (w , "flush_max_buffers" , param_val );
26762682
26772683 } else if (cleaning_policy == ocf_cleaning_alru ) {
26782684 if ((rc = ocf_mngt_cache_cleaning_get_param (cache , ocf_cleaning_alru ,
2679- ocf_alru_wake_up_time , & param_val ))) {
2685+ ocf_alru_wake_up_time , & param_val ))) {
26802686 return rc ;
26812687 }
26822688 spdk_json_write_named_uint32 (w , "wake_up_time" , param_val );
26832689
26842690 if ((rc = ocf_mngt_cache_cleaning_get_param (cache , ocf_cleaning_alru ,
2685- ocf_alru_flush_max_buffers , & param_val ))) {
2691+ ocf_alru_flush_max_buffers , & param_val ))) {
26862692 return rc ;
26872693 }
26882694 spdk_json_write_named_uint32 (w , "flush_max_buffers" , param_val );
26892695
26902696 if ((rc = ocf_mngt_cache_cleaning_get_param (cache , ocf_cleaning_alru ,
2691- ocf_alru_stale_buffer_time , & param_val ))) {
2697+ ocf_alru_stale_buffer_time , & param_val ))) {
26922698 return rc ;
26932699 }
26942700 spdk_json_write_named_uint32 (w , "staleness_time" , param_val );
26952701
26962702 if ((rc = ocf_mngt_cache_cleaning_get_param (cache , ocf_cleaning_alru ,
2697- ocf_alru_activity_threshold , & param_val ))) {
2703+ ocf_alru_activity_threshold , & param_val ))) {
26982704 return rc ;
26992705 }
27002706 spdk_json_write_named_uint32 (w , "activity_threshold" , param_val );
27012707
27022708 if ((rc = ocf_mngt_cache_cleaning_get_param (cache , ocf_cleaning_alru ,
2703- ocf_alru_max_dirty_ratio , & param_val ))) {
2709+ ocf_alru_max_dirty_ratio , & param_val ))) {
27042710 return rc ;
27052711 }
27062712 spdk_json_write_named_uint32 (w , "max_dirty_ratio" , param_val );
@@ -2885,7 +2891,8 @@ _get_bdevs_cache_visitor(ocf_cache_t cache, void *cb_arg)
28852891
28862892/* RPC entry point. */
28872893void
2888- vbdev_ocf_get_bdevs (const char * bdev_name , vbdev_ocf_rpc_dump_cb rpc_cb_fn , void * rpc_cb_arg1 , void * rpc_cb_arg2 )
2894+ vbdev_ocf_get_bdevs (const char * bdev_name , vbdev_ocf_rpc_dump_cb rpc_cb_fn , void * rpc_cb_arg1 ,
2895+ void * rpc_cb_arg2 )
28892896{
28902897 struct spdk_json_write_ctx * w = rpc_cb_arg1 ;
28912898 struct vbdev_ocf_core * core_ctx ;
0 commit comments