From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199704100405.WAA16931@ellpspace.math.ualberta.ca> Date: Wed, 9 Apr 1997 22:05:21 -0600 (MDT) From: Michal Jaegermann Subject: Re: 2.0.30 on the alpha? In-Reply-To: <199704100012.UAA12204@alef.bogon.nul> > > I've applied axp-diffs-2.0.21 as well as em86-patch and traparg-patch-2.0 to > support em86 (works fine w/ 2.0.29) and the compile bails at: > > gcc -D__KERNEL__ -I/usr/src/linux-2.0.30/include -Wall -Wstrict-prototypes -g > -O2 -pipe -mno-fp-regs -c -o block_dev.o block_dev.c > block_dev.c:25: conflicting types for `block_write' ..... Sigh, recent changes in block_dev.c indeed do not take into account changes on Alpha. You likely patched first Intel sources to 2.0.30 and applied axp-diffs-2.0.21 on the top, right? Otherwise you would get rejects from 'patch'. Here are patches to block_dev.c (2.0.29, Alpha version) which mimic changes on Intel side and maintain compatibility with axp-diffs. If you are patching 2.0.29-Alpha you will be left with block_dev.c.orig after an incomplete patch. Apply these diffs to THIS file and use results as block_dev.c Michal --- block_dev.c.orig Sat Dec 21 17:58:45 1996 +++ block_dev.c Wed Apr 9 20:35:08 1997 @@ -20,21 +20,19 @@ #define MAX_BUF_PER_PAGE (PAGE_SIZE / 512) #define NBUF 64 -long block_write(struct inode * inode, struct file * filp, const char * buf, unsigned long count) +long block_write(struct inode * inode, struct file * filp, + const char * buf, unsigned long count) { - int blocksize, blocksize_bits, i, j, buffercount,write_error; + int blocksize, blocksize_bits, i, buffercount,write_error; long block, blocks; loff_t offset; long chars; long written = 0; - int cluster_list[MAX_BUF_PER_PAGE]; struct buffer_head * bhlist[NBUF]; - int blocks_per_cluster; unsigned long size; kdev_t dev; struct buffer_head * bh, *bufferlist[NBUF]; register char * p; - long excess; write_error = buffercount = 0; dev = inode->i_rdev; @@ -51,8 +49,6 @@ i >>= 1; } - blocks_per_cluster = PAGE_SIZE / blocksize; - block = filp->f_pos >> blocksize_bits; offset = filp->f_pos & (blocksize-1); @@ -68,15 +64,14 @@ chars=count; #if 0 - if (chars == blocksize) - bh = getblk(dev, block, blocksize); - else - bh = breada(dev,block,block+1,block+2,-1); - + /* get the buffer head */ + { + struct buffer_head * (*fn)(kdev_t, int, int) = getblk; + if (chars != blocksize) + fn = bread; + bh = fn(dev, block, blocksize); + } #else - for(i=0; i> 9) / 2; if (block + blocks > size) blocks = size - block; if (blocks > NBUF) blocks=NBUF; - excess = (block + blocks) % blocks_per_cluster; - if ( blocks > excess ) - blocks -= excess; bhlist[0] = bh; for(i=1; i= 0) brelse(bhlist[i--]); @@ -157,7 +145,8 @@ return written; } -long block_read(struct inode * inode, struct file * filp, char * buf, unsigned long count) +long block_read(struct inode * inode, struct file * filp, + char * buf, unsigned long count) { unsigned int block; loff_t offset; @@ -165,8 +154,6 @@ int blocksize_bits, i; unsigned long blocks, rblocks, left; int bhrequest, uptodate; - int cluster_list[MAX_BUF_PER_PAGE]; - int blocks_per_cluster; struct buffer_head ** bhb, ** bhe; struct buffer_head * buflist[NBUF]; struct buffer_head * bhreq[NBUF]; @@ -174,7 +161,6 @@ loff_t size; kdev_t dev; long read; - long excess; dev = inode->i_rdev; blocksize = BLOCK_SIZE; @@ -193,8 +179,6 @@ else size = INT_MAX; - blocks_per_cluster = PAGE_SIZE / blocksize; - if (offset > size) left = 0; /* size - offset might not fit into left, so check explicitly. */ @@ -215,9 +199,6 @@ if (filp->f_reada) { if (blocks < read_ahead[MAJOR(dev)] / (blocksize >> 9)) blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9); - excess = (block + blocks) % blocks_per_cluster; - if ( blocks > excess ) - blocks -= excess; if (rblocks > blocks) blocks = rblocks; @@ -240,12 +221,6 @@ uptodate = 1; while (blocks) { --blocks; -#if 1 - if((block % blocks_per_cluster) == 0) { - for(i=0; i