diff options
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r-- | include/linux/buffer_head.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index ec94c12f21da..503c8a6b3079 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -32,7 +32,6 @@ enum bh_state_bits { | |||
32 | BH_Delay, /* Buffer is not yet allocated on disk */ | 32 | BH_Delay, /* Buffer is not yet allocated on disk */ |
33 | BH_Boundary, /* Block is followed by a discontiguity */ | 33 | BH_Boundary, /* Block is followed by a discontiguity */ |
34 | BH_Write_EIO, /* I/O error on write */ | 34 | BH_Write_EIO, /* I/O error on write */ |
35 | BH_Eopnotsupp, /* operation not supported (barrier) */ | ||
36 | BH_Unwritten, /* Buffer is allocated on disk but not written */ | 35 | BH_Unwritten, /* Buffer is allocated on disk but not written */ |
37 | BH_Quiet, /* Buffer Error Prinks to be quiet */ | 36 | BH_Quiet, /* Buffer Error Prinks to be quiet */ |
38 | 37 | ||
@@ -124,7 +123,6 @@ BUFFER_FNS(Async_Write, async_write) | |||
124 | BUFFER_FNS(Delay, delay) | 123 | BUFFER_FNS(Delay, delay) |
125 | BUFFER_FNS(Boundary, boundary) | 124 | BUFFER_FNS(Boundary, boundary) |
126 | BUFFER_FNS(Write_EIO, write_io_error) | 125 | BUFFER_FNS(Write_EIO, write_io_error) |
127 | BUFFER_FNS(Eopnotsupp, eopnotsupp) | ||
128 | BUFFER_FNS(Unwritten, unwritten) | 126 | BUFFER_FNS(Unwritten, unwritten) |
129 | 127 | ||
130 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) | 128 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) |
@@ -214,15 +212,29 @@ int generic_write_end(struct file *, struct address_space *, | |||
214 | loff_t, unsigned, unsigned, | 212 | loff_t, unsigned, unsigned, |
215 | struct page *, void *); | 213 | struct page *, void *); |
216 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); | 214 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); |
217 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); | ||
218 | int cont_write_begin(struct file *, struct address_space *, loff_t, | 215 | int cont_write_begin(struct file *, struct address_space *, loff_t, |
219 | unsigned, unsigned, struct page **, void **, | 216 | unsigned, unsigned, struct page **, void **, |
220 | get_block_t *, loff_t *); | 217 | get_block_t *, loff_t *); |
221 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | 218 | int generic_cont_expand_simple(struct inode *inode, loff_t size); |
222 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 219 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
220 | int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | ||
221 | get_block_t get_block); | ||
223 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | 222 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, |
224 | get_block_t get_block); | 223 | get_block_t get_block); |
225 | void block_sync_page(struct page *); | 224 | /* Convert errno to return value from ->page_mkwrite() call */ |
225 | static inline int block_page_mkwrite_return(int err) | ||
226 | { | ||
227 | if (err == 0) | ||
228 | return VM_FAULT_LOCKED; | ||
229 | if (err == -EFAULT) | ||
230 | return VM_FAULT_NOPAGE; | ||
231 | if (err == -ENOMEM) | ||
232 | return VM_FAULT_OOM; | ||
233 | if (err == -EAGAIN) | ||
234 | return VM_FAULT_RETRY; | ||
235 | /* -ENOSPC, -EDQUOT, -EIO ... */ | ||
236 | return VM_FAULT_SIGBUS; | ||
237 | } | ||
226 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 238 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
227 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 239 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
228 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, | 240 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, |