summaryrefslogtreecommitdiffstats
path: root/include/fs.h
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 /include/fs.h
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 'include/fs.h')
-rw-r--r--include/fs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/fs.h b/include/fs.h
index 23156eadae..9f4164ed77 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -70,7 +70,7 @@ struct fs_driver_d {
int (*stat)(struct device_d *dev, const char *file, struct stat *stat);
int (*ioctl)(struct device_d *dev, FILE *f, int request, void *buf);
- int (*erase)(struct device_d *dev, FILE *f, size_t count,
+ int (*erase)(struct device_d *dev, FILE *f, loff_t count,
loff_t offset);
int (*protect)(struct device_d *dev, FILE *f, size_t count,
loff_t offset, int prot);
@@ -145,7 +145,7 @@ int mount (const char *device, const char *fsname, const char *path,
int umount(const char *pathname);
/* not-so-standard functions */
-int erase(int fd, size_t count, loff_t offset);
+int erase(int fd, loff_t count, loff_t offset);
int protect(int fd, size_t count, loff_t offset, int prot);
int protect_file(const char *file, int prot);
void *memmap(int fd, int flags);