summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-02-08 14:23:12 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-02-09 09:32:29 +0100
commit81737c1d436add87e26a22dca9dd750b9655de01 (patch)
treefc85417cd52a3967c970a57ab95352d33baae6e8 /fs
parente0ae56c00864b0c1dc77b34d26c4e59096ad5403 (diff)
downloadbarebox-81737c1d436add87e26a22dca9dd750b9655de01.tar.gz
barebox-81737c1d436add87e26a22dca9dd750b9655de01.tar.xz
mtd: Fix erasing of devices >4GiB
When a device >4GiB is erased, not only the offset can be bigger than 4GiB, but also the size. This happens with the simplest command to erase a device: erase /dev/nand0. Make the size argument a 64bit type to make this work. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/devfs-core.c2
-rw-r--r--fs/devfs.c2
-rw-r--r--fs/fs.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/fs/devfs-core.c b/fs/devfs-core.c
index 88a7e3a1d6..deacaaad3f 100644
--- a/fs/devfs-core.c
+++ b/fs/devfs-core.c
@@ -259,7 +259,7 @@ int cdev_ioctl(struct cdev *cdev, int request, void *buf)
return cdev->ops->ioctl(cdev, request, buf);
}
-int cdev_erase(struct cdev *cdev, size_t count, loff_t offset)
+int cdev_erase(struct cdev *cdev, loff_t count, loff_t offset)
{
if (!cdev->ops->erase)
return -ENOSYS;
diff --git a/fs/devfs.c b/fs/devfs.c
index 0b8d4fd246..6fabcf8ffa 100644
--- a/fs/devfs.c
+++ b/fs/devfs.c
@@ -66,7 +66,7 @@ static loff_t devfs_lseek(struct device_d *_dev, FILE *f, loff_t pos)
return ret - cdev->offset;
}
-static int devfs_erase(struct device_d *_dev, FILE *f, size_t count, loff_t offset)
+static int devfs_erase(struct device_d *_dev, FILE *f, loff_t count, loff_t offset)
{
struct cdev *cdev = f->priv;
diff --git a/fs/fs.c b/fs/fs.c
index ace72f7d54..c4b3583433 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -924,7 +924,7 @@ out:
}
EXPORT_SYMBOL(lseek);
-int erase(int fd, size_t count, loff_t offset)
+int erase(int fd, loff_t count, loff_t offset)
{
struct fs_driver_d *fsdrv;
FILE *f;