diff options
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r-- | include/linux/buffer_head.h | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 324329ceea1e..73b45225a7ca 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -175,12 +175,13 @@ void __wait_on_buffer(struct buffer_head *); | |||
175 | wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); | 175 | wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); |
176 | struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block, | 176 | struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block, |
177 | unsigned size); | 177 | unsigned size); |
178 | struct buffer_head *__getblk(struct block_device *bdev, sector_t block, | 178 | struct buffer_head *__getblk_gfp(struct block_device *bdev, sector_t block, |
179 | unsigned size); | 179 | unsigned size, gfp_t gfp); |
180 | void __brelse(struct buffer_head *); | 180 | void __brelse(struct buffer_head *); |
181 | void __bforget(struct buffer_head *); | 181 | void __bforget(struct buffer_head *); |
182 | void __breadahead(struct block_device *, sector_t block, unsigned int size); | 182 | void __breadahead(struct block_device *, sector_t block, unsigned int size); |
183 | struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size); | 183 | struct buffer_head *__bread_gfp(struct block_device *, |
184 | sector_t block, unsigned size, gfp_t gfp); | ||
184 | void invalidate_bh_lrus(void); | 185 | void invalidate_bh_lrus(void); |
185 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); | 186 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); |
186 | void free_buffer_head(struct buffer_head * bh); | 187 | void free_buffer_head(struct buffer_head * bh); |
@@ -295,7 +296,13 @@ static inline void bforget(struct buffer_head *bh) | |||
295 | static inline struct buffer_head * | 296 | static inline struct buffer_head * |
296 | sb_bread(struct super_block *sb, sector_t block) | 297 | sb_bread(struct super_block *sb, sector_t block) |
297 | { | 298 | { |
298 | return __bread(sb->s_bdev, block, sb->s_blocksize); | 299 | return __bread_gfp(sb->s_bdev, block, sb->s_blocksize, __GFP_MOVABLE); |
300 | } | ||
301 | |||
302 | static inline struct buffer_head * | ||
303 | sb_bread_unmovable(struct super_block *sb, sector_t block) | ||
304 | { | ||
305 | return __bread_gfp(sb->s_bdev, block, sb->s_blocksize, 0); | ||
299 | } | 306 | } |
300 | 307 | ||
301 | static inline void | 308 | static inline void |
@@ -307,7 +314,7 @@ sb_breadahead(struct super_block *sb, sector_t block) | |||
307 | static inline struct buffer_head * | 314 | static inline struct buffer_head * |
308 | sb_getblk(struct super_block *sb, sector_t block) | 315 | sb_getblk(struct super_block *sb, sector_t block) |
309 | { | 316 | { |
310 | return __getblk(sb->s_bdev, block, sb->s_blocksize); | 317 | return __getblk_gfp(sb->s_bdev, block, sb->s_blocksize, __GFP_MOVABLE); |
311 | } | 318 | } |
312 | 319 | ||
313 | static inline struct buffer_head * | 320 | static inline struct buffer_head * |
@@ -344,6 +351,36 @@ static inline void lock_buffer(struct buffer_head *bh) | |||
344 | __lock_buffer(bh); | 351 | __lock_buffer(bh); |
345 | } | 352 | } |
346 | 353 | ||
354 | static inline struct buffer_head *getblk_unmovable(struct block_device *bdev, | ||
355 | sector_t block, | ||
356 | unsigned size) | ||
357 | { | ||
358 | return __getblk_gfp(bdev, block, size, 0); | ||
359 | } | ||
360 | |||
361 | static inline struct buffer_head *__getblk(struct block_device *bdev, | ||
362 | sector_t block, | ||
363 | unsigned size) | ||
364 | { | ||
365 | return __getblk_gfp(bdev, block, size, __GFP_MOVABLE); | ||
366 | } | ||
367 | |||
368 | /** | ||
369 | * __bread() - reads a specified block and returns the bh | ||
370 | * @bdev: the block_device to read from | ||
371 | * @block: number of block | ||
372 | * @size: size (in bytes) to read | ||
373 | * | ||
374 | * Reads a specified block, and returns buffer head that contains it. | ||
375 | * The page cache is allocated from movable area so that it can be migrated. | ||
376 | * It returns NULL if the block was unreadable. | ||
377 | */ | ||
378 | static inline struct buffer_head * | ||
379 | __bread(struct block_device *bdev, sector_t block, unsigned size) | ||
380 | { | ||
381 | return __bread_gfp(bdev, block, size, __GFP_MOVABLE); | ||
382 | } | ||
383 | |||
347 | extern int __set_page_dirty_buffers(struct page *page); | 384 | extern int __set_page_dirty_buffers(struct page *page); |
348 | 385 | ||
349 | #else /* CONFIG_BLOCK */ | 386 | #else /* CONFIG_BLOCK */ |