block: Needn't read the size of device or partition again
Subsystems (2)
PATCH 1/1 block: Needn't read the size of device or partition again
It is not necessary to invoke i_size_read to get the size of device or partition again, due to did it before.i_size_read maybe need to abtain lock or disable preempt.
Signed-off-by taco <[email protected]>
--- block/blk-core.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
block/blk-core.c +3 -3
@@ -1423,7 +1423,7 @@ static inline void blk_partition_remap(struct bio *bio) } } -static void handle_bad_sector (struct bio *bio) +static void handle_bad_sector (struct bio *bio,sector_t maxsector) {char b[BDEVNAME_SIZE ];
@@ -1432,7 +1432,7 @@ static void handle_bad_sector(struct bio *bio)bdevname (bio->bi_bdev, b), bio->bi_rw, (unsigned long long )bio->bi_sector +bio_sectors (bio), - (long long)(i_size_read(bio->bi_bdev->bd_inode) >> 9)); + (long long)maxsector);set_bit (BIO_EOF , &bio->bi_flags); }
@@ -1493,7 +1493,7 @@ static inline int bio_check_eod(struct bio *bio, unsigned int nr_sectors)* without checking the size of the device, e.g., when * mounting a device. */ -handle_bad_sector (bio); +handle_bad_sector (bio, maxsector);return 1 ; } }
Signature · 1 line
1.7.5.4