aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/buffer_head.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r--include/linux/buffer_head.h20
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)
124BUFFER_FNS(Delay, delay) 123BUFFER_FNS(Delay, delay)
125BUFFER_FNS(Boundary, boundary) 124BUFFER_FNS(Boundary, boundary)
126BUFFER_FNS(Write_EIO, write_io_error) 125BUFFER_FNS(Write_EIO, write_io_error)
127BUFFER_FNS(Eopnotsupp, eopnotsupp)
128BUFFER_FNS(Unwritten, unwritten) 126BUFFER_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 *);
216void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); 214void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
217int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
218int cont_write_begin(struct file *, struct address_space *, loff_t, 215int 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 *);
221int generic_cont_expand_simple(struct inode *inode, loff_t size); 218int generic_cont_expand_simple(struct inode *inode, loff_t size);
222int block_commit_write(struct page *page, unsigned from, unsigned to); 219int block_commit_write(struct page *page, unsigned from, unsigned to);
220int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
221 get_block_t get_block);
223int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, 222int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
224 get_block_t get_block); 223 get_block_t get_block);
225void block_sync_page(struct page *); 224/* Convert errno to return value from ->page_mkwrite() call */
225static 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}
226sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 238sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
227int block_truncate_page(struct address_space *, loff_t, get_block_t *); 239int block_truncate_page(struct address_space *, loff_t, get_block_t *);
228int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, 240int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned,