diff options
author | Nick Piggin <npiggin@suse.de> | 2008-10-29 17:00:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 14:38:45 -0400 |
commit | 4e02ed4b4a2fae34aae766a5bb93ae235f60adb8 (patch) | |
tree | bddfb61b7cc4a4007ae176ccb1ace5740b61da8d /Documentation/filesystems/vfs.txt | |
parent | 9b913735e53ab0da4a792bac0de8e178cc13dcfb (diff) |
fs: remove prepare_write/commit_write
Nothing uses prepare_write or commit_write. Remove them from the tree
completely.
[akpm@linux-foundation.org: schedule simple_prepare_write() for unexporting]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r-- | Documentation/filesystems/vfs.txt | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index c4d348dabe94..5579bda58a6d 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -492,7 +492,7 @@ written-back to storage typically in whole pages, however the | |||
492 | address_space has finer control of write sizes. | 492 | address_space has finer control of write sizes. |
493 | 493 | ||
494 | The read process essentially only requires 'readpage'. The write | 494 | The read process essentially only requires 'readpage'. The write |
495 | process is more complicated and uses prepare_write/commit_write or | 495 | process is more complicated and uses write_begin/write_end or |
496 | set_page_dirty to write data into the address_space, and writepage, | 496 | set_page_dirty to write data into the address_space, and writepage, |
497 | sync_page, and writepages to writeback data to storage. | 497 | sync_page, and writepages to writeback data to storage. |
498 | 498 | ||
@@ -521,8 +521,6 @@ struct address_space_operations { | |||
521 | int (*set_page_dirty)(struct page *page); | 521 | int (*set_page_dirty)(struct page *page); |
522 | int (*readpages)(struct file *filp, struct address_space *mapping, | 522 | int (*readpages)(struct file *filp, struct address_space *mapping, |
523 | struct list_head *pages, unsigned nr_pages); | 523 | struct list_head *pages, unsigned nr_pages); |
524 | int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); | ||
525 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | ||
526 | int (*write_begin)(struct file *, struct address_space *mapping, | 524 | int (*write_begin)(struct file *, struct address_space *mapping, |
527 | loff_t pos, unsigned len, unsigned flags, | 525 | loff_t pos, unsigned len, unsigned flags, |
528 | struct page **pagep, void **fsdata); | 526 | struct page **pagep, void **fsdata); |
@@ -598,37 +596,7 @@ struct address_space_operations { | |||
598 | readpages is only used for read-ahead, so read errors are | 596 | readpages is only used for read-ahead, so read errors are |
599 | ignored. If anything goes wrong, feel free to give up. | 597 | ignored. If anything goes wrong, feel free to give up. |
600 | 598 | ||
601 | prepare_write: called by the generic write path in VM to set up a write | 599 | write_begin: |
602 | request for a page. This indicates to the address space that | ||
603 | the given range of bytes is about to be written. The | ||
604 | address_space should check that the write will be able to | ||
605 | complete, by allocating space if necessary and doing any other | ||
606 | internal housekeeping. If the write will update parts of | ||
607 | any basic-blocks on storage, then those blocks should be | ||
608 | pre-read (if they haven't been read already) so that the | ||
609 | updated blocks can be written out properly. | ||
610 | The page will be locked. | ||
611 | |||
612 | Note: the page _must not_ be marked uptodate in this function | ||
613 | (or anywhere else) unless it actually is uptodate right now. As | ||
614 | soon as a page is marked uptodate, it is possible for a concurrent | ||
615 | read(2) to copy it to userspace. | ||
616 | |||
617 | commit_write: If prepare_write succeeds, new data will be copied | ||
618 | into the page and then commit_write will be called. It will | ||
619 | typically update the size of the file (if appropriate) and | ||
620 | mark the inode as dirty, and do any other related housekeeping | ||
621 | operations. It should avoid returning an error if possible - | ||
622 | errors should have been handled by prepare_write. | ||
623 | |||
624 | write_begin: This is intended as a replacement for prepare_write. The | ||
625 | key differences being that: | ||
626 | - it returns a locked page (in *pagep) rather than being | ||
627 | given a pre locked page; | ||
628 | - it must be able to cope with short writes (where the | ||
629 | length passed to write_begin is greater than the number | ||
630 | of bytes copied into the page). | ||
631 | |||
632 | Called by the generic buffered write code to ask the filesystem to | 600 | Called by the generic buffered write code to ask the filesystem to |
633 | prepare to write len bytes at the given offset in the file. The | 601 | prepare to write len bytes at the given offset in the file. The |
634 | address_space should check that the write will be able to complete, | 602 | address_space should check that the write will be able to complete, |
@@ -640,6 +608,9 @@ struct address_space_operations { | |||
640 | The filesystem must return the locked pagecache page for the specified | 608 | The filesystem must return the locked pagecache page for the specified |
641 | offset, in *pagep, for the caller to write into. | 609 | offset, in *pagep, for the caller to write into. |
642 | 610 | ||
611 | It must be able to cope with short writes (where the length passed to | ||
612 | write_begin is greater than the number of bytes copied into the page). | ||
613 | |||
643 | flags is a field for AOP_FLAG_xxx flags, described in | 614 | flags is a field for AOP_FLAG_xxx flags, described in |
644 | include/linux/fs.h. | 615 | include/linux/fs.h. |
645 | 616 | ||