Skip to content

Commit e995e8b

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
netfs: Remove unnecessary references to pages
These places should all use folios instead of pages. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent c6a90fe commit e995e8b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

fs/netfs/buffered_read.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ static bool netfs_skip_folio_read(struct folio *folio, loff_t pos, size_t len,
646646
if (unlikely(always_fill)) {
647647
if (pos - offset + len <= i_size)
648648
return false; /* Page entirely before EOF */
649-
zero_user_segment(&folio->page, 0, plen);
649+
folio_zero_segment(folio, 0, plen);
650650
folio_mark_uptodate(folio);
651651
return true;
652652
}
@@ -665,7 +665,7 @@ static bool netfs_skip_folio_read(struct folio *folio, loff_t pos, size_t len,
665665

666666
return false;
667667
zero_out:
668-
zero_user_segments(&folio->page, 0, offset, offset + len, plen);
668+
folio_zero_segments(folio, 0, offset, offset + len, plen);
669669
return true;
670670
}
671671

@@ -732,7 +732,7 @@ int netfs_write_begin(struct netfs_inode *ctx,
732732
if (folio_test_uptodate(folio))
733733
goto have_folio;
734734

735-
/* If the page is beyond the EOF, we want to clear it - unless it's
735+
/* If the folio is beyond the EOF, we want to clear it - unless it's
736736
* within the cache granule containing the EOF, in which case we need
737737
* to preload the granule.
738738
*/
@@ -792,7 +792,7 @@ int netfs_write_begin(struct netfs_inode *ctx,
792792
EXPORT_SYMBOL(netfs_write_begin);
793793

794794
/*
795-
* Preload the data into a page we're proposing to write into.
795+
* Preload the data into a folio we're proposing to write into.
796796
*/
797797
int netfs_prefetch_for_write(struct file *file, struct folio *folio,
798798
size_t offset, size_t len)

fs/netfs/buffered_write.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ static void netfs_update_i_size(struct netfs_inode *ctx, struct inode *inode,
8383
* netfs_perform_write - Copy data into the pagecache.
8484
* @iocb: The operation parameters
8585
* @iter: The source buffer
86-
* @netfs_group: Grouping for dirty pages (eg. ceph snaps).
86+
* @netfs_group: Grouping for dirty folios (eg. ceph snaps).
8787
*
88-
* Copy data into pagecache pages attached to the inode specified by @iocb.
88+
* Copy data into pagecache folios attached to the inode specified by @iocb.
8989
* The caller must hold appropriate inode locks.
9090
*
91-
* Dirty pages are tagged with a netfs_folio struct if they're not up to date
92-
* to indicate the range modified. Dirty pages may also be tagged with a
91+
* Dirty folios are tagged with a netfs_folio struct if they're not up to date
92+
* to indicate the range modified. Dirty folios may also be tagged with a
9393
* netfs-specific grouping such that data from an old group gets flushed before
9494
* a new one is started.
9595
*/
@@ -223,11 +223,11 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
223223
* we try to read it.
224224
*/
225225
if (fpos >= ctx->zero_point) {
226-
zero_user_segment(&folio->page, 0, offset);
226+
folio_zero_segment(folio, 0, offset);
227227
copied = copy_folio_from_iter_atomic(folio, offset, part, iter);
228228
if (unlikely(copied == 0))
229229
goto copy_failed;
230-
zero_user_segment(&folio->page, offset + copied, flen);
230+
folio_zero_segment(folio, offset + copied, flen);
231231
__netfs_set_group(folio, netfs_group);
232232
folio_mark_uptodate(folio);
233233
trace_netfs_folio(folio, netfs_modify_and_clear);
@@ -407,7 +407,7 @@ EXPORT_SYMBOL(netfs_perform_write);
407407
* netfs_buffered_write_iter_locked - write data to a file
408408
* @iocb: IO state structure (file, offset, etc.)
409409
* @from: iov_iter with data to write
410-
* @netfs_group: Grouping for dirty pages (eg. ceph snaps).
410+
* @netfs_group: Grouping for dirty folios (eg. ceph snaps).
411411
*
412412
* This function does all the work needed for actually writing data to a
413413
* file. It does all basic checks, removes SUID from the file, updates

0 commit comments

Comments
 (0)