diff options
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/Locking | 13 | ||||
-rw-r--r-- | Documentation/filesystems/vfs.txt | 12 |
2 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index e0cce2a5f820..2db1900d7538 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -206,6 +206,8 @@ prototypes: | |||
206 | int (*launder_page)(struct page *); | 206 | int (*launder_page)(struct page *); |
207 | int (*is_partially_uptodate)(struct page *, read_descriptor_t *, unsigned long); | 207 | int (*is_partially_uptodate)(struct page *, read_descriptor_t *, unsigned long); |
208 | int (*error_remove_page)(struct address_space *, struct page *); | 208 | int (*error_remove_page)(struct address_space *, struct page *); |
209 | int (*swap_activate)(struct file *); | ||
210 | int (*swap_deactivate)(struct file *); | ||
209 | 211 | ||
210 | locking rules: | 212 | locking rules: |
211 | All except set_page_dirty and freepage may block | 213 | All except set_page_dirty and freepage may block |
@@ -229,6 +231,8 @@ migratepage: yes (both) | |||
229 | launder_page: yes | 231 | launder_page: yes |
230 | is_partially_uptodate: yes | 232 | is_partially_uptodate: yes |
231 | error_remove_page: yes | 233 | error_remove_page: yes |
234 | swap_activate: no | ||
235 | swap_deactivate: no | ||
232 | 236 | ||
233 | ->write_begin(), ->write_end(), ->sync_page() and ->readpage() | 237 | ->write_begin(), ->write_end(), ->sync_page() and ->readpage() |
234 | may be called from the request handler (/dev/loop). | 238 | may be called from the request handler (/dev/loop). |
@@ -330,6 +334,15 @@ cleaned, or an error value if not. Note that in order to prevent the page | |||
330 | getting mapped back in and redirtied, it needs to be kept locked | 334 | getting mapped back in and redirtied, it needs to be kept locked |
331 | across the entire operation. | 335 | across the entire operation. |
332 | 336 | ||
337 | ->swap_activate will be called with a non-zero argument on | ||
338 | files backing (non block device backed) swapfiles. A return value | ||
339 | of zero indicates success, in which case this file can be used for | ||
340 | backing swapspace. The swapspace operations will be proxied to the | ||
341 | address space operations. | ||
342 | |||
343 | ->swap_deactivate() will be called in the sys_swapoff() | ||
344 | path after ->swap_activate() returned success. | ||
345 | |||
333 | ----------------------- file_lock_operations ------------------------------ | 346 | ----------------------- file_lock_operations ------------------------------ |
334 | prototypes: | 347 | prototypes: |
335 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | 348 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index aa754e01464e..065aa2dc0835 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -592,6 +592,8 @@ struct address_space_operations { | |||
592 | int (*migratepage) (struct page *, struct page *); | 592 | int (*migratepage) (struct page *, struct page *); |
593 | int (*launder_page) (struct page *); | 593 | int (*launder_page) (struct page *); |
594 | int (*error_remove_page) (struct mapping *mapping, struct page *page); | 594 | int (*error_remove_page) (struct mapping *mapping, struct page *page); |
595 | int (*swap_activate)(struct file *); | ||
596 | int (*swap_deactivate)(struct file *); | ||
595 | }; | 597 | }; |
596 | 598 | ||
597 | writepage: called by the VM to write a dirty page to backing store. | 599 | writepage: called by the VM to write a dirty page to backing store. |
@@ -760,6 +762,16 @@ struct address_space_operations { | |||
760 | Setting this implies you deal with pages going away under you, | 762 | Setting this implies you deal with pages going away under you, |
761 | unless you have them locked or reference counts increased. | 763 | unless you have them locked or reference counts increased. |
762 | 764 | ||
765 | swap_activate: Called when swapon is used on a file to allocate | ||
766 | space if necessary and pin the block lookup information in | ||
767 | memory. A return value of zero indicates success, | ||
768 | in which case this file can be used to back swapspace. The | ||
769 | swapspace operations will be proxied to this address space's | ||
770 | ->swap_{out,in} methods. | ||
771 | |||
772 | swap_deactivate: Called during swapoff on files where swap_activate | ||
773 | was successful. | ||
774 | |||
763 | 775 | ||
764 | The File Object | 776 | The File Object |
765 | =============== | 777 | =============== |