From: Darrick J. Wong Date: Fri, 1 Nov 2019 20:38:35 +0000 (-0400) Subject: libxfs: remove libxfs_nproc X-Git-Tag: v5.3.0-rc2~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4b45ff6fa6fc1e28b270cc910daf7763fa35c0fb;p=thirdparty%2Fxfsprogs-dev.git libxfs: remove libxfs_nproc Remove libxfs_nproc since it's a wrapper around a libfrog function. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/include/libxfs.h b/include/libxfs.h index 227084ae1..405572eee 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 4446a62a1..9e7624353 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 66e69db72..e1ba778fd 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 beb36cd68..8e3772ed1 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 ba5c23277..f075ee5be 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));