Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux.git] / Documentation / filesystems / Locking
index bb2534bc0b0301d7493defb6ee078ecd91efc693..eba7901342531d2dc089c9a39d990aa924b86526 100644 (file)
@@ -47,6 +47,8 @@ prototypes:
        int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
        int (*rename) (struct inode *, struct dentry *,
                        struct inode *, struct dentry *);
+       int (*rename2) (struct inode *, struct dentry *,
+                       struct inode *, struct dentry *, unsigned int);
        int (*readlink) (struct dentry *, char __user *,int);
        void * (*follow_link) (struct dentry *, struct nameidata *);
        void (*put_link) (struct dentry *, struct nameidata *, void *);
@@ -78,6 +80,7 @@ mkdir:                yes
 unlink:                yes (both)
 rmdir:         yes (both)      (see below)
 rename:                yes (all)       (see below)
+rename2:       yes (all)       (see below)
 readlink:      no
 follow_link:   no
 put_link:      no
@@ -96,7 +99,8 @@ tmpfile:      no
 
        Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
 victim.
-       cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
+       cross-directory ->rename() and rename2() has (per-superblock)
+->s_vfs_rename_sem.
 
 See Documentation/filesystems/directory-locking for more detailed discussion
 of the locking scheme for directory operations.
@@ -525,6 +529,7 @@ locking rules:
 open:          yes
 close:         yes
 fault:         yes             can return with page locked
+map_pages:     yes
 page_mkwrite:  yes             can return with page locked
 access:                yes
 
@@ -536,6 +541,15 @@ 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.
 
+       ->map_pages() is called when VM asks to map easy accessible pages.
+Filesystem should find and map pages associated with offsets from "pgoff"
+till "max_pgoff". ->map_pages() is called with page table locked and must
+not block.  If it's not possible to reach a page without blocking,
+filesystem should skip it. Filesystem should use do_set_pte() to setup
+page table entry. Pointer to entry associated with offset "pgoff" is
+passed in "pte" field in vm_fault structure. Pointers to entries for other
+offsets should be calculated relative to "pte".
+
        ->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