mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
block: read i_size with i_size_read()
Convert direct reads of an inode's i_size to using i_size_read().
i_size_{read,write} use a seqcount to protect reads from accessing
incomple writes. Concurrent i_size_write()s require mutual exclussion
to protect the seqcount that is used by i_size_{read,write}. But
i_size_read() callers do not need to use additional locking.
Signed-off-by: Mike Snitzer <[email protected]>
Acked-by: NeilBrown <[email protected]>
Acked-by: Lars Ellenberg <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
90fdb0b98a
commit
77304d2aba
5 changed files with 18 additions and 18 deletions
|
|
@ -1874,7 +1874,7 @@ static inline sector_t drbd_md_last_sector(struct drbd_backing_dev *bdev)
|
|||
static inline sector_t drbd_get_capacity(struct block_device *bdev)
|
||||
{
|
||||
/* return bdev ? get_capacity(bdev->bd_disk) : 0; */
|
||||
return bdev ? bdev->bd_inode->i_size >> 9 : 0;
|
||||
return bdev ? i_size_read(bdev->bd_inode) >> 9 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue