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.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 16ed0284d780..68d1fe7b877c 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -32,8 +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_Ordered, /* ordered write */
36 BH_Eopnotsupp, /* operation not supported (barrier) */
37 BH_Unwritten, /* Buffer is allocated on disk but not written */ 35 BH_Unwritten, /* Buffer is allocated on disk but not written */
38 BH_Quiet, /* Buffer Error Prinks to be quiet */ 36 BH_Quiet, /* Buffer Error Prinks to be quiet */
39 37
@@ -125,8 +123,6 @@ BUFFER_FNS(Async_Write, async_write)
125BUFFER_FNS(Delay, delay) 123BUFFER_FNS(Delay, delay)
126BUFFER_FNS(Boundary, boundary) 124BUFFER_FNS(Boundary, boundary)
127BUFFER_FNS(Write_EIO, write_io_error) 125BUFFER_FNS(Write_EIO, write_io_error)
128BUFFER_FNS(Ordered, ordered)
129BUFFER_FNS(Eopnotsupp, eopnotsupp)
130BUFFER_FNS(Unwritten, unwritten) 126BUFFER_FNS(Unwritten, unwritten)
131 127
132#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) 128#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
@@ -183,6 +179,8 @@ void unlock_buffer(struct buffer_head *bh);
183void __lock_buffer(struct buffer_head *bh); 179void __lock_buffer(struct buffer_head *bh);
184void ll_rw_block(int, int, struct buffer_head * bh[]); 180void ll_rw_block(int, int, struct buffer_head * bh[]);
185int sync_dirty_buffer(struct buffer_head *bh); 181int sync_dirty_buffer(struct buffer_head *bh);
182int __sync_dirty_buffer(struct buffer_head *bh, int rw);
183void write_dirty_buffer(struct buffer_head *bh, int rw);
186int submit_bh(int, struct buffer_head *); 184int submit_bh(int, struct buffer_head *);
187void write_boundary_block(struct block_device *bdev, 185void write_boundary_block(struct block_device *bdev,
188 sector_t bblock, unsigned blocksize); 186 sector_t bblock, unsigned blocksize);
@@ -203,9 +201,10 @@ int block_write_full_page_endio(struct page *page, get_block_t *get_block,
203int block_read_full_page(struct page*, get_block_t*); 201int block_read_full_page(struct page*, get_block_t*);
204int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, 202int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc,
205 unsigned long from); 203 unsigned long from);
206int block_write_begin(struct file *, struct address_space *, 204int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
207 loff_t, unsigned, unsigned, 205 unsigned flags, struct page **pagep, get_block_t *get_block);
208 struct page **, void **, get_block_t*); 206int __block_write_begin(struct page *page, loff_t pos, unsigned len,
207 get_block_t *get_block);
209int block_write_end(struct file *, struct address_space *, 208int block_write_end(struct file *, struct address_space *,
210 loff_t, unsigned, unsigned, 209 loff_t, unsigned, unsigned,
211 struct page *, void *); 210 struct page *, void *);
@@ -213,7 +212,6 @@ int generic_write_end(struct file *, struct address_space *,
213 loff_t, unsigned, unsigned, 212 loff_t, unsigned, unsigned,
214 struct page *, void *); 213 struct page *, void *);
215void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); 214void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
216int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
217int cont_write_begin(struct file *, struct address_space *, loff_t, 215int cont_write_begin(struct file *, struct address_space *, loff_t,
218 unsigned, unsigned, struct page **, void **, 216 unsigned, unsigned, struct page **, void **,
219 get_block_t *, loff_t *); 217 get_block_t *, loff_t *);
@@ -224,9 +222,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
224void block_sync_page(struct page *); 222void block_sync_page(struct page *);
225sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 223sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
226int block_truncate_page(struct address_space *, loff_t, get_block_t *); 224int block_truncate_page(struct address_space *, loff_t, get_block_t *);
227int file_fsync(struct file *, struct dentry *, int); 225int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned,
228int nobh_write_begin(struct file *, struct address_space *,
229 loff_t, unsigned, unsigned,
230 struct page **, void **, get_block_t*); 226 struct page **, void **, get_block_t*);
231int nobh_write_end(struct file *, struct address_space *, 227int nobh_write_end(struct file *, struct address_space *,
232 loff_t, unsigned, unsigned, 228 loff_t, unsigned, unsigned,
@@ -305,15 +301,10 @@ map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block)
305 bh->b_size = sb->s_blocksize; 301 bh->b_size = sb->s_blocksize;
306} 302}
307 303
308/*
309 * Calling wait_on_buffer() for a zero-ref buffer is illegal, so we call into
310 * __wait_on_buffer() just to trip a debug check. Because debug code in inline
311 * functions is bloaty.
312 */
313static inline void wait_on_buffer(struct buffer_head *bh) 304static inline void wait_on_buffer(struct buffer_head *bh)
314{ 305{
315 might_sleep(); 306 might_sleep();
316 if (buffer_locked(bh) || atomic_read(&bh->b_count) == 0) 307 if (buffer_locked(bh))
317 __wait_on_buffer(bh); 308 __wait_on_buffer(bh);
318} 309}
319 310