linux/fs/exfat
Yuezhang Mo 6630ea4910 exfat: move extend valid_size into ->page_mkwrite()
It is not a good way to extend valid_size to the end of the
mmap area by writing zeros in mmap. Because after calling mmap,
no data may be written, or only a small amount of data may be
written to the head of the mmap area.

This commit moves extending valid_size to exfat_page_mkwrite().
In exfat_page_mkwrite() only extend valid_size to the starting
position of new data writing, which reduces unnecessary writing
of zeros.

If the block is not mapped and is marked as new after being
mapped for writing, block_write_begin() will zero the page
cache corresponding to the block, so there is no need to call
zero_user_segment() in exfat_file_zeroed_range(). And after moving
extending valid_size to exfat_page_mkwrite(), the data written by
mmap will be copied to the page cache but the page cache may be
not mapped to the disk. Calling zero_user_segment() will cause
the data written by mmap to be cleared. So this commit removes
calling zero_user_segment() from exfat_file_zeroed_range() and
renames exfat_file_zeroed_range() to exfat_extend_valid_size().

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2024-09-23 21:38:11 +09:00
..
balloc.c exfat: fix memory leak in exfat_load_bitmap() 2024-09-18 07:40:58 +09:00
cache.c mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
dir.c exfat: fix potential deadlock on __exfat_get_dentry_set 2024-07-15 21:44:28 +09:00
exfat_fs.h exfat: Implement sops->shutdown and ioctl 2024-09-18 07:40:56 +09:00
exfat_raw.h exfat: add ioctls for accessing attributes 2023-10-31 10:00:51 +09:00
fatent.c exfat: fix the newly allocated clusters are not freed in error handling 2023-02-28 20:01:40 +09:00
file.c exfat: move extend valid_size into ->page_mkwrite() 2024-09-23 21:38:11 +09:00
inode.c exfat: Implement sops->shutdown and ioctl 2024-09-18 07:40:56 +09:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile exfat: add Kconfig and Makefile 2020-03-05 21:00:40 -05:00
misc.c exfat: convert to new timestamp accessors 2023-10-18 13:26:21 +02:00
namei.c exfat: Implement sops->shutdown and ioctl 2024-09-18 07:40:56 +09:00
nls.c exfat: move freeing sbi, upcase table and dropping nls into rcu-delayed helper 2024-02-25 02:10:31 -05:00
super.c exfat: Implement sops->shutdown and ioctl 2024-09-18 07:40:56 +09:00