Whamcloud - gitweb
LU-7988 hsm: change the cdt event flags to a simple boolean 89/22789/14
authorFrank Zago <fzago@cray.com>
Tue, 27 Sep 2016 16:24:09 +0000 (12:24 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 24 May 2017 07:33:27 +0000 (07:33 +0000)
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 <fzago@cray.com>
Change-Id: I15dc10125af97f6244c98b421a262f320b79158b
Reviewed-on: https://review.whamcloud.com/22789
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_hsm_cdt_actions.c
lustre/mdt/mdt_hsm_cdt_client.c
lustre/mdt/mdt_internal.h

index c3eed6b..d250424 100644 (file)
@@ -40,7 +40,6 @@
 
 #include <linux/kthread.h>
 #include <obd_support.h>
-#include <lustre_net.h>
 #include <lustre_export.h>
 #include <obd.h>
 #include <lprocfs_status.h>
@@ -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);
index 2a2063e..61a84ce 100644 (file)
@@ -53,7 +53,6 @@
 #include <uapi/linux/lustre_ioctl.h>
 #include <lustre_lfsck.h>
 #include <lustre_log.h>
-#include <lustre_net.h>
 #include <lustre_nodemap.h>
 #include <lustre_mds.h>
 #include <uapi/linux/lustre_param.h>
index 8c5f504..711747c 100644 (file)
@@ -37,7 +37,6 @@
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include <obd_support.h>
-#include <lustre_net.h>
 #include <lustre_export.h>
 #include <obd.h>
 #include <lprocfs_status.h>
index a078d39..b42093e 100644 (file)
@@ -37,7 +37,6 @@
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include <obd_support.h>
-#include <lustre_net.h>
 #include <lustre_export.h>
 #include <obd.h>
 #include <lprocfs_status.h>
index 58c836d..d0b9d8c 100644 (file)
@@ -47,7 +47,6 @@
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs_hash.h>
 #include <upcall_cache.h>
-#include <lustre_net.h>
 #include <lustre/lustre_idl.h>
 #include <obd_class.h>
 #include <lustre_disk.h>
@@ -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 */