aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-exception-store.h2
-rw-r--r--drivers/md/dm-log.c2
-rw-r--r--drivers/md/dm-table.c3
3 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
index c92701dc5001..2442c8c07898 100644
--- a/drivers/md/dm-exception-store.h
+++ b/drivers/md/dm-exception-store.h
@@ -156,7 +156,7 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e)
156 */ 156 */
157static inline sector_t get_dev_size(struct block_device *bdev) 157static inline sector_t get_dev_size(struct block_device *bdev)
158{ 158{
159 return bdev->bd_inode->i_size >> SECTOR_SHIFT; 159 return i_size_read(bdev->bd_inode) >> SECTOR_SHIFT;
160} 160}
161 161
162static inline chunk_t sector_to_chunk(struct dm_exception_store *store, 162static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 6fa8ccf91c70..6352a9ad4446 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -416,7 +416,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
416 bitset_size, 416 bitset_size,
417 ti->limits.logical_block_size); 417 ti->limits.logical_block_size);
418 418
419 if (buf_size > dev->bdev->bd_inode->i_size) { 419 if (buf_size > i_size_read(dev->bdev->bd_inode)) {
420 DMWARN("log device %s too small: need %llu bytes", 420 DMWARN("log device %s too small: need %llu bytes",
421 dev->name, (unsigned long long)buf_size); 421 dev->name, (unsigned long long)buf_size);
422 kfree(lc); 422 kfree(lc);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index e9a73bb242b0..0e2210c0c168 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -388,7 +388,8 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md)
388static int check_device_area(struct dm_dev_internal *dd, sector_t start, 388static int check_device_area(struct dm_dev_internal *dd, sector_t start,
389 sector_t len) 389 sector_t len)
390{ 390{
391 sector_t dev_size = dd->dm_dev.bdev->bd_inode->i_size >> SECTOR_SHIFT; 391 sector_t dev_size = i_size_read(dd->dm_dev.bdev->bd_inode) >>
392 SECTOR_SHIFT;
392 393
393 if (!dev_size) 394 if (!dev_size)
394 return 1; 395 return 1;