diff mbox series

[v2,29/29] xfsprogs: Stop using platform_physmem()

Message ID 20210806212318.440144-30-preichl@redhat.com (mailing list archive)
State Deferred, archived
Headers show
Series xfsprogs: Drop the 'platform_' prefix | expand

Commit Message

Pavel Reichl Aug. 6, 2021, 9:23 p.m. UTC
---
 libfrog/linux.c     | 8 +++++++-
 libfrog/platform.h  | 1 +
 repair/xfs_repair.c | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libfrog/linux.c b/libfrog/linux.c
index 43ca1e7d..9b99d1a7 100644
--- a/libfrog/linux.c
+++ b/libfrog/linux.c
@@ -338,7 +338,7 @@  platform_nproc(void)
 }
 
 unsigned long
-platform_physmem(void)
+physmem(void)
 {
 	struct sysinfo  si;
 
@@ -349,3 +349,9 @@  platform_physmem(void)
 	}
 	return (si.totalram >> 10) * si.mem_unit;	/* kilobytes */
 }
+
+unsigned long
+platform_physmem(void)
+{
+	return physmem();
+}
diff --git a/libfrog/platform.h b/libfrog/platform.h
index 42b0d753..b034d652 100644
--- a/libfrog/platform.h
+++ b/libfrog/platform.h
@@ -26,6 +26,7 @@  int direct_blockdev(void);
 int platform_align_blockdev(void);
 int align_blockdev(void);
 unsigned long platform_physmem(void);	/* in kilobytes */
+unsigned long physmem(void);	/* in kilobytes */
 void platform_findsizes(char *path, int fd, long long *sz, int *bsz);
 void findsizes(char *path, int fd, long long *sz, int *bsz);
 int platform_nproc(void);
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index fbbc8c6f..b8d56d9d 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -1081,7 +1081,7 @@  main(int argc, char **argv)
 					(mp->m_sb.sb_dblocks >> (10 + 1)) +
 					50000;	/* rough estimate of 50MB overhead */
 		max_mem = max_mem_specified ? max_mem_specified * 1024 :
-					      platform_physmem() * 3 / 4;
+					      physmem() * 3 / 4;
 
 		if (getrlimit(RLIMIT_AS, &rlim) != -1 &&
 					rlim.rlim_cur != RLIM_INFINITY) {