[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241101081753.10585-7-almaz.alexandrovich@paragon-software.com>
Date: Fri, 1 Nov 2024 11:17:52 +0300
From: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To: <ntfs3@...ts.linux.dev>
CC: <linux-kernel@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
Subject: [PATCH 6/7] fs/ntfs3: Switch to folio to release resources
As part of the process of switching from page to folio.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
---
fs/ntfs3/file.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index 0063e2351aa9..3f96a11804c9 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -989,6 +989,7 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
u64 frame_vbo;
pgoff_t index;
bool frame_uptodate;
+ struct folio *folio;
if (frame_size < PAGE_SIZE) {
/*
@@ -1043,8 +1044,9 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
if (err) {
for (ip = 0; ip < pages_per_frame; ip++) {
page = pages[ip];
- unlock_page(page);
- put_page(page);
+ folio = page_folio(page);
+ folio_unlock(folio);
+ folio_put(folio);
}
goto out;
}
@@ -1054,9 +1056,10 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
off = offset_in_page(valid);
for (; ip < pages_per_frame; ip++, off = 0) {
page = pages[ip];
+ folio = page_folio(page);
zero_user_segment(page, off, PAGE_SIZE);
flush_dcache_page(page);
- SetPageUptodate(page);
+ folio_mark_uptodate(folio);
}
ni_lock(ni);
@@ -1065,9 +1068,10 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
for (ip = 0; ip < pages_per_frame; ip++) {
page = pages[ip];
- SetPageUptodate(page);
- unlock_page(page);
- put_page(page);
+ folio = page_folio(page);
+ folio_mark_uptodate(folio);
+ folio_unlock(folio);
+ folio_put(folio);
}
if (err)
@@ -1109,8 +1113,9 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
for (ip = 0; ip < pages_per_frame;
ip++) {
page = pages[ip];
- unlock_page(page);
- put_page(page);
+ folio = page_folio(page);
+ folio_unlock(folio);
+ folio_put(folio);
}
goto out;
}
@@ -1151,9 +1156,10 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
for (ip = 0; ip < pages_per_frame; ip++) {
page = pages[ip];
ClearPageDirty(page);
- SetPageUptodate(page);
- unlock_page(page);
- put_page(page);
+ folio = page_folio(page);
+ folio_mark_uptodate(folio);
+ folio_unlock(folio);
+ folio_put(folio);
}
if (err)
--
2.34.1
Powered by blists - more mailing lists