If you use these patches, then declarations of block_read and
block_write in include/linux/fs.h also have to be adjusted
accordingly.
Michal
michal@ellpspace.math.ualberta.ca
--- block_dev.c.intel Wed Apr 9 19:50:25 1997
+++ block_dev.c Wed Apr 9 20:35:08 1997
@@ -20,16 +20,16 @@
#define MAX_BUF_PER_PAGE (PAGE_SIZE / 512)
#define NBUF 64
-int block_write(struct inode * inode, struct file * filp,
- const char * buf, int count)
+long block_write(struct inode * inode, struct file * filp,
+ const char * buf, unsigned long count)
{
int blocksize, blocksize_bits, i, buffercount,write_error;
- int block, blocks;
+ long block, blocks;
loff_t offset;
- int chars;
- int written = 0;
+ long chars;
+ long written = 0;
struct buffer_head * bhlist[NBUF];
- unsigned int size;
+ unsigned long size;
kdev_t dev;
struct buffer_head * bh, *bufferlist[NBUF];
register char * p;
@@ -145,22 +145,22 @@
return written;
}
-int block_read(struct inode * inode, struct file * filp,
- char * buf, int count)
+long block_read(struct inode * inode, struct file * filp,
+ char * buf, unsigned long count)
{
unsigned int block;
loff_t offset;
int blocksize;
int blocksize_bits, i;
- unsigned int blocks, rblocks, left;
+ unsigned long blocks, rblocks, left;
int bhrequest, uptodate;
struct buffer_head ** bhb, ** bhe;
struct buffer_head * buflist[NBUF];
struct buffer_head * bhreq[NBUF];
- unsigned int chars;
+ unsigned long chars;
loff_t size;
kdev_t dev;
- int read;
+ long read;
dev = inode->i_rdev;
blocksize = BLOCK_SIZE;
@@ -182,13 +182,13 @@
if (offset > size)
left = 0;
/* size - offset might not fit into left, so check explicitly. */
- else if (size - offset > INT_MAX)
- left = INT_MAX;
+ else if (size - offset > LONG_MAX)
+ left = LONG_MAX;
else
left = size - offset;
if (left > count)
left = count;
- if (left <= 0)
+ if (!left)
return 0;
read = 0;
block = offset >> blocksize_bits;