diff mbox series

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

Message ID 20210806212318.440144-21-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 | 14 ++++++++++++--
 libxfs/rdwr.c   |  2 +-
 2 files changed, 13 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/include/linux.h b/include/linux.h
index 97882161..4ee4288f 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -208,7 +208,7 @@  static inline void platform_mntent_close(struct mntent_cursor * cursor)
 
 #if defined(FALLOC_FL_ZERO_RANGE)
 static inline int
-platform_zero_range(
+zero_range(
 	int		fd,
 	xfs_off_t	start,
 	size_t		len)
@@ -220,8 +220,18 @@  platform_zero_range(
 		return 0;
 	return -errno;
 }
+
+static inline int
+platform_zero_range(
+	int		fd,
+	xfs_off_t	start,
+	size_t		len)
+{
+	return zero_range(fd, start, len);
+}
 #else
-#define platform_zero_range(fd, s, l)	(-EOPNOTSUPP)
+#define zero_range(fd, s, l)	(-EOPNOTSUPP)
+#define platform_zero_range(fs, s, l) zero_range(fd, s, l)
 #endif
 
 /*
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 022da518..a92c909e 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -73,7 +73,7 @@  libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len)
 
 	/* try to use special zeroing methods, fall back to writes if needed */
 	len_bytes = LIBXFS_BBTOOFF64(len);
-	error = platform_zero_range(fd, start_offset, len_bytes);
+	error = zero_range(fd, start_offset, len_bytes);
 	if (!error) {
 		xfs_buftarg_trip_write(btp);
 		return 0;