Lines Matching refs:bh
48 typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
82 static inline void set_buffer_##name(struct buffer_head *bh) \
84 set_bit(BH_##bit, &(bh)->b_state); \
86 static inline void clear_buffer_##name(struct buffer_head *bh) \
88 clear_bit(BH_##bit, &(bh)->b_state); \
90 static inline int buffer_##name(const struct buffer_head *bh) \
92 return test_bit(BH_##bit, &(bh)->b_state); \
99 static inline int test_set_buffer_##name(struct buffer_head *bh) \
101 return test_and_set_bit(BH_##bit, &(bh)->b_state); \
103 static inline int test_clear_buffer_##name(struct buffer_head *bh) \
105 return test_and_clear_bit(BH_##bit, &(bh)->b_state); \
128 #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) argument
129 #define touch_buffer(bh) mark_page_accessed(bh->b_page) argument
143 void mark_buffer_dirty(struct buffer_head *bh);
145 void set_bh_page(struct buffer_head *bh,
152 void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
153 void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
154 void end_buffer_async_write(struct buffer_head *bh, int uptodate);
157 void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
164 void mark_buffer_async_write(struct buffer_head *bh);
166 wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
177 void free_buffer_head(struct buffer_head * bh);
178 void unlock_buffer(struct buffer_head *bh);
179 void __lock_buffer(struct buffer_head *bh);
180 void ll_rw_block(int, int, struct buffer_head * bh[]);
181 int sync_dirty_buffer(struct buffer_head *bh);
182 int __sync_dirty_buffer(struct buffer_head *bh, int rw);
183 void write_dirty_buffer(struct buffer_head *bh, int rw);
187 int bh_uptodate_or_lock(struct buffer_head *bh);
188 int bh_submit_read(struct buffer_head *bh);
263 static inline void get_bh(struct buffer_head *bh) in get_bh() argument
265 atomic_inc(&bh->b_count); in get_bh()
268 static inline void put_bh(struct buffer_head *bh) in put_bh() argument
271 atomic_dec(&bh->b_count); in put_bh()
274 static inline void brelse(struct buffer_head *bh) in brelse() argument
276 if (bh) in brelse()
277 __brelse(bh); in brelse()
280 static inline void bforget(struct buffer_head *bh) in bforget() argument
282 if (bh) in bforget()
283 __bforget(bh); in bforget()
311 map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) in map_bh() argument
313 set_buffer_mapped(bh); in map_bh()
314 bh->b_bdev = sb->s_bdev; in map_bh()
315 bh->b_blocknr = block; in map_bh()
316 bh->b_size = sb->s_blocksize; in map_bh()
319 static inline void wait_on_buffer(struct buffer_head *bh) in wait_on_buffer() argument
322 if (buffer_locked(bh)) in wait_on_buffer()
323 __wait_on_buffer(bh); in wait_on_buffer()
326 static inline int trylock_buffer(struct buffer_head *bh) in trylock_buffer() argument
328 return likely(!test_and_set_bit_lock(BH_Lock, &bh->b_state)); in trylock_buffer()
331 static inline void lock_buffer(struct buffer_head *bh) in lock_buffer() argument
334 if (!trylock_buffer(bh)) in lock_buffer()
335 __lock_buffer(bh); in lock_buffer()