diff mbox series

[v2,19/29] xfsprogs: Stop using platform_discard_blocks

Message ID 20210806212318.440144-20-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
---
 include/linux.h |  7 ++++++-
 mkfs/xfs_mkfs.c | 10 +++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/include/linux.h b/include/linux.h
index 7940fe8c..97882161 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -140,7 +140,7 @@  static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
 #endif
 
 static __inline__ int
-platform_discard_blocks(int fd, uint64_t start, uint64_t len)
+discard_blocks(int fd, uint64_t start, uint64_t len)
 {
 	uint64_t range[2] = { start, len };
 
@@ -149,6 +149,11 @@  platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 	return 0;
 }
 
+static __inline__ int
+platform_discard_blocks(int fd, uint64_t start, uint64_t len)
+{
+	return discard_blocks(fd, start, len);
+}
 #define ENOATTR		ENODATA	/* Attribute not found */
 #define EFSCORRUPTED	EUCLEAN	/* Filesystem is corrupted */
 #define EFSBADCRC	EBADMSG	/* Bad CRC detected */
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index c6929a83..fc672a10 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -1263,7 +1263,7 @@  done:
 }
 
 static void
-discard_blocks(dev_t dev, uint64_t nsectors, int quiet)
+discard_batch_of_blocks(dev_t dev, uint64_t nsectors, int quiet)
 {
 	int		fd;
 	uint64_t	offset = 0;
@@ -1286,7 +1286,7 @@  discard_blocks(dev_t dev, uint64_t nsectors, int quiet)
 		 * not necessary for the mkfs functionality but just an
 		 * optimization. However we should stop on error.
 		 */
-		if (platform_discard_blocks(fd, offset, tmp_step) == 0) {
+		if (discard_blocks(fd, offset, tmp_step) == 0) {
 			if (offset == 0 && !quiet) {
 				printf("Discarding blocks...");
 				fflush(stdout);
@@ -2664,11 +2664,11 @@  discard_devices(
 	 */
 
 	if (!xi->disfile)
-		discard_blocks(xi->ddev, xi->dsize, quiet);
+		discard_batch_of_blocks(xi->ddev, xi->dsize, quiet);
 	if (xi->rtdev && !xi->risfile)
-		discard_blocks(xi->rtdev, xi->rtsize, quiet);
+		discard_batch_of_blocks(xi->rtdev, xi->rtsize, quiet);
 	if (xi->logdev && xi->logdev != xi->ddev && !xi->lisfile)
-		discard_blocks(xi->logdev, xi->logBBsize, quiet);
+		discard_batch_of_blocks(xi->logdev, xi->logBBsize, quiet);
 }
 
 static void