diff mbox series

[2/4] libxfs: remove libxfs_nproc

Message ID 157177009727.1460186.2780524441344390421.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series libfrog: take over platform code headers | expand

Commit Message

Darrick J. Wong Oct. 22, 2019, 6:48 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Remove libxfs_nproc since it's a wrapper around a libfrog function.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 include/libxfs.h  |    1 -
 libxfs/init.c     |   11 -----------
 repair/phase4.c   |    6 +++---
 repair/prefetch.c |    2 +-
 repair/slab.c     |    2 +-
 5 files changed, 5 insertions(+), 17 deletions(-)

Comments

Eric Sandeen Nov. 1, 2019, 8:35 p.m. UTC | #1
On 10/22/19 1:48 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Remove libxfs_nproc since it's a wrapper around a libfrog function.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>
diff mbox series

Patch

diff --git a/include/libxfs.h b/include/libxfs.h
index 227084ae..405572ee 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -161,7 +161,6 @@  enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
 #endif
 
 
-extern int		libxfs_nproc(void);
 extern unsigned long	libxfs_physmem(void);	/* in kilobytes */
 
 #include "xfs_ialloc.h"
diff --git a/libxfs/init.c b/libxfs/init.c
index 4446a62a..9e762435 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -853,17 +853,6 @@  libxfs_report(FILE *fp)
 	fprintf(fp, "%s", c);
 }
 
-int
-libxfs_nproc(void)
-{
-	int	nr;
-
-	nr = platform_nproc();
-	if (nr < 1)
-		nr = 1;
-	return nr;
-}
-
 unsigned long
 libxfs_physmem(void)
 {
diff --git a/repair/phase4.c b/repair/phase4.c
index 66e69db7..e1ba778f 100644
--- a/repair/phase4.c
+++ b/repair/phase4.c
@@ -235,7 +235,7 @@  process_rmap_data(
 	if (!rmap_needs_work(mp))
 		return;
 
-	create_work_queue(&wq, mp, libxfs_nproc());
+	create_work_queue(&wq, mp, platform_nproc());
 	for (i = 0; i < mp->m_sb.sb_agcount; i++)
 		queue_work(&wq, check_rmap_btrees, i, NULL);
 	destroy_work_queue(&wq);
@@ -243,12 +243,12 @@  process_rmap_data(
 	if (!xfs_sb_version_hasreflink(&mp->m_sb))
 		return;
 
-	create_work_queue(&wq, mp, libxfs_nproc());
+	create_work_queue(&wq, mp, platform_nproc());
 	for (i = 0; i < mp->m_sb.sb_agcount; i++)
 		queue_work(&wq, compute_ag_refcounts, i, NULL);
 	destroy_work_queue(&wq);
 
-	create_work_queue(&wq, mp, libxfs_nproc());
+	create_work_queue(&wq, mp, platform_nproc());
 	for (i = 0; i < mp->m_sb.sb_agcount; i++) {
 		queue_work(&wq, process_inode_reflink_flags, i, NULL);
 		queue_work(&wq, check_refcount_btrees, i, NULL);
diff --git a/repair/prefetch.c b/repair/prefetch.c
index beb36cd6..8e3772ed 100644
--- a/repair/prefetch.c
+++ b/repair/prefetch.c
@@ -1015,7 +1015,7 @@  do_inode_prefetch(
 	 */
 	if (check_cache && !libxfs_bcache_overflowed()) {
 		queue.wq_ctx = mp;
-		create_work_queue(&queue, mp, libxfs_nproc());
+		create_work_queue(&queue, mp, platform_nproc());
 		for (i = 0; i < mp->m_sb.sb_agcount; i++)
 			queue_work(&queue, func, i, NULL);
 		destroy_work_queue(&queue);
diff --git a/repair/slab.c b/repair/slab.c
index ba5c2327..f075ee5b 100644
--- a/repair/slab.c
+++ b/repair/slab.c
@@ -234,7 +234,7 @@  qsort_slab(
 		return;
 	}
 
-	create_work_queue(&wq, NULL, libxfs_nproc());
+	create_work_queue(&wq, NULL, platform_nproc());
 	hdr = slab->s_first;
 	while (hdr) {
 		qs = malloc(sizeof(struct qsort_slab));