diff options
author | Nick Piggin <npiggin@suse.de> | 2009-03-31 18:23:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 11:59:14 -0400 |
commit | c2ec175c39f62949438354f603f4aa170846aabb (patch) | |
tree | f2c9bf1bec2deabe2d3a5092405b027637b6ead3 /include | |
parent | c2fdf3a9b2d52842808a8e551b53b55dd9b45030 (diff) |
mm: page_mkwrite change prototype to match fault
Change the page_mkwrite prototype to take a struct vm_fault, and return
VM_FAULT_xxx flags. There should be no functional change.
This makes it possible to return much more detailed error information to
the VM (and also can provide more information eg. virtual_address to the
driver, which might be important in some special cases).
This is required for a subsequent fix. And will also make it easier to
merge page_mkwrite() with fault() in future.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <joel.becker@oracle.com>
Cc: Artem Bityutskiy <dedekind@infradead.org>
Cc: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/buffer_head.h | 2 | ||||
-rw-r--r-- | include/linux/mm.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index f19fd9045ea0..3d7bcde2e332 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -216,7 +216,7 @@ int cont_write_begin(struct file *, struct address_space *, loff_t, | |||
216 | get_block_t *, loff_t *); | 216 | get_block_t *, loff_t *); |
217 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | 217 | int generic_cont_expand_simple(struct inode *inode, loff_t size); |
218 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 218 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
219 | int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, | 219 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, |
220 | get_block_t get_block); | 220 | get_block_t get_block); |
221 | void block_sync_page(struct page *); | 221 | void block_sync_page(struct page *); |
222 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 222 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 2223f8dfa568..aeabe953ba4f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -135,6 +135,7 @@ extern pgprot_t protection_map[16]; | |||
135 | 135 | ||
136 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ | 136 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ |
137 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ | 137 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ |
138 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ | ||
138 | 139 | ||
139 | /* | 140 | /* |
140 | * This interface is used by x86 PAT code to identify a pfn mapping that is | 141 | * This interface is used by x86 PAT code to identify a pfn mapping that is |
@@ -187,7 +188,7 @@ struct vm_operations_struct { | |||
187 | 188 | ||
188 | /* notification that a previously read-only page is about to become | 189 | /* notification that a previously read-only page is about to become |
189 | * writable, if an error is returned it will cause a SIGBUS */ | 190 | * writable, if an error is returned it will cause a SIGBUS */ |
190 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); | 191 | int (*page_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf); |
191 | 192 | ||
192 | /* called by access_process_vm when get_user_pages() fails, typically | 193 | /* called by access_process_vm when get_user_pages() fails, typically |
193 | * for use by special VMAs that can switch between memory and hardware | 194 | * for use by special VMAs that can switch between memory and hardware |