Skip to content

Commit 592ca09

Browse files
fs: update documentation of get_write_access() and friends
As VM_DENYWRITE does no longer exists, let's spring-clean the documentation of get_write_access() and friends. Acked-by: "Eric W. Biederman" <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: David Hildenbrand <[email protected]>
1 parent 6128b3a commit 592ca09

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

include/linux/fs.h

+12-7
Original file line numberDiff line numberDiff line change
@@ -3055,15 +3055,20 @@ static inline void file_end_write(struct file *file)
30553055
}
30563056

30573057
/*
3058+
* This is used for regular files where some users -- especially the
3059+
* currently executed binary in a process, previously handled via
3060+
* VM_DENYWRITE -- cannot handle concurrent write (and maybe mmap
3061+
* read-write shared) accesses.
3062+
*
30583063
* get_write_access() gets write permission for a file.
30593064
* put_write_access() releases this write permission.
3060-
* This is used for regular files.
3061-
* We cannot support write (and maybe mmap read-write shared) accesses and
3062-
* MAP_DENYWRITE mmappings simultaneously. The i_writecount field of an inode
3063-
* can have the following values:
3064-
* 0: no writers, no VM_DENYWRITE mappings
3065-
* < 0: (-i_writecount) vm_area_structs with VM_DENYWRITE set exist
3066-
* > 0: (i_writecount) users are writing to the file.
3065+
* deny_write_access() denies write access to a file.
3066+
* allow_write_access() re-enables write access to a file.
3067+
*
3068+
* The i_writecount field of an inode can have the following values:
3069+
* 0: no write access, no denied write access
3070+
* < 0: (-i_writecount) users that denied write access to the file.
3071+
* > 0: (i_writecount) users that have write access to the file.
30673072
*
30683073
* Normally we operate on that counter with atomic_{inc,dec} and it's safe
30693074
* except for the cases where we don't hold i_writecount yet. Then we need to

0 commit comments

Comments
 (0)