mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
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@paragon-software.com>
This commit is contained in:
parent
db1d2b4cc9
commit
678c1901af
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user