diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-14 13:46:09 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-30 16:53:24 +0200 |
commit | 3e503822c7379ffc1a1c60aed57eb81954451faa (patch) | |
tree | 49e4f7dd370954b7920606afdd82282f6e79e698 /fs/fs.c | |
parent | e71c34366808bbe3ce0b166d8710749513af6d81 (diff) | |
download | barebox-3e503822c7379ffc1a1c60aed57eb81954451faa.tar.gz barebox-3e503822c7379ffc1a1c60aed57eb81954451faa.tar.xz |
use loff_t for file offsets
This is a first step for 64bit file support: Make the file sizes/offsets
64bit.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/fs.c')
-rw-r--r-- | fs/fs.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -692,7 +692,7 @@ int flush(int fd) return ret; } -off_t lseek(int fildes, off_t offset, int whence) +loff_t lseek(int fildes, loff_t offset, int whence) { struct device_d *dev; struct fs_driver_d *fsdrv; @@ -1243,7 +1243,7 @@ static void memcpy_sz(void *_dst, const void *_src, ulong count, ulong rwsize) } } -ssize_t mem_read(struct cdev *cdev, void *buf, size_t count, ulong offset, ulong flags) +ssize_t mem_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulong flags) { ulong size; struct device_d *dev; @@ -1252,13 +1252,13 @@ ssize_t mem_read(struct cdev *cdev, void *buf, size_t count, ulong offset, ulong return -1; dev = cdev->dev; - size = min((ulong)count, dev->resource[0].size - offset); + size = min((loff_t)count, dev->resource[0].size - offset); memcpy_sz(buf, dev_get_mem_region(dev, 0) + offset, size, flags & O_RWSIZE_MASK); return size; } EXPORT_SYMBOL(mem_read); -ssize_t mem_write(struct cdev *cdev, const void *buf, size_t count, ulong offset, ulong flags) +ssize_t mem_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags) { ulong size; struct device_d *dev; @@ -1267,7 +1267,7 @@ ssize_t mem_write(struct cdev *cdev, const void *buf, size_t count, ulong offset return -1; dev = cdev->dev; - size = min((ulong)count, dev->resource[0].size - offset); + size = min((loff_t)count, dev->resource[0].size - offset); memcpy_sz(dev_get_mem_region(dev, 0) + offset, buf, size, flags & O_RWSIZE_MASK); return size; } |