vfs: guard end of device for mpage interface

Add guard_bio_eod() check for mpage code in order to allow us to do IO
even on the odd last sectors of a device, even if the block size is some
multiple of the physical sector size.

Using mpage_readpages() for block device requires this guard check.

Signed-off-by: Akinobu Mita <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Jeff Moyer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Akinobu Mita 2014-10-09 15:26:55 -07:00 • committed by Linus Torvalds
commit 4db96b71e3
3 changed files with 8 additions and 1 deletions

View file

@ -34,6 +34,11 @@ static inline int __sync_blockdev(struct block_device *bdev, int wait)
}
#endif
/*
* buffer.c
*/
extern void guard_bio_eod(int rw, struct bio *bio);
/*
* char_dev.c
*/