Merge tag 'staging-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[firefly-linux-kernel-4.4.55.git] / Documentation / filesystems / Locking
index 8e2da1e06e3b2371eb82ef07105e63ad97d224b6..e540a24e5d069d4f6372adaabfa792ff11897ca9 100644 (file)
@@ -9,7 +9,7 @@ be able to use diff(1).
 
 --------------------------- dentry_operations --------------------------
 prototypes:
-       int (*d_revalidate)(struct dentry *, struct nameidata *);
+       int (*d_revalidate)(struct dentry *, unsigned int);
        int (*d_hash)(const struct dentry *, const struct inode *,
                        struct qstr *);
        int (*d_compare)(const struct dentry *, const struct inode *,
@@ -37,9 +37,8 @@ d_manage:     no              no              yes (ref-walk)  maybe
 
 --------------------------- inode_operations --------------------------- 
 prototypes:
-       int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *);
-       struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid
-ata *);
+       int (*create) (struct inode *,struct dentry *,umode_t, bool);
+       struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
        int (*link) (struct dentry *,struct inode *,struct dentry *);
        int (*unlink) (struct inode *,struct dentry *);
        int (*symlink) (struct inode *,struct dentry *,const char *);
@@ -62,6 +61,9 @@ ata *);
        int (*removexattr) (struct dentry *, const char *);
        int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
        void (*update_time)(struct inode *, struct timespec *, int);
+       int (*atomic_open)(struct inode *, struct dentry *,
+                               struct file *, unsigned open_flag,
+                               umode_t create_mode, int *opened);
 
 locking rules:
        all may block
@@ -89,6 +91,7 @@ listxattr:    no
 removexattr:   yes
 fiemap:                no
 update_time:   no
+atomic_open:   yes
 
        Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
 victim.
@@ -111,7 +114,6 @@ prototypes:
        int (*drop_inode) (struct inode *);
        void (*evict_inode) (struct inode *);
        void (*put_super) (struct super_block *);
-       void (*write_super) (struct super_block *);
        int (*sync_fs)(struct super_block *sb, int wait);
        int (*freeze_fs) (struct super_block *);
        int (*unfreeze_fs) (struct super_block *);
@@ -133,10 +135,9 @@ write_inode:
 drop_inode:                            !!!inode->i_lock!!!
 evict_inode:
 put_super:             write
-write_super:           read
 sync_fs:               read
-freeze_fs:             read
-unfreeze_fs:           read
+freeze_fs:             write
+unfreeze_fs:           write
 statfs:                        maybe(read)     (see below)
 remount_fs:            write
 umount_begin:          no
@@ -203,6 +204,8 @@ prototypes:
        int (*launder_page)(struct page *);
        int (*is_partially_uptodate)(struct page *, read_descriptor_t *, unsigned long);
        int (*error_remove_page)(struct address_space *, struct page *);
+       int (*swap_activate)(struct file *);
+       int (*swap_deactivate)(struct file *);
 
 locking rules:
        All except set_page_dirty and freepage may block
@@ -226,6 +229,8 @@ migratepage:                yes (both)
 launder_page:          yes
 is_partially_uptodate: yes
 error_remove_page:     yes
+swap_activate:         no
+swap_deactivate:       no
 
        ->write_begin(), ->write_end(), ->sync_page() and ->readpage()
 may be called from the request handler (/dev/loop).
@@ -327,6 +332,15 @@ cleaned, or an error value if not. Note that in order to prevent the page
 getting mapped back in and redirtied, it needs to be kept locked
 across the entire operation.
 
+       ->swap_activate will be called with a non-zero argument on
+files backing (non block device backed) swapfiles. A return value
+of zero indicates success, in which case this file can be used for
+backing swapspace. The swapspace operations will be proxied to the
+address space operations.
+
+       ->swap_deactivate() will be called in the sys_swapoff()
+path after ->swap_activate() returned success.
+
 ----------------------- file_lock_operations ------------------------------
 prototypes:
        void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
@@ -343,7 +357,6 @@ prototypes:
        int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
        void (*lm_notify)(struct file_lock *);  /* unblock callback */
        int (*lm_grant)(struct file_lock *, struct file_lock *, int);
-       void (*lm_release_private)(struct file_lock *);
        void (*lm_break)(struct file_lock *); /* break_lease callback */
        int (*lm_change)(struct file_lock **, int);
 
@@ -352,7 +365,6 @@ locking rules:
 lm_compare_owner:      yes             no
 lm_notify:             yes             no
 lm_grant:              no              no
-lm_release_private:    maybe           no
 lm_break:              yes             no
 lm_change              yes             no