|
Kmods SIG |
d83023 |
From 4047e5d6ee42f45b206864a99360fae0f013c902 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
d83023 |
From: Peter Georg <peter.georg@physik.uni-regensburg.de>
|
|
Kmods SIG |
d83023 |
Date: Wed, 22 Sep 2021 22:32:09 +0200
|
|
Kmods SIG |
d83023 |
Subject: [PATCH 9004/9005] Compat: Replace readahead by readpages
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
---
|
|
Kmods SIG |
d83023 |
src/inode.c | 29 +++++++++--------------------
|
|
Kmods SIG |
d83023 |
1 file changed, 9 insertions(+), 20 deletions(-)
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
diff --git a/src/inode.c b/src/inode.c
|
|
Kmods SIG |
d83023 |
index 69eef0f..20b9aea 100644
|
|
Kmods SIG |
d83023 |
--- a/src/inode.c
|
|
Kmods SIG |
d83023 |
+++ b/src/inode.c
|
|
Kmods SIG |
d83023 |
@@ -704,34 +704,23 @@ static int ntfs_readpage(struct file *file, struct page *page)
|
|
Kmods SIG |
d83023 |
return mpage_readpage(page, ntfs_get_block);
|
|
Kmods SIG |
d83023 |
}
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
-static void ntfs_readahead(struct readahead_control *rac)
|
|
Kmods SIG |
d83023 |
+static int ntfs_readpages(struct file *file, struct address_space *mapping,
|
|
Kmods SIG |
d83023 |
+ struct list_head *pages, unsigned int nr_pages)
|
|
Kmods SIG |
d83023 |
{
|
|
Kmods SIG |
d83023 |
- struct address_space *mapping = rac->mapping;
|
|
Kmods SIG |
d83023 |
struct inode *inode = mapping->host;
|
|
Kmods SIG |
d83023 |
struct ntfs_inode *ni = ntfs_i(inode);
|
|
Kmods SIG |
d83023 |
- u64 valid;
|
|
Kmods SIG |
d83023 |
- loff_t pos;
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
if (is_resident(ni)) {
|
|
Kmods SIG |
d83023 |
- /* No readahead for resident. */
|
|
Kmods SIG |
d83023 |
- return;
|
|
Kmods SIG |
d83023 |
+ /* No readpages for resident. */
|
|
Kmods SIG |
d83023 |
+ return 0;
|
|
Kmods SIG |
d83023 |
}
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
if (is_compressed(ni)) {
|
|
Kmods SIG |
d83023 |
- /* No readahead for compressed. */
|
|
Kmods SIG |
d83023 |
- return;
|
|
Kmods SIG |
d83023 |
- }
|
|
Kmods SIG |
d83023 |
-
|
|
Kmods SIG |
d83023 |
- valid = ni->i_valid;
|
|
Kmods SIG |
d83023 |
- pos = readahead_pos(rac);
|
|
Kmods SIG |
d83023 |
-
|
|
Kmods SIG |
d83023 |
- if (valid < i_size_read(inode) && pos <= valid &&
|
|
Kmods SIG |
d83023 |
- valid < pos + readahead_length(rac)) {
|
|
Kmods SIG |
d83023 |
- /* Range cross 'valid'. Read it page by page. */
|
|
Kmods SIG |
d83023 |
- return;
|
|
Kmods SIG |
d83023 |
+ /* No readpages for compressed. */
|
|
Kmods SIG |
d83023 |
+ return 0;
|
|
Kmods SIG |
d83023 |
}
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
- mpage_readahead(rac, ntfs_get_block);
|
|
Kmods SIG |
d83023 |
+ return mpage_readpages(mapping, pages, nr_pages, ntfs_get_block);
|
|
Kmods SIG |
d83023 |
}
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
static int ntfs_get_block_direct_IO_R(struct inode *inode, sector_t iblock,
|
|
Kmods SIG |
d83023 |
@@ -1943,7 +1932,7 @@ const struct inode_operations ntfs_link_inode_operations = {
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
const struct address_space_operations ntfs_aops = {
|
|
Kmods SIG |
d83023 |
.readpage = ntfs_readpage,
|
|
Kmods SIG |
d83023 |
- .readahead = ntfs_readahead,
|
|
Kmods SIG |
d83023 |
+ .readpages = ntfs_readpages,
|
|
Kmods SIG |
d83023 |
.writepage = ntfs_writepage,
|
|
Kmods SIG |
d83023 |
.writepages = ntfs_writepages,
|
|
Kmods SIG |
d83023 |
.write_begin = ntfs_write_begin,
|
|
Kmods SIG |
d83023 |
@@ -1955,6 +1944,6 @@ const struct address_space_operations ntfs_aops = {
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
const struct address_space_operations ntfs_aops_cmpr = {
|
|
Kmods SIG |
d83023 |
.readpage = ntfs_readpage,
|
|
Kmods SIG |
d83023 |
- .readahead = ntfs_readahead,
|
|
Kmods SIG |
d83023 |
+ .readpages = ntfs_readpages,
|
|
Kmods SIG |
d83023 |
};
|
|
Kmods SIG |
d83023 |
// clang-format on
|
|
Kmods SIG |
d83023 |
--
|
|
Kmods SIG |
d83023 |
2.31.1
|
|
Kmods SIG |
d83023 |
|