[PATCH] mm: remove filemap_fdatawait_keep_errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



use filemap_fdatawait_range_keep_errors to instead of
filemap_fdatawait_keep_errors, no functional change.

Signed-off-by: changfengnan <changfengnan@xxxxxxxxxxxxx>
---
 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)




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux