Lines Matching refs:bh

49 typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
88 static __always_inline void set_buffer_##name(struct buffer_head *bh) \
90 if (!test_bit(BH_##bit, &(bh)->b_state)) \
91 set_bit(BH_##bit, &(bh)->b_state); \
93 static __always_inline void clear_buffer_##name(struct buffer_head *bh) \
95 clear_bit(BH_##bit, &(bh)->b_state); \
97 static __always_inline int buffer_##name(const struct buffer_head *bh) \
99 return test_bit(BH_##bit, &(bh)->b_state); \
106 static __always_inline int test_set_buffer_##name(struct buffer_head *bh) \
108 return test_and_set_bit(BH_##bit, &(bh)->b_state); \
110 static __always_inline int test_clear_buffer_##name(struct buffer_head *bh) \
112 return test_and_clear_bit(BH_##bit, &(bh)->b_state); \
137 static __always_inline void set_buffer_uptodate(struct buffer_head *bh) in BUFFER_FNS()
147 if (test_bit(BH_Uptodate, &bh->b_state)) in BUFFER_FNS()
155 set_bit(BH_Uptodate, &bh->b_state); in BUFFER_FNS()
158 static __always_inline void clear_buffer_uptodate(struct buffer_head *bh) in clear_buffer_uptodate() argument
160 clear_bit(BH_Uptodate, &bh->b_state); in clear_buffer_uptodate()
163 static __always_inline int buffer_uptodate(const struct buffer_head *bh) in buffer_uptodate() argument
169 return (smp_load_acquire(&bh->b_state) & (1UL << BH_Uptodate)) != 0; in buffer_uptodate()
172 #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) argument
189 void mark_buffer_dirty(struct buffer_head *bh);
190 void mark_buffer_write_io_error(struct buffer_head *bh);
191 void touch_buffer(struct buffer_head *bh);
192 void set_bh_page(struct buffer_head *bh,
199 void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
200 void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
201 void end_buffer_async_write(struct buffer_head *bh, int uptodate);
204 void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
211 static inline void clean_bdev_bh_alias(struct buffer_head *bh) in clean_bdev_bh_alias() argument
213 clean_bdev_aliases(bh->b_bdev, bh->b_blocknr, 1); in clean_bdev_bh_alias()
216 void mark_buffer_async_write(struct buffer_head *bh);
218 wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
234 void free_buffer_head(struct buffer_head * bh);
235 void unlock_buffer(struct buffer_head *bh);
236 void __lock_buffer(struct buffer_head *bh);
237 void ll_rw_block(int, int, int, struct buffer_head * bh[]);
238 int sync_dirty_buffer(struct buffer_head *bh);
239 int __sync_dirty_buffer(struct buffer_head *bh, int op_flags);
240 void write_dirty_buffer(struct buffer_head *bh, int op_flags);
244 int bh_uptodate_or_lock(struct buffer_head *bh);
245 int bh_submit_read(struct buffer_head *bh);
311 static inline void get_bh(struct buffer_head *bh) in get_bh() argument
313 atomic_inc(&bh->b_count); in get_bh()
316 static inline void put_bh(struct buffer_head *bh) in put_bh() argument
319 atomic_dec(&bh->b_count); in put_bh()
322 static inline void brelse(struct buffer_head *bh) in brelse() argument
324 if (bh) in brelse()
325 __brelse(bh); in brelse()
328 static inline void bforget(struct buffer_head *bh) in bforget() argument
330 if (bh) in bforget()
331 __bforget(bh); in bforget()
378 map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) in map_bh() argument
380 set_buffer_mapped(bh); in map_bh()
381 bh->b_bdev = sb->s_bdev; in map_bh()
382 bh->b_blocknr = block; in map_bh()
383 bh->b_size = sb->s_blocksize; in map_bh()
386 static inline void wait_on_buffer(struct buffer_head *bh) in wait_on_buffer() argument
389 if (buffer_locked(bh)) in wait_on_buffer()
390 __wait_on_buffer(bh); in wait_on_buffer()
393 static inline int trylock_buffer(struct buffer_head *bh) in trylock_buffer() argument
395 return likely(!test_and_set_bit_lock(BH_Lock, &bh->b_state)); in trylock_buffer()
398 static inline void lock_buffer(struct buffer_head *bh) in lock_buffer() argument
401 if (!trylock_buffer(bh)) in lock_buffer()
402 __lock_buffer(bh); in lock_buffer()