1PAGECACHE_ISIZE_EXTE(9)   Memory Management in Linux   PAGECACHE_ISIZE_EXTE(9)
2
3
4

NAME

6       pagecache_isize_extended - update pagecache after extension of i_size
7

SYNOPSIS

9       void pagecache_isize_extended(struct inode * inode, loff_t from,
10                                     loff_t to);
11

ARGUMENTS

13       inode
14           inode for which i_size was extended
15
16       from
17           original inode size
18
19       to
20           new inode size
21

DESCRIPTION

23       Handle extension of inode size either caused by extending truncate or
24       by write starting after current i_size. We mark the page straddling
25       current i_size RO so that page_mkwrite is called on the nearest write
26       access to the page. This way filesystem can be sure that page_mkwrite
27       is called on the page before user writes to the page via mmap after the
28       i_size has been changed.
29
30       The function must be called after i_size is updated so that page fault
31       coming after we unlock the page will already see the new i_size. The
32       function must be called while we still hold i_mutex - this not only
33       makes sure i_size is stable but also that userspace cannot observe new
34       i_size value before we are prepared to store mmap writes at new inode
35       size.
36
38Kernel Hackers Manual 3.10         June 2019           PAGECACHE_ISIZE_EXTE(9)
Impressum