summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-10-14 13:46:09 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-06-30 16:53:24 +0200
commit3e503822c7379ffc1a1c60aed57eb81954451faa (patch)
tree49e4f7dd370954b7920606afdd82282f6e79e698 /include
parente71c34366808bbe3ce0b166d8710749513af6d81 (diff)
downloadbarebox-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 'include')
-rw-r--r--include/driver.h16
-rw-r--r--include/fs.h12
2 files changed, 14 insertions, 14 deletions
diff --git a/include/driver.h b/include/driver.h
index 09dd1e45c..4a8d48a87 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -301,8 +301,8 @@ struct cdev;
int dev_protect(struct device_d *dev, size_t count, unsigned long offset, int prot);
/* These are used by drivers which work with direct memory accesses */
-ssize_t mem_read(struct cdev *cdev, void *buf, size_t count, ulong offset, ulong flags);
-ssize_t mem_write(struct cdev *cdev, const 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);
+ssize_t mem_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags);
int mem_memmap(struct cdev *cdev, void **map, int flags);
/* Use this if you have nothing to do in your drivers probe function */
@@ -316,7 +316,7 @@ void devices_shutdown(void);
int generic_memmap_ro(struct cdev *dev, void **map, int flags);
int generic_memmap_rw(struct cdev *dev, void **map, int flags);
-static inline off_t dev_lseek_default(struct cdev *cdev, off_t ofs)
+static inline loff_t dev_lseek_default(struct cdev *cdev, loff_t ofs)
{
return ofs;
}
@@ -373,18 +373,18 @@ extern struct bus_type platform_bus;
struct file_operations {
/*! Called in response of reading from this device. Required */
- ssize_t (*read)(struct cdev*, void* buf, size_t count, ulong offset, ulong flags);
+ ssize_t (*read)(struct cdev*, void* buf, size_t count, loff_t offset, ulong flags);
/*! Called in response of write to this device. Required */
- ssize_t (*write)(struct cdev*, const void* buf, size_t count, ulong offset, ulong flags);
+ ssize_t (*write)(struct cdev*, const void* buf, size_t count, loff_t offset, ulong flags);
int (*ioctl)(struct cdev*, int, void *);
- off_t (*lseek)(struct cdev*, off_t);
+ loff_t (*lseek)(struct cdev*, loff_t);
int (*open)(struct cdev*, unsigned long flags);
int (*close)(struct cdev*);
int (*flush)(struct cdev*);
- int (*erase)(struct cdev*, size_t count, unsigned long offset);
- int (*protect)(struct cdev*, size_t count, unsigned long offset, int prot);
+ int (*erase)(struct cdev*, size_t count, loff_t offset);
+ int (*protect)(struct cdev*, size_t count, loff_t offset, int prot);
int (*memmap)(struct cdev*, void **map, int flags);
};
diff --git a/include/fs.h b/include/fs.h
index d82f02626..2b1023e45 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -23,8 +23,8 @@ typedef struct dir {
typedef struct filep {
struct device_d *dev; /* The device this FILE belongs to */
- ulong pos; /* current position in stream */
- ulong size; /* The size of this inode */
+ loff_t pos; /* current position in stream */
+ loff_t size; /* The size of this inode */
ulong flags; /* the O_* flags from open */
void *inode; /* private to the filesystem driver */
@@ -54,7 +54,7 @@ struct fs_driver_d {
int (*read)(struct device_d *dev, FILE *f, void *buf, size_t size);
int (*write)(struct device_d *dev, FILE *f, const void *buf, size_t size);
int (*flush)(struct device_d *dev, FILE *f);
- off_t (*lseek)(struct device_d *dev, FILE *f, off_t pos);
+ loff_t (*lseek)(struct device_d *dev, FILE *f, loff_t pos);
struct dir* (*opendir)(struct device_d *dev, const char *pathname);
struct dirent* (*readdir)(struct device_d *dev, struct dir *dir);
@@ -63,9 +63,9 @@ struct fs_driver_d {
int (*ioctl)(struct device_d *dev, FILE *f, int request, void *buf);
int (*erase)(struct device_d *dev, FILE *f, size_t count,
- unsigned long offset);
+ loff_t offset);
int (*protect)(struct device_d *dev, FILE *f, size_t count,
- unsigned long offset, int prot);
+ loff_t offset, int prot);
int (*memmap)(struct device_d *dev, FILE *f, void **map, int flags);
@@ -109,7 +109,7 @@ ssize_t write(int fd, const void *buf, size_t count);
#define SEEK_CUR 2
#define SEEK_END 3
-off_t lseek(int fildes, off_t offset, int whence);
+loff_t lseek(int fildes, loff_t offset, int whence);
int mkdir (const char *pathname, mode_t mode);
/* Create a directory and its parents */