Skip to contentSkip to conversation

ocfs2: no need flush workqueue before destroying it

PATCH New piaojun 2 participants 2 messages Oct 13, 2017 OCFS2

lore
Share & tools
lore

piaojun

author
#0 lore raw

PATCH 1/2 ocfs2: no need flush workqueue before destroying it

destroy_workqueue() will do flushing work for us.

---
 fs/ocfs2/dlm/dlmdomain.c | 1 -
 fs/ocfs2/dlmfs/dlmfs.c   | 1 -
 fs/ocfs2/super.c         | 4 +---
 3 files changed, 1 insertion(+), 5 deletions(-)
fs/ocfs2/dlm/dlmdomain.c +0 -1
index a2b19fb..e1fea14 100644
@@ -394,7 +394,6 @@ int dlm_domain_fully_joined(struct dlm_ctxt *dlm)
 static void dlm_destroy_dlm_worker(struct dlm_ctxt *dlm)
 {
 	if (dlm->dlm_worker) {
-		flush_workqueue(dlm->dlm_worker);
 		destroy_workqueue(dlm->dlm_worker);
 		dlm->dlm_worker = NULL;
 	}
fs/ocfs2/dlmfs/dlmfs.c +0 -1
index 9ab9e18..edce7b5 100644
@@ -670,7 +670,6 @@ static void __exit exit_dlmfs_fs(void)
 {
 	unregister_filesystem(&dlmfs_fs_type);
 
-	flush_workqueue(user_dlm_worker);
 	destroy_workqueue(user_dlm_worker);
 
 	/*
fs/ocfs2/super.c +1 -3
index 8073349..040bbb6 100644
@@ -2521,10 +2521,8 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
 	/* This function assumes that the caller has the main osb resource */
 
 	/* ocfs2_initializer_super have already created this workqueue */
-	if (osb->ocfs2_wq) {
-		flush_workqueue(osb->ocfs2_wq);
+	if (osb->ocfs2_wq)
 		destroy_workqueue(osb->ocfs2_wq);
-	}
 
 	ocfs2_free_slot_info(osb);
 
#1 lore raw

PATCH 1/2 ocfs2: no need flush workqueue before destroying it

Quoted 3 lines · piaojun

destroy_workqueue() will do flushing work for us.

Quoted 46 lines
---
 fs/ocfs2/dlm/dlmdomain.c | 1 -
 fs/ocfs2/dlmfs/dlmfs.c   | 1 -
 fs/ocfs2/super.c         | 4 +---
 3 files changed, 1 insertion(+), 5 deletions(-)
fs/ocfs2/dlm/dlmdomain.c +0 -1
index a2b19fb..e1fea14 100644
@@ -394,7 +394,6 @@ int dlm_domain_fully_joined(struct dlm_ctxt *dlm)
 static void dlm_destroy_dlm_worker(struct dlm_ctxt *dlm)
 {
 	if (dlm->dlm_worker) {
-		flush_workqueue(dlm->dlm_worker);
 		destroy_workqueue(dlm->dlm_worker);
 		dlm->dlm_worker = NULL;
 	}
fs/ocfs2/dlmfs/dlmfs.c +0 -1
index 9ab9e18..edce7b5 100644
@@ -670,7 +670,6 @@ static void __exit exit_dlmfs_fs(void)
 {
 	unregister_filesystem(&dlmfs_fs_type);
 
-	flush_workqueue(user_dlm_worker);
 	destroy_workqueue(user_dlm_worker);
 
 	/*
fs/ocfs2/super.c +1 -3
index 8073349..040bbb6 100644
@@ -2521,10 +2521,8 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
 	/* This function assumes that the caller has the main osb resource */
 
 	/* ocfs2_initializer_super have already created this workqueue */
-	if (osb->ocfs2_wq) {
-		flush_workqueue(osb->ocfs2_wq);
+	if (osb->ocfs2_wq)
 		destroy_workqueue(osb->ocfs2_wq);
-	}
 
 	ocfs2_free_slot_info(osb);