aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/Locking
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/filesystems/Locking')
-rw-r--r--Documentation/filesystems/Locking32
1 files changed, 22 insertions, 10 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 8e2da1e06e3b..e540a24e5d06 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -9,7 +9,7 @@ be able to use diff(1).
9 9
10--------------------------- dentry_operations -------------------------- 10--------------------------- dentry_operations --------------------------
11prototypes: 11prototypes:
12 int (*d_revalidate)(struct dentry *, struct nameidata *); 12 int (*d_revalidate)(struct dentry *, unsigned int);
13 int (*d_hash)(const struct dentry *, const struct inode *, 13 int (*d_hash)(const struct dentry *, const struct inode *,
14 struct qstr *); 14 struct qstr *);
15 int (*d_compare)(const struct dentry *, const struct inode *, 15 int (*d_compare)(const struct dentry *, const struct inode *,
@@ -37,9 +37,8 @@ d_manage: no no yes (ref-walk) maybe
37 37
38--------------------------- inode_operations --------------------------- 38--------------------------- inode_operations ---------------------------
39prototypes: 39prototypes:
40 int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *); 40 int (*create) (struct inode *,struct dentry *,umode_t, bool);
41 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid 41 struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
42ata *);
43 int (*link) (struct dentry *,struct inode *,struct dentry *); 42 int (*link) (struct dentry *,struct inode *,struct dentry *);
44 int (*unlink) (struct inode *,struct dentry *); 43 int (*unlink) (struct inode *,struct dentry *);
45 int (*symlink) (struct inode *,struct dentry *,const char *); 44 int (*symlink) (struct inode *,struct dentry *,const char *);
@@ -62,6 +61,9 @@ ata *);
62 int (*removexattr) (struct dentry *, const char *); 61 int (*removexattr) (struct dentry *, const char *);
63 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); 62 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
64 void (*update_time)(struct inode *, struct timespec *, int); 63 void (*update_time)(struct inode *, struct timespec *, int);
64 int (*atomic_open)(struct inode *, struct dentry *,
65 struct file *, unsigned open_flag,
66 umode_t create_mode, int *opened);
65 67
66locking rules: 68locking rules:
67 all may block 69 all may block
@@ -89,6 +91,7 @@ listxattr: no
89removexattr: yes 91removexattr: yes
90fiemap: no 92fiemap: no
91update_time: no 93update_time: no
94atomic_open: yes
92 95
93 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on 96 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
94victim. 97victim.
@@ -111,7 +114,6 @@ prototypes:
111 int (*drop_inode) (struct inode *); 114 int (*drop_inode) (struct inode *);
112 void (*evict_inode) (struct inode *); 115 void (*evict_inode) (struct inode *);
113 void (*put_super) (struct super_block *); 116 void (*put_super) (struct super_block *);
114 void (*write_super) (struct super_block *);
115 int (*sync_fs)(struct super_block *sb, int wait); 117 int (*sync_fs)(struct super_block *sb, int wait);
116 int (*freeze_fs) (struct super_block *); 118 int (*freeze_fs) (struct super_block *);
117 int (*unfreeze_fs) (struct super_block *); 119 int (*unfreeze_fs) (struct super_block *);
@@ -133,10 +135,9 @@ write_inode:
133drop_inode: !!!inode->i_lock!!! 135drop_inode: !!!inode->i_lock!!!
134evict_inode: 136evict_inode:
135put_super: write 137put_super: write
136write_super: read
137sync_fs: read 138sync_fs: read
138freeze_fs: read 139freeze_fs: write
139unfreeze_fs: read 140unfreeze_fs: write
140statfs: maybe(read) (see below) 141statfs: maybe(read) (see below)
141remount_fs: write 142remount_fs: write
142umount_begin: no 143umount_begin: no
@@ -203,6 +204,8 @@ prototypes:
203 int (*launder_page)(struct page *); 204 int (*launder_page)(struct page *);
204 int (*is_partially_uptodate)(struct page *, read_descriptor_t *, unsigned long); 205 int (*is_partially_uptodate)(struct page *, read_descriptor_t *, unsigned long);
205 int (*error_remove_page)(struct address_space *, struct page *); 206 int (*error_remove_page)(struct address_space *, struct page *);
207 int (*swap_activate)(struct file *);
208 int (*swap_deactivate)(struct file *);
206 209
207locking rules: 210locking rules:
208 All except set_page_dirty and freepage may block 211 All except set_page_dirty and freepage may block
@@ -226,6 +229,8 @@ migratepage: yes (both)
226launder_page: yes 229launder_page: yes
227is_partially_uptodate: yes 230is_partially_uptodate: yes
228error_remove_page: yes 231error_remove_page: yes
232swap_activate: no
233swap_deactivate: no
229 234
230 ->write_begin(), ->write_end(), ->sync_page() and ->readpage() 235 ->write_begin(), ->write_end(), ->sync_page() and ->readpage()
231may be called from the request handler (/dev/loop). 236may 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
327getting mapped back in and redirtied, it needs to be kept locked 332getting mapped back in and redirtied, it needs to be kept locked
328across the entire operation. 333across the entire operation.
329 334
335 ->swap_activate will be called with a non-zero argument on
336files backing (non block device backed) swapfiles. A return value
337of zero indicates success, in which case this file can be used for
338backing swapspace. The swapspace operations will be proxied to the
339address space operations.
340
341 ->swap_deactivate() will be called in the sys_swapoff()
342path after ->swap_activate() returned success.
343
330----------------------- file_lock_operations ------------------------------ 344----------------------- file_lock_operations ------------------------------
331prototypes: 345prototypes:
332 void (*fl_copy_lock)(struct file_lock *, struct file_lock *); 346 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
@@ -343,7 +357,6 @@ prototypes:
343 int (*lm_compare_owner)(struct file_lock *, struct file_lock *); 357 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
344 void (*lm_notify)(struct file_lock *); /* unblock callback */ 358 void (*lm_notify)(struct file_lock *); /* unblock callback */
345 int (*lm_grant)(struct file_lock *, struct file_lock *, int); 359 int (*lm_grant)(struct file_lock *, struct file_lock *, int);
346 void (*lm_release_private)(struct file_lock *);
347 void (*lm_break)(struct file_lock *); /* break_lease callback */ 360 void (*lm_break)(struct file_lock *); /* break_lease callback */
348 int (*lm_change)(struct file_lock **, int); 361 int (*lm_change)(struct file_lock **, int);
349 362
@@ -352,7 +365,6 @@ locking rules:
352lm_compare_owner: yes no 365lm_compare_owner: yes no
353lm_notify: yes no 366lm_notify: yes no
354lm_grant: no no 367lm_grant: no no
355lm_release_private: maybe no
356lm_break: yes no 368lm_break: yes no
357lm_change yes no 369lm_change yes no
358 370