diff options
author | Yuezhang Mo <Yuezhang.Mo@sony.com> | 2024-09-23 21:37:32 +0900 |
---|---|---|
committer | Namjae Jeon <linkinjeon@kernel.org> | 2024-09-23 21:38:11 +0900 |
commit | 6630ea49103c3d45461e29b0f6eb0ce750aeb8f5 (patch) | |
tree | 585813f8ca54dc7564583171cd66581b98d7d2f2 /rust/kernel | |
parent | d2b537b3e533f28e0d97293fe9293161fe8cd137 (diff) |
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>
Diffstat (limited to 'rust/kernel')
0 files changed, 0 insertions, 0 deletions