[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1467284524-15676-5-git-send-email-pranjas@gmail.com>
Date: Thu, 30 Jun 2016 14:02:04 +0300
From: "Pranay Kr. Srivastava" <pranjas@...il.com>
To: mpa@...gutronix.de, nbd-general@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Cc: "Pranay Kr. Srivastava" <pranjas@...il.com>
Subject: [PATCH v4 4/5]nbd: use i_size_write to assign nbd device size
Signed-off-by: Pranay Kr. Srivastava <pranjas@...il.com>
---
drivers/block/nbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index fb56dd2..7126878 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -128,7 +128,7 @@ static const char *nbdcmd_to_ascii(int cmd)
static int nbd_size_clear(struct nbd_device *nbd, struct block_device *bdev)
{
- bdev->bd_inode->i_size = 0;
+ i_size_write(bdev->bd_inode, 0);
set_capacity(nbd->disk, 0);
kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
@@ -140,7 +140,7 @@ static void nbd_size_update(struct nbd_device *nbd, struct block_device *bdev)
if (!nbd_is_connected(nbd))
return;
- bdev->bd_inode->i_size = nbd->bytesize;
+ i_size_write(bdev->bd_inode, nbd->bytesize);
set_capacity(nbd->disk, nbd->bytesize >> 9);
kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
}
@@ -682,7 +682,7 @@ static void nbd_reset(struct nbd_device *nbd)
static void nbd_bdev_reset(struct block_device *bdev)
{
set_device_ro(bdev, false);
- bdev->bd_inode->i_size = 0;
+ i_size_write(bdev->bd_inode, 0);
if (max_part > 0) {
blkdev_reread_part(bdev);
bdev->bd_invalidated = 1;
--
1.9.1
Powered by blists - more mailing lists