Lines Matching refs:bh
52 typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
86 static __always_inline void set_buffer_##name(struct buffer_head *bh) \
88 set_bit(BH_##bit, &(bh)->b_state); \
90 static __always_inline void clear_buffer_##name(struct buffer_head *bh) \
92 clear_bit(BH_##bit, &(bh)->b_state); \
94 static __always_inline int buffer_##name(const struct buffer_head *bh) \
96 return test_bit(BH_##bit, &(bh)->b_state); \
103 static __always_inline int test_set_buffer_##name(struct buffer_head *bh) \
105 return test_and_set_bit(BH_##bit, &(bh)->b_state); \
107 static __always_inline int test_clear_buffer_##name(struct buffer_head *bh) \
109 return test_and_clear_bit(BH_##bit, &(bh)->b_state); \
135 #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) argument
152 void mark_buffer_dirty(struct buffer_head *bh);
153 void mark_buffer_write_io_error(struct buffer_head *bh);
155 void touch_buffer(struct buffer_head *bh);
156 void set_bh_page(struct buffer_head *bh,
163 void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
164 void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
165 void end_buffer_async_write(struct buffer_head *bh, int uptodate);
168 void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
175 static inline void clean_bdev_bh_alias(struct buffer_head *bh) in clean_bdev_bh_alias() argument
177 clean_bdev_aliases(bh->b_bdev, bh->b_blocknr, 1); in clean_bdev_bh_alias()
180 void mark_buffer_async_write(struct buffer_head *bh);
182 wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
194 void free_buffer_head(struct buffer_head * bh);
195 void unlock_buffer(struct buffer_head *bh);
196 void __lock_buffer(struct buffer_head *bh);
197 void ll_rw_block(int, int, int, struct buffer_head * bh[]);
198 int sync_dirty_buffer(struct buffer_head *bh);
199 int __sync_dirty_buffer(struct buffer_head *bh, int op_flags);
200 void write_dirty_buffer(struct buffer_head *bh, int op_flags);
204 int bh_uptodate_or_lock(struct buffer_head *bh);
205 int bh_submit_read(struct buffer_head *bh);
281 static inline void get_bh(struct buffer_head *bh) in get_bh() argument
283 atomic_inc(&bh->b_count); in get_bh()
286 static inline void put_bh(struct buffer_head *bh) in put_bh() argument
289 atomic_dec(&bh->b_count); in put_bh()
292 static inline void brelse(struct buffer_head *bh) in brelse() argument
294 if (bh) in brelse()
295 __brelse(bh); in brelse()
298 static inline void bforget(struct buffer_head *bh) in bforget() argument
300 if (bh) in bforget()
301 __bforget(bh); in bforget()
342 map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) in map_bh() argument
344 set_buffer_mapped(bh); in map_bh()
345 bh->b_bdev = sb->s_bdev; in map_bh()
346 bh->b_blocknr = block; in map_bh()
347 bh->b_size = sb->s_blocksize; in map_bh()
350 static inline void wait_on_buffer(struct buffer_head *bh) in wait_on_buffer() argument
353 if (buffer_locked(bh)) in wait_on_buffer()
354 __wait_on_buffer(bh); in wait_on_buffer()
357 static inline int trylock_buffer(struct buffer_head *bh) in trylock_buffer() argument
359 return likely(!test_and_set_bit_lock(BH_Lock, &bh->b_state)); in trylock_buffer()
362 static inline void lock_buffer(struct buffer_head *bh) in lock_buffer() argument
365 if (!trylock_buffer(bh)) in lock_buffer()
366 __lock_buffer(bh); in lock_buffer()