diff options
Diffstat (limited to 'include/linux/buffer_head.h')
| -rw-r--r-- | include/linux/buffer_head.h | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 4fc6bab55825..a94644322d86 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -164,7 +164,7 @@ struct buffer_head *__find_get_block(struct block_device *, sector_t, int); struct buffer_head * __getblk(struct block_device *, sector_t, int); void __brelse(struct buffer_head *); void __bforget(struct buffer_head *); -struct buffer_head * __bread(struct block_device *, int, int); +struct buffer_head *__bread(struct block_device *, sector_t block, int size); void wakeup_bdflush(void); struct buffer_head *alloc_buffer_head(void); void free_buffer_head(struct buffer_head * bh); @@ -201,9 +201,9 @@ int generic_osync_inode(struct inode *, int); * inline definitions */ -static inline void get_bh(struct buffer_head * bh) +static inline void get_bh(struct buffer_head *bh) { - atomic_inc(&(bh)->b_count); + atomic_inc(&bh->b_count); } static inline void put_bh(struct buffer_head *bh) @@ -212,68 +212,49 @@ static inline void put_bh(struct buffer_head *bh) atomic_dec(&bh->b_count); } -/* - * If an error happens during the make_request, this function - * has to be recalled. It marks the buffer as clean and not - * uptodate, and it notifys the upper layer about the end - * of the I/O. - */ -static inline void buffer_IO_error(struct buffer_head * bh) -{ - clear_buffer_dirty(bh); - - /* - * b_end_io has to clear the BH_Uptodate bitflag in the read error - * case, however buffer contents are not necessarily bad if a - * write fails - */ - bh->b_end_io(bh, buffer_uptodate(bh)); -} - - -static inline void brelse(struct buffer_head *buf) +static inline void brelse(struct buffer_head *bh) { - if (buf) - __brelse(buf); + if (bh) + __brelse(bh); } -static inline void bforget(struct buffer_head *buf) +static inline void bforget(struct buffer_head *bh) { - if (buf) - __bforget(buf); + if (bh) + __bforget(bh); } -static inline struct buffer_head * sb_bread(struct super_block *sb, int block) +static inline struct buffer_head *sb_bread(struct super_block *sb, sector_t block) { return __bread(sb->s_bdev, block, sb->s_blocksize); } -static inline struct buffer_head * sb_getblk(struct super_block *sb, int block) +static inline struct buffer_head *sb_getblk(struct super_block *sb, sector_t block) { return __getblk(sb->s_bdev, block, sb->s_blocksize); } static inline struct buffer_head * -sb_find_get_block(struct super_block *sb, int block) +sb_find_get_block(struct super_block *sb, sector_t block) { return __find_get_block(sb->s_bdev, block, sb->s_blocksize); } static inline void -map_bh(struct buffer_head *bh, struct super_block *sb, int block) +map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) { set_buffer_mapped(bh); bh->b_bdev = sb->s_bdev; bh->b_blocknr = block; } -static inline void wait_on_buffer(struct buffer_head * bh) +static inline void wait_on_buffer(struct buffer_head *bh) { if (buffer_locked(bh)) __wait_on_buffer(bh); } -static inline void lock_buffer(struct buffer_head * bh) +static inline void lock_buffer(struct buffer_head *bh) { while (test_set_buffer_locked(bh)) __wait_on_buffer(bh); |
