linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: changfengnan <changfengnan@bytedance.com>
To: willy@infradead.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, viro@zeniv.linux.org.uk, djwong@kernel.org,
	dchinner@redhat.com, chandan.babu@oracle.com,
	linux-xfs@vger.kernel.org
Cc: changfengnan <changfengnan@bytedance.com>
Subject: [PATCH] mm: remove filemap_fdatawait_keep_errors
Date: Tue,  1 Nov 2022 17:34:13 +0800	[thread overview]
Message-ID: <20221101093413.5871-1-changfengnan@bytedance.com> (raw)

use filemap_fdatawait_range_keep_errors to instead of
filemap_fdatawait_keep_errors, no functional change.

Signed-off-by: changfengnan <changfengnan@bytedance.com>
---
 block/bdev.c            |  5 +++--
 fs/fs-writeback.c       |  5 +++--
 fs/xfs/scrub/bmap.c     |  3 ++-
 include/linux/pagemap.h |  1 -
 mm/filemap.c            | 21 ---------------------
 5 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/block/bdev.c b/block/bdev.c
index ce05175e71ce..f600b10017cd 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -1055,10 +1055,11 @@ void sync_bdevs(bool wait)
 			/*
 			 * We keep the error status of individual mapping so
 			 * that applications can catch the writeback error using
-			 * fsync(2). See filemap_fdatawait_keep_errors() for
+			 * fsync(2). See filemap_fdatawait_range_keep_errors for
 			 * details.
 			 */
-			filemap_fdatawait_keep_errors(inode->i_mapping);
+			filemap_fdatawait_range_keep_errors(inode->i_mapping,
+								0, LLONG_MAX);
 		} else {
 			filemap_fdatawrite(inode->i_mapping);
 		}
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 443f83382b9b..d417cdb4505a 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -2582,9 +2582,10 @@ static void wait_sb_inodes(struct super_block *sb)
 		/*
 		 * We keep the error status of individual mapping so that
 		 * applications can catch the writeback error using fsync(2).
-		 * See filemap_fdatawait_keep_errors() for details.
+		 * See filemap_fdatawait_range_keep_errors for details.
 		 */
-		filemap_fdatawait_keep_errors(mapping);
+		filemap_fdatawait_range_keep_errors(inode->i_mapping,
+							0, LLONG_MAX);
 
 		cond_resched();
 
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c
index f0b9cb6506fd..6be0433eaa51 100644
--- a/fs/xfs/scrub/bmap.c
+++ b/fs/xfs/scrub/bmap.c
@@ -64,7 +64,8 @@ xchk_setup_inode_bmap(
 		 */
 		error = filemap_fdatawrite(mapping);
 		if (!error)
-			error = filemap_fdatawait_keep_errors(mapping);
+			error = filemap_fdatawait_range_keep_errors(mapping,
+								0, LLONG_MAX);
 		if (error && (error != -ENOSPC && error != -EIO))
 			goto out;
 	}
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 0178b2040ea3..75536967f57b 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -33,7 +33,6 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
 int write_inode_now(struct inode *, int sync);
 int filemap_fdatawrite(struct address_space *);
 int filemap_flush(struct address_space *);
-int filemap_fdatawait_keep_errors(struct address_space *mapping);
 int filemap_fdatawait_range(struct address_space *, loff_t lstart, loff_t lend);
 int filemap_fdatawait_range_keep_errors(struct address_space *mapping,
 		loff_t start_byte, loff_t end_byte);
diff --git a/mm/filemap.c b/mm/filemap.c
index 15800334147b..b4932493175b 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -600,27 +600,6 @@ int file_fdatawait_range(struct file *file, loff_t start_byte, loff_t end_byte)
 }
 EXPORT_SYMBOL(file_fdatawait_range);
 
-/**
- * filemap_fdatawait_keep_errors - wait for writeback without clearing errors
- * @mapping: address space structure to wait for
- *
- * Walk the list of under-writeback pages of the given address space
- * and wait for all of them.  Unlike filemap_fdatawait(), this function
- * does not clear error status of the address space.
- *
- * Use this function if callers don't handle errors themselves.  Expected
- * call sites are system-wide / filesystem-wide data flushers: e.g. sync(2),
- * fsfreeze(8)
- *
- * Return: error status of the address space.
- */
-int filemap_fdatawait_keep_errors(struct address_space *mapping)
-{
-	__filemap_fdatawait_range(mapping, 0, LLONG_MAX);
-	return filemap_check_and_keep_errors(mapping);
-}
-EXPORT_SYMBOL(filemap_fdatawait_keep_errors);
-
 /* Returns true if writeback might be needed or already in progress. */
 static bool mapping_needs_writeback(struct address_space *mapping)
 {
-- 
2.37.0 (Apple Git-136)



             reply	other threads:[~2022-11-01  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01  9:34 changfengnan [this message]
2022-11-01 12:44 ` Matthew Wilcox

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=20221101093413.5871-1-changfengnan@bytedance.com \
    --to=changfengnan@bytedance.com \
    --cc=chandan.babu@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox