summaryrefslogtreecommitdiff
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-05-12 09:57:09 (GMT)
committerTakashi Iwai <tiwai@suse.de>2009-05-12 09:57:09 (GMT)
commitddc4097b77bbb227851a44287acb2fb8a9896cc1 (patch)
tree319d098879bed7c45543d983de8becd509701b22 /Documentation/filesystems
parentbec4c99e8637b5b8bd4b0513eacb51da25885e3b (diff)
parentae31c1fbdbb18d917b0a1139497c2dbd35886989 (diff)
downloadlinux-ddc4097b77bbb227851a44287acb2fb8a9896cc1.tar.xz
Merge branch 'topic/drvdata-fix' into topic/asoc
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/Locking24
1 files changed, 16 insertions, 8 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 76efe5b..3120f8d 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -512,16 +512,24 @@ locking rules:
BKL mmap_sem PageLocked(page)
open: no yes
close: no yes
-fault: no yes
-page_mkwrite: no yes no
+fault: no yes can return with page locked
+page_mkwrite: no yes can return with page locked
access: no yes
- ->page_mkwrite() is called when a previously read-only page is
-about to become writeable. The file system is responsible for
-protecting against truncate races. Once appropriate action has been
-taking to lock out truncate, the page range should be verified to be
-within i_size. The page mapping should also be checked that it is not
-NULL.
+ ->fault() is called when a previously not present pte is about
+to be faulted in. The filesystem must find and return the page associated
+with the passed in "pgoff" in the vm_fault structure. If it is possible that
+the page may be truncated and/or invalidated, then the filesystem must lock
+the page, then ensure it is not already truncated (the page lock will block
+subsequent truncate), and then return with VM_FAULT_LOCKED, and the page
+locked. The VM will unlock the page.
+
+ ->page_mkwrite() is called when a previously read-only pte is
+about to become writeable. The filesystem again must ensure that there are
+no truncate/invalidate races, and then return with the page locked. If
+the page has been truncated, the filesystem should not look up a new page
+like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which
+will cause the VM to retry the fault.
->access() is called when get_user_pages() fails in
acces_process_vm(), typically used to debug a process through