From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 08/12] libfrog: move workqueue.h to libfrog/
Date: Tue, 03 Sep 2019 21:36:34 -0700 [thread overview]
Message-ID: <156757179417.1838135.16722106490569097057.stgit@magnolia> (raw)
In-Reply-To: <156757174409.1838135.8885359673458816401.stgit@magnolia>
From: Darrick J. Wong <darrick.wong@oracle.com>
Move this header to libfrog since the code is there already.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
include/workqueue.h | 41 -----------------------------------------
libfrog/Makefile | 3 ++-
libfrog/workqueue.h | 41 +++++++++++++++++++++++++++++++++++++++++
repair/threads.h | 2 +-
scrub/fscounters.c | 2 +-
scrub/inodes.c | 2 +-
scrub/phase1.c | 2 +-
scrub/phase2.c | 2 +-
scrub/phase3.c | 2 +-
scrub/phase4.c | 2 +-
scrub/phase5.c | 2 +-
scrub/phase6.c | 2 +-
scrub/read_verify.c | 2 +-
scrub/spacemap.c | 2 +-
scrub/vfs.c | 2 +-
15 files changed, 55 insertions(+), 54 deletions(-)
delete mode 100644 include/workqueue.h
create mode 100644 libfrog/workqueue.h
diff --git a/include/workqueue.h b/include/workqueue.h
deleted file mode 100644
index c45dc4fb..00000000
--- a/include/workqueue.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2017 Oracle. All Rights Reserved.
- * Author: Darrick J. Wong <darrick.wong@oracle.com>
- */
-#ifndef _WORKQUEUE_H_
-#define _WORKQUEUE_H_
-
-#include <pthread.h>
-
-struct workqueue;
-
-typedef void workqueue_func_t(struct workqueue *wq, uint32_t index, void *arg);
-
-struct workqueue_item {
- struct workqueue *queue;
- struct workqueue_item *next;
- workqueue_func_t *function;
- void *arg;
- uint32_t index;
-};
-
-struct workqueue {
- void *wq_ctx;
- pthread_t *threads;
- struct workqueue_item *next_item;
- struct workqueue_item *last_item;
- pthread_mutex_t lock;
- pthread_cond_t wakeup;
- unsigned int item_count;
- unsigned int thread_count;
- bool terminate;
-};
-
-int workqueue_create(struct workqueue *wq, void *wq_ctx,
- unsigned int nr_workers);
-int workqueue_add(struct workqueue *wq, workqueue_func_t fn,
- uint32_t index, void *arg);
-void workqueue_destroy(struct workqueue *wq);
-
-#endif /* _WORKQUEUE_H_ */
diff --git a/libfrog/Makefile b/libfrog/Makefile
index 482893ef..5506c96f 100644
--- a/libfrog/Makefile
+++ b/libfrog/Makefile
@@ -37,7 +37,8 @@ crc32table.h \
fsgeom.h \
ptvar.h \
radix-tree.h \
-topology.h
+topology.h \
+workqueue.h
LSRCFILES += gen_crc32table.c
diff --git a/libfrog/workqueue.h b/libfrog/workqueue.h
new file mode 100644
index 00000000..a1f3a57c
--- /dev/null
+++ b/libfrog/workqueue.h
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017 Oracle. All Rights Reserved.
+ * Author: Darrick J. Wong <darrick.wong@oracle.com>
+ */
+#ifndef __LIBFROG_WORKQUEUE_H__
+#define __LIBFROG_WORKQUEUE_H__
+
+#include <pthread.h>
+
+struct workqueue;
+
+typedef void workqueue_func_t(struct workqueue *wq, uint32_t index, void *arg);
+
+struct workqueue_item {
+ struct workqueue *queue;
+ struct workqueue_item *next;
+ workqueue_func_t *function;
+ void *arg;
+ uint32_t index;
+};
+
+struct workqueue {
+ void *wq_ctx;
+ pthread_t *threads;
+ struct workqueue_item *next_item;
+ struct workqueue_item *last_item;
+ pthread_mutex_t lock;
+ pthread_cond_t wakeup;
+ unsigned int item_count;
+ unsigned int thread_count;
+ bool terminate;
+};
+
+int workqueue_create(struct workqueue *wq, void *wq_ctx,
+ unsigned int nr_workers);
+int workqueue_add(struct workqueue *wq, workqueue_func_t fn,
+ uint32_t index, void *arg);
+void workqueue_destroy(struct workqueue *wq);
+
+#endif /* __LIBFROG_WORKQUEUE_H__ */
diff --git a/repair/threads.h b/repair/threads.h
index 22f74d1f..55c7c632 100644
--- a/repair/threads.h
+++ b/repair/threads.h
@@ -3,7 +3,7 @@
#ifndef _XFS_REPAIR_THREADS_H_
#define _XFS_REPAIR_THREADS_H_
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
void thread_init(void);
diff --git a/scrub/fscounters.c b/scrub/fscounters.c
index f8cc1e94..9635c44f 100644
--- a/scrub/fscounters.c
+++ b/scrub/fscounters.c
@@ -11,7 +11,7 @@
#include "xfs_arch.h"
#include "xfs_format.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "fscounters.h"
diff --git a/scrub/inodes.c b/scrub/inodes.c
index faffef54..19923de5 100644
--- a/scrub/inodes.c
+++ b/scrub/inodes.c
@@ -13,7 +13,7 @@
#include "xfs_format.h"
#include "handle.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "inodes.h"
diff --git a/scrub/phase1.c b/scrub/phase1.c
index 23df9a15..d0e77cab 100644
--- a/scrub/phase1.c
+++ b/scrub/phase1.c
@@ -14,7 +14,7 @@
#include <stdint.h>
#include <pthread.h>
#include "libfrog.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "input.h"
#include "path.h"
#include "handle.h"
diff --git a/scrub/phase2.c b/scrub/phase2.c
index a80da7fd..baec11dd 100644
--- a/scrub/phase2.c
+++ b/scrub/phase2.c
@@ -9,7 +9,7 @@
#include <sys/statvfs.h>
#include "list.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "scrub.h"
diff --git a/scrub/phase3.c b/scrub/phase3.c
index 8c02f1cb..64a499c3 100644
--- a/scrub/phase3.c
+++ b/scrub/phase3.c
@@ -9,7 +9,7 @@
#include <sys/statvfs.h>
#include "list.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "counter.h"
diff --git a/scrub/phase4.c b/scrub/phase4.c
index 49f00723..14074835 100644
--- a/scrub/phase4.c
+++ b/scrub/phase4.c
@@ -10,7 +10,7 @@
#include <sys/statvfs.h>
#include "list.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "progress.h"
diff --git a/scrub/phase5.c b/scrub/phase5.c
index f3ee22e6..ab015821 100644
--- a/scrub/phase5.c
+++ b/scrub/phase5.c
@@ -15,7 +15,7 @@
#include "handle.h"
#include "list.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "inodes.h"
diff --git a/scrub/phase6.c b/scrub/phase6.c
index 9b0d228a..d0e62cea 100644
--- a/scrub/phase6.c
+++ b/scrub/phase6.c
@@ -9,7 +9,7 @@
#include <sys/statvfs.h>
#include "handle.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "libfrog/bitmap.h"
diff --git a/scrub/read_verify.c b/scrub/read_verify.c
index d56f4893..828f6be6 100644
--- a/scrub/read_verify.c
+++ b/scrub/read_verify.c
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <sys/statvfs.h>
#include "libfrog/ptvar.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "path.h"
#include "xfs_scrub.h"
#include "common.h"
diff --git a/scrub/spacemap.c b/scrub/spacemap.c
index c3621a3a..774efbaa 100644
--- a/scrub/spacemap.c
+++ b/scrub/spacemap.c
@@ -8,7 +8,7 @@
#include <string.h>
#include <pthread.h>
#include <sys/statvfs.h>
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "path.h"
#include "xfs_scrub.h"
#include "common.h"
diff --git a/scrub/vfs.c b/scrub/vfs.c
index 7b0b5bcd..7d79e7f7 100644
--- a/scrub/vfs.c
+++ b/scrub/vfs.c
@@ -10,7 +10,7 @@
#include <sys/statvfs.h>
#include "handle.h"
#include "path.h"
-#include "workqueue.h"
+#include "libfrog/workqueue.h"
#include "xfs_scrub.h"
#include "common.h"
#include "vfs.h"
next prev parent reply other threads:[~2019-09-04 4:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 4:35 [PATCH 00/12] libfrog: move header files Darrick J. Wong
2019-09-04 4:35 ` [PATCH 01/12] libxfs: move topology declarations into separate header Darrick J. Wong
2019-09-04 23:24 ` Dave Chinner
2019-09-04 4:35 ` [PATCH 02/12] libfrog: move avl64.h to libfrog/ Darrick J. Wong
2019-09-04 23:25 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 03/12] libfrog: move bitmap.h " Darrick J. Wong
2019-09-04 23:28 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 04/12] libfrog: move convert.h " Darrick J. Wong
2019-09-04 23:28 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 05/12] libfrog: move fsgeom.h " Darrick J. Wong
2019-09-04 23:32 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 06/12] libfrog: move ptvar.h " Darrick J. Wong
2019-09-04 23:32 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 07/12] libfrog: move radix-tree.h " Darrick J. Wong
2019-09-04 23:33 ` Dave Chinner
2019-09-04 4:36 ` Darrick J. Wong [this message]
2019-09-04 23:34 ` [PATCH 08/12] libfrog: move workqueue.h " Dave Chinner
2019-09-04 4:36 ` [PATCH 09/12] libfrog: move crc32c.h " Darrick J. Wong
2019-09-04 23:37 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 10/12] libfrog: move path.h " Darrick J. Wong
2019-09-04 23:39 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 11/12] libfrog: move workqueue.h " Darrick J. Wong
2019-09-04 23:40 ` Dave Chinner
2019-09-04 4:36 ` [PATCH 12/12] libfrog: move libfrog.h to libfrog/util.h Darrick J. Wong
2019-09-04 23:43 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=156757179417.1838135.16722106490569097057.stgit@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).