From d185bf805b71079343b42521fafdd734d52d052b Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Tue, 27 Sep 2016 12:24:09 -0400 Subject: [PATCH] LU-7988 hsm: change the cdt event flags to a simple boolean Change the coordinator flag into a boolean event since only one bit is now used. Do not include lustre_net.h as it's not necessary anymore. Test-Parameters: trivial testlist=sanity-hsm Signed-off-by: frank zago Change-Id: I15dc10125af97f6244c98b421a262f320b79158b Reviewed-on: https://review.whamcloud.com/22789 Reviewed-by: Patrick Farrell Reviewed-by: Quentin Bouget Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_coordinator.c | 10 +++------- lustre/mdt/mdt_handler.c | 1 - lustre/mdt/mdt_hsm_cdt_actions.c | 1 - lustre/mdt/mdt_hsm_cdt_client.c | 1 - lustre/mdt/mdt_internal.h | 3 +-- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c index c3eed6b..d250424 100644 --- a/lustre/mdt/mdt_coordinator.c +++ b/lustre/mdt/mdt_coordinator.c @@ -40,7 +40,6 @@ #include #include -#include #include #include #include @@ -538,8 +537,7 @@ static int mdt_coordinator(void *data) lwi = LWI_TIMEOUT(cfs_time_seconds(cdt->cdt_loop_period), NULL, NULL); l_wait_event(cdt->cdt_waitq, - (cdt->cdt_flags & SVC_EVENT) || - (cdt->cdt_state == CDT_STOPPING), + cdt->cdt_event || (cdt->cdt_state == CDT_STOPPING), &lwi); CDEBUG(D_HSM, "coordinator resumes\n"); @@ -549,9 +547,7 @@ static int mdt_coordinator(void *data) break; } - /* wake up before timeout, new work arrives */ - if (cdt->cdt_flags & SVC_EVENT) - cdt->cdt_flags &= ~SVC_EVENT; + cdt->cdt_event = false; /* if coordinator is suspended continue to wait */ if (cdt->cdt_state == CDT_DISABLE) { @@ -836,7 +832,7 @@ int mdt_hsm_cdt_wakeup(struct mdt_device *mdt) RETURN(-ESRCH); /* wake up coordinator */ - cdt->cdt_flags = SVC_EVENT; + cdt->cdt_event = true; wake_up_all(&cdt->cdt_waitq); RETURN(0); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 2a2063e..61a84ce 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include diff --git a/lustre/mdt/mdt_hsm_cdt_actions.c b/lustre/mdt/mdt_hsm_cdt_actions.c index 8c5f504..711747c 100644 --- a/lustre/mdt/mdt_hsm_cdt_actions.c +++ b/lustre/mdt/mdt_hsm_cdt_actions.c @@ -37,7 +37,6 @@ #define DEBUG_SUBSYSTEM S_MDS #include -#include #include #include #include diff --git a/lustre/mdt/mdt_hsm_cdt_client.c b/lustre/mdt/mdt_hsm_cdt_client.c index a078d39..b42093e 100644 --- a/lustre/mdt/mdt_hsm_cdt_client.c +++ b/lustre/mdt/mdt_hsm_cdt_client.c @@ -37,7 +37,6 @@ #define DEBUG_SUBSYSTEM S_MDS #include -#include #include #include #include diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index 58c836d..d0b9d8c 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -129,7 +128,7 @@ static inline char *cdt_mdt_state2str(int state) */ struct coordinator { wait_queue_head_t cdt_waitq; /**< cdt wait queue */ - unsigned int cdt_flags; /**< cdt event flags */ + bool cdt_event; /**< coordinator event */ struct lu_env cdt_env; /**< coordinator lustre * env */ struct lu_context cdt_session; /** session for lu_ucred */ -- 1.8.3.1