Whamcloud - gitweb
LU-13258 obdclass: bind zombie export cleanup workqueue
[fs/lustre-release.git] / lustre / ptlrpc / pinger.c
index 0650c2e..6b6cbe0 100644 (file)
@@ -141,7 +141,7 @@ static int ptlrpc_ping(struct obd_import *imp)
 
 static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
 {
-#ifdef CONFIG_LUSTRE_PINGER
+#ifdef CONFIG_LUSTRE_FS_PINGER
        time64_t time = soon ? PING_INTERVAL_SHORT : PING_INTERVAL;
 
        if (imp->imp_state == LUSTRE_IMP_DISCON) {
@@ -151,7 +151,7 @@ static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
                time = min(time, dtime);
        }
        imp->imp_next_ping = ktime_get_seconds() + time;
-#endif /* CONFIG_LUSTRE_PINGER */
+#endif /* CONFIG_LUSTRE_FS_PINGER */
 }
 
 void ptlrpc_ping_import_soon(struct obd_import *imp)
@@ -316,26 +316,15 @@ static void ptlrpc_pinger_main(struct work_struct *ws)
 
 int ptlrpc_start_pinger(void)
 {
-#ifdef CONFIG_LUSTRE_PINGER
-       struct workqueue_attrs attrs = { };
-       cpumask_var_t *mask;
-
+#ifdef CONFIG_LUSTRE_FS_PINGER
        if (pinger_wq)
                return -EALREADY;
 
-       pinger_wq = alloc_workqueue("ptlrpc_pinger", WQ_UNBOUND, 1);
-       if (!pinger_wq) {
+       pinger_wq = cfs_cpt_bind_workqueue("ptlrpc_pinger", cfs_cpt_tab,
+                                          0, CFS_CPT_ANY, 1);
+       if (IS_ERR(pinger_wq)) {
                CERROR("cannot start pinger workqueue\n");
-               return -ENOMEM;
-       }
-
-       mask = cfs_cpt_cpumask(cfs_cpt_tab, CFS_CPT_ANY);
-       if (mask && alloc_cpumask_var(&attrs.cpumask, GFP_KERNEL)) {
-               cpumask_copy(attrs.cpumask, *mask);
-               cpus_read_lock();
-               cfs_apply_workqueue_attrs(pinger_wq, &attrs);
-               cpus_read_unlock();
-               free_cpumask_var(attrs.cpumask);
+               return PTR_ERR(pinger_wq);
        }
 
        queue_delayed_work(pinger_wq, &ping_work, 0);
@@ -350,7 +339,7 @@ int ptlrpc_pinger_remove_timeouts(void);
 
 int ptlrpc_stop_pinger(void)
 {
-#ifdef CONFIG_LUSTRE_PINGER
+#ifdef CONFIG_LUSTRE_FS_PINGER
        if (!pinger_wq)
                return -EALREADY;
 
@@ -545,7 +534,7 @@ int ptlrpc_pinger_remove_timeouts(void)
 
 void ptlrpc_pinger_wake_up(void)
 {
-#ifdef CONFIG_LUSTRE_PINGER
+#ifdef CONFIG_LUSTRE_FS_PINGER
        mod_delayed_work(pinger_wq, &ping_work, 0);
 #endif
 }