From 7fec3685f85e5b3a4b2321c9ac6ebaa8ee2054cb Mon Sep 17 00:00:00 2001 From: sageweil Date: Wed, 29 Aug 2007 00:08:28 +0000 Subject: [PATCH] onlyrange syn command git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1722 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/client/SyntheticClient.cc | 17 +++++++++++++++++ trunk/ceph/client/SyntheticClient.h | 8 +++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/trunk/ceph/client/SyntheticClient.cc b/trunk/ceph/client/SyntheticClient.cc index 0d8329bb1b003..025729bd7dd74 100644 --- a/trunk/ceph/client/SyntheticClient.cc +++ b/trunk/ceph/client/SyntheticClient.cc @@ -156,6 +156,10 @@ void parse_syn_options(vector& args) } else if (strcmp(args[i],"only") == 0) { syn_modes.push_back( SYNCLIENT_MODE_ONLY ); syn_iargs.push_back( atoi(args[++i]) ); + } else if (strcmp(args[i],"onlyrange") == 0) { + syn_modes.push_back( SYNCLIENT_MODE_ONLYRANGE ); + syn_iargs.push_back( atoi(args[++i]) ); + syn_iargs.push_back( atoi(args[++i]) ); } else if (strcmp(args[i],"sleep") == 0) { syn_modes.push_back( SYNCLIENT_MODE_SLEEP ); @@ -290,6 +294,19 @@ int SyntheticClient::run() dout(2) << "only " << run_only << dendl; } break; + case SYNCLIENT_MODE_ONLYRANGE: + { + int first = iargs.front(); + iargs.pop_front(); + int last = iargs.front(); + iargs.pop_front(); + if (first <= client->get_nodeid() && + last >= client->get_nodeid()) { + run_only = client->get_nodeid(); + dout(2) << "onlyrange " << first << " " << last << " includes me" << dendl; + } + } + break; case SYNCLIENT_MODE_EXCLUDE: { exclude = iargs.front(); diff --git a/trunk/ceph/client/SyntheticClient.h b/trunk/ceph/client/SyntheticClient.h index 74ab66dd7bd50..0728ab4a705e7 100644 --- a/trunk/ceph/client/SyntheticClient.h +++ b/trunk/ceph/client/SyntheticClient.h @@ -51,10 +51,12 @@ #define SYNCLIENT_MODE_OPTEST 41 #define SYNCLIENT_MODE_ONLY 50 -#define SYNCLIENT_MODE_EXCLUDE 51 +#define SYNCLIENT_MODE_ONLYRANGE 51 +#define SYNCLIENT_MODE_EXCLUDE 52 +#define SYNCLIENT_MODE_EXCLUDERANGE 53 -#define SYNCLIENT_MODE_UNTIL 52 -#define SYNCLIENT_MODE_SLEEPUNTIL 53 +#define SYNCLIENT_MODE_UNTIL 55 +#define SYNCLIENT_MODE_SLEEPUNTIL 56 #define SYNCLIENT_MODE_RANDOMSLEEP 61 #define SYNCLIENT_MODE_SLEEP 62 -- 2.39.5