From 7dba43b3c6c5d633064ba1bbefac203ff54e7577 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 8 Jan 2020 12:05:59 +0300 Subject: [PATCH] Allow to exclude blockstore from OSD op processing for tests --- osd.h | 2 ++ osd_exec_secondary.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/osd.h b/osd.h index 804a13c7..9b3c3dcd 100644 --- a/osd.h +++ b/osd.h @@ -33,6 +33,8 @@ #define CL_WRITE_DATA 3 #define MAX_EPOLL_EVENTS 16 +//#define OSD_STUB + struct osd_op_t { int op_type; diff --git a/osd_exec_secondary.cpp b/osd_exec_secondary.cpp index 6bb4e608..deb8347d 100644 --- a/osd_exec_secondary.cpp +++ b/osd_exec_secondary.cpp @@ -63,7 +63,12 @@ void osd_t::exec_secondary(osd_op_t *cur_op) cur_op->bs_op.len = cur_op->op.sec_list.pgtotal; cur_op->bs_op.offset = cur_op->op.sec_list.pgnum; } +#ifdef OSD_STUB + cur_op->bs_op.retval = cur_op->bs_op.len; + secondary_op_callback(cur_op); +#else bs->enqueue_op(&cur_op->bs_op); +#endif } void osd_t::exec_show_config(osd_op_t *cur_op) @@ -122,7 +127,12 @@ void osd_t::exec_sync_stab_all(osd_op_t *cur_op) secondary_op_callback(cur_op); } }; +#ifdef OSD_STUB + cur_op->bs_op.retval = 0; + secondary_op_callback(cur_op); +#else bs->enqueue_op(&cur_op->bs_op); +#endif } void osd_t::make_reply(osd_op_t *op)