export = container_of(ws, struct obd_export, exp_zombie_work);
class_export_destroy(export);
+ LASSERT(atomic_read(&obd_stale_export_num) > 0);
+ if (atomic_dec_and_test(&obd_stale_export_num))
+ wake_up_var(&obd_stale_export_num);
}
/* Creates a new export, adds it to the hash table, and returns a
list_del_init(&exp->exp_obd_chain_timed);
exp->exp_obd->obd_num_exports--;
spin_unlock(&exp->exp_obd->obd_dev_lock);
- atomic_inc(&obd_stale_export_num);
/* A reference is kept by obd_stale_exports list */
obd_stale_export_put(exp);
* Add export to the obd_zombe thread and notify it.
*/
static void obd_zombie_export_add(struct obd_export *exp) {
- atomic_dec(&obd_stale_export_num);
+ atomic_inc(&obd_stale_export_num);
spin_lock(&exp->exp_obd->obd_dev_lock);
LASSERT(!list_empty(&exp->exp_obd_chain));
list_del_init(&exp->exp_obd_chain);
spin_unlock(&exp->exp_obd->obd_dev_lock);
-
queue_work(zombie_wq, &exp->exp_zombie_work);
}
*/
void obd_zombie_barrier(void)
{
+ wait_var_event(&obd_stale_export_num,
+ atomic_read(&obd_stale_export_num) == 0);
flush_workqueue(zombie_wq);
}
EXPORT_SYMBOL(obd_zombie_barrier);