All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 2/4] libxfs: remove libxfs_nproc
Date: Tue, 22 Oct 2019 11:48:17 -0700	[thread overview]
Message-ID: <157177009727.1460186.2780524441344390421.stgit@magnolia> (raw)
In-Reply-To: <157177008495.1460186.12329293699422541895.stgit@magnolia>

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(-)


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));


  parent reply	other threads:[~2019-10-22 18:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 18:48 [PATCH 0/4] libfrog: take over platform code headers Darrick J. Wong
2019-10-22 18:48 ` [PATCH 1/4] libfrog: clean up platform_nproc Darrick J. Wong
2019-11-01 20:35   ` Eric Sandeen
2019-10-22 18:48 ` Darrick J. Wong [this message]
2019-11-01 20:35   ` [PATCH 2/4] libxfs: remove libxfs_nproc Eric Sandeen
2019-10-22 18:48 ` [PATCH 3/4] libxfs: remove libxfs_physmem Darrick J. Wong
2019-11-01 20:35   ` Eric Sandeen
2019-10-22 18:48 ` [PATCH 4/4] libfrog: take over platform headers Darrick J. Wong
2019-11-01 20:36   ` Eric Sandeen

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=157177009727.1460186.2780524441344390421.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.