diff mbox series

[09/12] shmem: enable per-block uptodate

Message ID 20240515055719.32577-10-da.gomez@samsung.com (mailing list archive)
State New
Headers show
Series shmem/tmpfs: add large folios support | expand

Commit Message

Daniel Gomez May 15, 2024, 5:57 a.m. UTC
In the write_end() function, mark only the blocks that are being written
as uptodate.

Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
 mm/shmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/mm/shmem.c b/mm/shmem.c
index d5e6c8eba983..7a6ad678e2ff 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2991,7 +2991,7 @@  shmem_write_end(struct file *file, struct address_space *mapping,
 	if (pos + copied > inode->i_size)
 		i_size_write(inode, pos + copied);
 
-	shmem_set_range_uptodate(folio, 0, folio_size(folio));
+	shmem_set_range_uptodate(folio, offset_in_folio(folio, pos), len);
 	folio_mark_dirty(folio);
 	folio_unlock(folio);
 	folio_put(folio);