diff options
Diffstat (limited to 'block/ioctl.c')
-rw-r--r-- | block/ioctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index d724ceb1d465..38aa194f63ec 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
@@ -125,7 +125,7 @@ static int blk_ioctl_discard(struct block_device *bdev, uint64_t start, | |||
125 | start >>= 9; | 125 | start >>= 9; |
126 | len >>= 9; | 126 | len >>= 9; |
127 | 127 | ||
128 | if (start + len > (bdev->bd_inode->i_size >> 9)) | 128 | if (start + len > (i_size_read(bdev->bd_inode) >> 9)) |
129 | return -EINVAL; | 129 | return -EINVAL; |
130 | if (secure) | 130 | if (secure) |
131 | flags |= BLKDEV_DISCARD_SECURE; | 131 | flags |= BLKDEV_DISCARD_SECURE; |
@@ -307,12 +307,12 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, | |||
307 | ret = blkdev_reread_part(bdev); | 307 | ret = blkdev_reread_part(bdev); |
308 | break; | 308 | break; |
309 | case BLKGETSIZE: | 309 | case BLKGETSIZE: |
310 | size = bdev->bd_inode->i_size; | 310 | size = i_size_read(bdev->bd_inode); |
311 | if ((size >> 9) > ~0UL) | 311 | if ((size >> 9) > ~0UL) |
312 | return -EFBIG; | 312 | return -EFBIG; |
313 | return put_ulong(arg, size >> 9); | 313 | return put_ulong(arg, size >> 9); |
314 | case BLKGETSIZE64: | 314 | case BLKGETSIZE64: |
315 | return put_u64(arg, bdev->bd_inode->i_size); | 315 | return put_u64(arg, i_size_read(bdev->bd_inode)); |
316 | case BLKTRACESTART: | 316 | case BLKTRACESTART: |
317 | case BLKTRACESTOP: | 317 | case BLKTRACESTOP: |
318 | case BLKTRACESETUP: | 318 | case BLKTRACESETUP: |