aboutsummaryrefslogtreecommitdiffstats
path: root/block/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/ioctl.c')
-rw-r--r--block/ioctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index d724ceb1d465..a9a302eba01e 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -5,7 +5,6 @@
5#include <linux/hdreg.h> 5#include <linux/hdreg.h>
6#include <linux/backing-dev.h> 6#include <linux/backing-dev.h>
7#include <linux/buffer_head.h> 7#include <linux/buffer_head.h>
8#include <linux/smp_lock.h>
9#include <linux/blktrace_api.h> 8#include <linux/blktrace_api.h>
10#include <asm/uaccess.h> 9#include <asm/uaccess.h>
11 10
@@ -125,7 +124,7 @@ static int blk_ioctl_discard(struct block_device *bdev, uint64_t start,
125 start >>= 9; 124 start >>= 9;
126 len >>= 9; 125 len >>= 9;
127 126
128 if (start + len > (bdev->bd_inode->i_size >> 9)) 127 if (start + len > (i_size_read(bdev->bd_inode) >> 9))
129 return -EINVAL; 128 return -EINVAL;
130 if (secure) 129 if (secure)
131 flags |= BLKDEV_DISCARD_SECURE; 130 flags |= BLKDEV_DISCARD_SECURE;
@@ -242,6 +241,7 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
242 * We need to set the startsect first, the driver may 241 * We need to set the startsect first, the driver may
243 * want to override it. 242 * want to override it.
244 */ 243 */
244 memset(&geo, 0, sizeof(geo));
245 geo.start = get_start_sect(bdev); 245 geo.start = get_start_sect(bdev);
246 ret = disk->fops->getgeo(bdev, &geo); 246 ret = disk->fops->getgeo(bdev, &geo);
247 if (ret) 247 if (ret)
@@ -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: