All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Reichl <preichl@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH v2 19/29] xfsprogs: Stop using platform_discard_blocks
Date: Fri,  6 Aug 2021 23:23:08 +0200	[thread overview]
Message-ID: <20210806212318.440144-20-preichl@redhat.com> (raw)
In-Reply-To: <20210806212318.440144-1-preichl@redhat.com>

---
 include/linux.h |  7 ++++++-
 mkfs/xfs_mkfs.c | 10 +++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

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
-- 
2.31.1


  parent reply	other threads:[~2021-08-06 21:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 21:22 [PATCH v2 00/29] xfsprogs: Drop the 'platform_' prefix Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 01/29] xfsprogs: Stop using platform_uuid_compare() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 02/29] xfsprogs: Stop using platform_test_xfs_fd() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 03/29] xfsprogs: Stop using platform_test_xfs_path() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 04/29] xfsprogs: Stop using platform_fstatfs() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 05/29] xfsprogs: Stop using platform_getoptreset() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 06/29] xfsprogs: Stop using platform_uuid_copy() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 07/29] xfsprogs: Stop using platform_uuid_generate() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 08/29] xfsprogs: Stop using platform_uuid_unparse() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 09/29] xfsprogs: Stop using platform_uuid_clear() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 10/29] xfsprogs: Stop using platform_uuid_parse() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 11/29] xfsprogs: Stop using platform_uuid_is_null() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 12/29] xfsprogs: Stop using platform_check_mount() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 13/29] xfsprogs: Stop using platform_check_ismounted() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 14/29] xfsprogs: Stop using platform_flush_device() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 15/29] xfsprogs: Stop using platform_mntent_open() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 16/29] xfsprogs: Stop using platform_mntent_next() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 17/29] xfsprogs: Stop using platform_mntent_close() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 18/29] xfsprogs: Stop using platform_findsizes() Pavel Reichl
2021-08-06 21:23 ` Pavel Reichl [this message]
2021-08-06 21:23 ` [PATCH v2 20/29] xfsprogs: Stop using platform_zero_range() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 21/29] xfsprogs: Stop using platform_crash() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 22/29] xfsprogs: Stop using platform_nproc() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 23/29] xfsprogs: Stop using platform_check_iswritable() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 24/29] xfsprogs: Stop using platform_set_blocksize() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 25/29] xfsprogs: Stop using platform_findrawpath() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 26/29] xfsprogs: Stop using platform_findblockpath() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 27/29] xfsprogs: Stop using platform_direct_blockdev() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 28/29] xfsprogs: Stop using platform_align_blockdev() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 29/29] xfsprogs: Stop using platform_physmem() Pavel Reichl
2021-08-06 23:05 ` [PATCH v2 00/29] xfsprogs: Drop the 'platform_' prefix Dave Chinner
2021-08-07 15:13   ` Pavel Reichl
2021-08-07 21:46     ` Dave Chinner

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=20210806212318.440144-20-preichl@redhat.com \
    --to=preichl@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /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.