	These are selected bits out of the 
		lfs-patches-v0.21-base-2.3.27-pre1.diff.A
	file

	This file contains  miscellaneous 64 bit things not
	classified anywhere else.


diff -ur linux-23027p1/fs/affs/file.c linux-23027p1m1/fs/affs/file.c
--- linux-23027p1/fs/affs/file.c	Sun Jun 27 20:10:41 1999
+++ linux-23027p1m1/fs/affs/file.c	Mon Nov  8 22:58:51 1999
@@ -560,7 +560,7 @@
 		sector = affs_bmap(inode,(u32)*ppos / blocksize);
 		if (!sector)
 			break;
-		offset = (u32)*ppos % blocksize;
+		offset = (u32)(*ppos) % blocksize;
 		bh = affs_bread(inode->i_dev,sector,AFFS_I2BSIZE(inode));
 		if (!bh)
 			break;
@@ -580,17 +580,17 @@
 affs_file_write(struct file *filp, const char *buf, size_t count, loff_t *ppos)
 {
 	struct inode		*inode = filp->f_dentry->d_inode;
-	off_t			 pos;
+	loff_t			 pos;
 	ssize_t			 written;
 	ssize_t			 c;
-	ssize_t			 blocksize;
+	ssize_t			 blocksize, blockshift;
 	struct buffer_head	*bh;
 	char			*p;
 
 	if (!count)
 		return 0;
-	pr_debug("AFFS: file_write(ino=%lu,pos=%lu,count=%d)\n",inode->i_ino,
-		 (unsigned long)*ppos,count);
+	pr_debug("AFFS: file_write(ino=%lu,pos=%Lu,count=%d)\n",inode->i_ino,
+		*ppos,count);
 
 	if (!inode) {
 		affs_error(inode->i_sb,"file_write","Inode = NULL");
@@ -609,16 +609,22 @@
 	else
 		pos = *ppos;
 	written   = 0;
-	blocksize = AFFS_I2BSIZE(inode);
+	blocksize = AFFS_I2BSIZE(inode); /* power of two! */
+	blockshift = AFFS_I2BITS(inode);
+
+	if (pos >= 0x7fffffff) /* Max size: 2G-1 */
+		return -EFBIG;
+	if ((pos + count) > 0x7fffffff)
+		count = 0x7fffffff - pos;
 
 	while (written < count) {
-		bh = affs_getblock(inode,pos / blocksize);
+		bh = affs_getblock(inode, pos >> blockshift);
 		if (!bh) {
 			if (!written)
 				written = -ENOSPC;
 			break;
 		}
-		c = blocksize - (pos % blocksize);
+		c = blocksize - (pos & (blocksize -1));
 		if (c > count - written)
 			c = count - written;
 		if (c != blocksize && !buffer_uptodate(bh)) {
@@ -631,7 +637,7 @@
 				break;
 			}
 		}
-		p  = (pos % blocksize) + bh->b_data;
+		p  = (pos & (blocksize -1)) + bh->b_data;
 		c -= copy_from_user(p,buf,c);
 		if (!c) {
 			affs_brelse(bh);
@@ -660,14 +666,15 @@
 {
 	struct inode		*inode = filp->f_dentry->d_inode;
 	off_t			 pos;
+	loff_t			 lpos;
 	ssize_t			 written;
 	ssize_t			 c;
 	ssize_t			 blocksize;
 	struct buffer_head	*bh;
 	char			*p;
 
-	pr_debug("AFFS: file_write_ofs(ino=%lu,pos=%lu,count=%d)\n",inode->i_ino,
-		(unsigned long)*ppos,count);
+	pr_debug("AFFS: file_write_ofs(ino=%lu,pos=%Lu,count=%d)\n",inode->i_ino,
+		*ppos,count);
 
 	if (!count)
 		return 0;
@@ -684,21 +691,25 @@
 	if (!inode->u.affs_i.i_ec && alloc_ext_cache(inode))
 		return -ENOMEM;
 	if (filp->f_flags & O_APPEND)
-		pos = inode->i_size;
+		lpos = inode->i_size;
 	else
-		pos = *ppos;
+		lpos = *ppos;
+
+	if (lpos > 0x7fffffffLL)
+		return -EFBIG;
 
+	pos = lpos;
 	bh        = NULL;
 	blocksize = AFFS_I2BSIZE(inode) - 24;
 	written   = 0;
 	while (written < count) {
-		bh = affs_getblock(inode,pos / blocksize);
+		bh = affs_getblock(inode,(u32)pos / blocksize);
 		if (!bh) {
 			if (!written)
 				written = -ENOSPC;
 			break;
 		}
-		c = blocksize - (pos % blocksize);
+		c = blocksize - ((u32)pos & blocksize);
 		if (c > count - written)
 			c = count - written;
 		if (c != blocksize && !buffer_uptodate(bh)) {
@@ -711,7 +722,7 @@
 				break;
 			}
 		}
-		p  = (pos % blocksize) + bh->b_data + 24;
+		p  = (((u_long)pos) % blocksize) + bh->b_data + 24;
 		c -= copy_from_user(p,buf,c);
 		if (!c) {
 			affs_brelse(bh);
@@ -780,10 +791,13 @@
 	int	 rem;
 	int	 ext;
 
-	pr_debug("AFFS: truncate(inode=%ld,size=%lu)\n",inode->i_ino,inode->i_size);
+	pr_debug("AFFS: truncate(inode=%ld,size=%Lu)\n",inode->i_ino,inode->i_size);
+	if (inode->i_size > 0x7fffffffULL)
+	  /* XXX Fine! No way to indicate an error. */
+	  return /* -EFBIG */;
 
 	net_blocksize = blocksize - ((inode->i_sb->u.affs_sb.s_flags & SF_OFS) ? 24 : 0);
-	first = (inode->i_size + net_blocksize - 1) / net_blocksize;
+	first = (u_long)(inode->i_size + net_blocksize - 1) / net_blocksize;
 	if (inode->u.affs_i.i_lastblock < first - 1) {
 		/* There has to be at least one new block to be allocated */
 		if (!inode->u.affs_i.i_ec && alloc_ext_cache(inode)) {
@@ -795,7 +809,7 @@
 			affs_warning(inode->i_sb,"truncate","Cannot extend file");
 			inode->i_size = net_blocksize * (inode->u.affs_i.i_lastblock + 1);
 		} else if (inode->i_sb->u.affs_sb.s_flags & SF_OFS) {
-			rem = inode->i_size % net_blocksize;
+			rem = ((u_long)inode->i_size) % net_blocksize;
 			DATA_FRONT(bh)->data_size = cpu_to_be32(rem ? rem : net_blocksize);
 			affs_fix_checksum(blocksize,bh->b_data,5);
 			mark_buffer_dirty(bh,0);
@@ -862,7 +876,7 @@
 			affs_free_block(inode->i_sb,ekey);
 		ekey = key;
 	}
-	block = ((inode->i_size + net_blocksize - 1) / net_blocksize) - 1;
+	block = ((u_long)(inode->i_size + net_blocksize - 1) / net_blocksize) - 1;
 	inode->u.affs_i.i_lastblock = block;
 
 	/* If the file is not truncated to a block boundary,
@@ -870,7 +884,7 @@
 	 * so it cannot become accessible again.
 	 */
 
-	rem = inode->i_size % net_blocksize;
+	rem = ((u_long)inode->i_size) % net_blocksize;
 	if (rem) {
 		if ((inode->i_sb->u.affs_sb.s_flags & SF_OFS)) 
 			rem += 24;
diff -ur linux-23027p1/fs/affs/inode.c linux-23027p1m1/fs/affs/inode.c
--- linux-23027p1/fs/affs/inode.c	Mon Mar  8 01:25:23 1999
+++ linux-23027p1m1/fs/affs/inode.c	Mon Nov  8 22:58:51 1999
@@ -146,7 +146,7 @@
 				block = AFFS_I2BSIZE(inode) - 24;
 			else
 				block = AFFS_I2BSIZE(inode);
-			inode->u.affs_i.i_lastblock = ((inode->i_size + block - 1) / block) - 1;
+			inode->u.affs_i.i_lastblock = (((u_long)inode->i_size + block - 1) / block) - 1;
 			break;
 		case ST_SOFTLINK:
 			inode->i_mode |= S_IFLNK;
diff -ur linux-23027p1/fs/dquot.c linux-23027p1m1/fs/dquot.c
--- linux-23027p1/fs/dquot.c	Thu Oct  7 22:47:37 1999
+++ linux-23027p1m1/fs/dquot.c	Mon Nov  8 23:08:46 1999
@@ -513,6 +513,8 @@
 	dquot = find_best_candidate_weighted();
 	if (dquot)
 		goto got_it;
+
+	count = 2; // "count" not initialized above!
 	/*
 	 * Try pruning the dcache to free up some dquots ...
 	 */
@@ -1308,7 +1310,11 @@
 	if (!S_ISREG(inode->i_mode))
 		goto cleanup;
 	error = -EINVAL;
-	if (inode->i_size == 0 || (inode->i_size % sizeof(struct dqblk)) != 0)
+
+	if (inode->i_size == 0 ||
+	    // Following cast isn't necessary in case compiler is egcs-1.1.2,
+	    // but it is needed with gcc-2.7.2.*
+	    ((u_long)inode->i_size % sizeof(struct dqblk)) != 0)
 		goto cleanup;
 
 	/* OK, there we go */
diff -ur linux-23027p1/fs/efs/symlink.c linux-23027p1m1/fs/efs/symlink.c
--- linux-23027p1/fs/efs/symlink.c	Sun Jun 27 20:10:41 1999
+++ linux-23027p1m1/fs/efs/symlink.c	Mon Nov  8 22:58:51 1999
@@ -42,7 +42,7 @@
 	efs_block_t size = in->i_size;
   
 	if (size > 2 * EFS_BLOCKSIZE) {
-		printk(KERN_ERR "EFS: linktarget(): name too long: %lu\n", in->i_size);
+		printk(KERN_ERR "EFS: linktarget(): name too long: %Lu\n", in->i_size);
 		return NULL;
 	}
   
diff -ur linux-23027p1/fs/nfs/proc.c linux-23027p1m1/fs/nfs/proc.c
--- linux-23027p1/fs/nfs/proc.c	Mon Oct 18 21:26:37 1999
+++ linux-23027p1m1/fs/nfs/proc.c	Mon Nov  8 22:58:51 1999
@@ -92,14 +92,14 @@
 
 int
 nfs_proc_read(struct nfs_server *server, struct nfs_fh *fhandle, int swap,
-			  unsigned long offset, unsigned int count,
+			  loff_t offset, unsigned int count,
 			  void *buffer, struct nfs_fattr *fattr)
 {
 	struct nfs_readargs	arg = { fhandle, offset, count, buffer };
 	struct nfs_readres	res = { fattr, count };
 	int			status;
 
-	dprintk("NFS call  read %d @ %ld\n", count, offset);
+	dprintk("NFS call  read %d @ %Ld\n", count, offset);
 	status = rpc_call(server->client, NFSPROC_READ, &arg, &res,
 			swap? NFS_RPC_SWAPFLAGS : 0);
 	dprintk("NFS reply read: %d\n", status);
@@ -108,13 +108,13 @@
 
 int
 nfs_proc_write(struct nfs_server *server, struct nfs_fh *fhandle, int swap,
-			unsigned long offset, unsigned int count,
+			loff_t offset, unsigned int count,
 			const void *buffer, struct nfs_fattr *fattr)
 {
 	struct nfs_writeargs	arg = { fhandle, offset, count, buffer };
 	int			status;
 
-	dprintk("NFS call  write %d @ %ld\n", count, offset);
+	dprintk("NFS call  write %d @ %Ld\n", count, offset);
 	status = rpc_call(server->client, NFSPROC_WRITE, &arg, fattr,
 			swap? (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS) : 0);
 	dprintk("NFS reply read: %d\n", status);
diff -ur linux-23027p1/fs/nfs/read.c linux-23027p1m1/fs/nfs/read.c
--- linux-23027p1/fs/nfs/read.c	Sat Oct 30 02:45:32 1999
+++ linux-23027p1m1/fs/nfs/read.c	Mon Nov  8 22:58:51 1999
@@ -52,7 +52,7 @@
  */
 static inline void
 nfs_readreq_setup(struct nfs_rreq *req, struct nfs_fh *fh,
-		  unsigned long offset, void *buffer, unsigned int rsize)
+		  loff_t offset, void *buffer, unsigned int rsize)
 {
 	req->ra_args.fh     = fh;
 	req->ra_args.offset = offset;
@@ -70,10 +70,10 @@
 nfs_readpage_sync(struct dentry *dentry, struct inode *inode, struct page *page)
 {
 	struct nfs_rreq	rqst;
-	unsigned long	offset = page->index << PAGE_CACHE_SHIFT;
+	loff_t		offset = ((loff_t)page->index) << PAGE_CACHE_SHIFT;
 	char		*buffer = (char *) page_address(page);
 	int		rsize = NFS_SERVER(inode)->rsize;
-	int		result, refresh = 0;
+	int		result = 0, refresh = 0;
 	int		count = PAGE_SIZE;
 	int		flags = IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0;
 
@@ -83,11 +83,24 @@
 		if (count < rsize)
 			rsize = count;
 
-		dprintk("NFS: nfs_proc_read(%s, (%s/%s), %ld, %d, %p)\n",
+		dprintk("NFS: nfs_proc_read(%s, (%s/%s), %Ld, %d, %p)\n",
 			NFS_SERVER(inode)->hostname,
 			dentry->d_parent->d_name.name, dentry->d_name.name,
 			offset, rsize, buffer);
 
+		/* FIXME: NFSv3 could allow 64-bit offsets! ... */
+
+		if (offset > 0x7ffffffeULL) {
+		  if (result)
+		  	break;
+		  result = -EOVERFLOW;
+		  goto io_error;
+		}
+		if ((offset + rsize) > 0x7fffffffULL) /* 2G-1 */
+		  rsize = 0x7fffffffULL - offset;
+
+		/* ... END FIXME! */
+
 		/* Set up arguments and perform rpc call */
 		nfs_readreq_setup(&rqst, NFS_FH(dentry), offset, buffer, rsize);
 		lock_kernel();
@@ -166,8 +179,16 @@
 	unsigned long address = page_address(page);
 	struct nfs_rreq	*req;
 	int		result = -1, flags;
+	loff_t loffset	= ((loff_t)page->index) << PAGE_CACHE_SHIFT;
 
 	dprintk("NFS: nfs_readpage_async(%p)\n", page);
+
+	/* FIXME: NFSv3 allows 64-bit offsets.. */
+	if ((loffset + PAGE_SIZE) >= 0x7fffffffULL) {
+	  dprintk("NFS: Async read beyond 2G-1 marker!\n");
+	  return -EOVERFLOW;
+	}
+
 	if (NFS_CONGESTED(inode))
 		goto out_defer;
 
@@ -179,7 +200,7 @@
 
 	/* Initialize request */
 	/* N.B. Will the dentry remain valid for life of request? */
-	nfs_readreq_setup(req, NFS_FH(dentry), page->index << PAGE_CACHE_SHIFT,
+	nfs_readreq_setup(req, NFS_FH(dentry), loffset,
 				(void *) address, PAGE_SIZE);
 	req->ra_inode = inode;
 	req->ra_page = page; /* count has been incremented by caller */
@@ -224,8 +245,8 @@
 	int		error;
 
 	lock_kernel();
-	dprintk("NFS: nfs_readpage (%p %ld@%lu)\n",
-		page, PAGE_SIZE, page->index);
+	dprintk("NFS: nfs_readpage (%p %ld@%Lu)\n",
+		page, PAGE_SIZE, ((loff_t)page->index) << PAGE_CACHE_SHIFT);
 	get_page(page);
 
 	/*
diff -ur linux-23027p1/fs/nfs/write.c linux-23027p1m1/fs/nfs/write.c
--- linux-23027p1/fs/nfs/write.c	Sat Oct 30 02:45:32 1999
+++ linux-23027p1m1/fs/nfs/write.c	Mon Nov  8 22:58:51 1999
@@ -93,21 +93,39 @@
 	int		result, refresh = 0, written = 0;
 	u8		*buffer;
 	struct nfs_fattr fattr;
+	loff_t		loffset = (((loff_t)page->index) << PAGE_CACHE_SHIFT) + offset;
 
 	lock_kernel();
-	dprintk("NFS:      nfs_writepage_sync(%s/%s %d@%lu/%ld)\n",
+	dprintk("NFS:      nfs_writepage_sync(%s/%s %d@%Lu/%ld)\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name,
-		count, page->index, offset);
+		count, loffset, offset);
 
 	buffer = (u8 *) page_address(page) + offset;
-	offset += page->index << PAGE_CACHE_SHIFT;
+	loffset += offset;
+
+	/* FIXME: NFSv3 !!! */
+#if 1
+	if (loffset >= 0x7ffffffeULL)
+	  return -EFBIG;
+	if ((loffset + count) >= 0x7fffffffULL) {
+	  /* At MOST this much! */
+	  count = 0x7fffffffULL - loffset;
+	}
+#else
+	if (S_ISREG(inode->i_flags) &&
+	    !(dentry->d_file->f_flags & O_LARGEFILE) &&
+	    (!off_t_presentable(loffset) ||
+	     !off_t_presentable(loffset + count))) {
+	  /* Writing beyond LargeFile maximums without O_LARGEFILE */
+	}
+#endif
 
 	do {
 		if (count < wsize && !IS_SWAPFILE(inode))
 			wsize = count;
 
 		result = nfs_proc_write(NFS_DSERVER(dentry), NFS_FH(dentry),
-					IS_SWAPFILE(inode), offset, wsize,
+					IS_SWAPFILE(inode), loffset, wsize,
 					buffer, &fattr);
 
 		if (result < 0) {
@@ -120,15 +138,15 @@
 			wsize, result);
 		refresh = 1;
 		buffer  += wsize;
-		offset  += wsize;
+		loffset += wsize;
 		written += wsize;
 		count   -= wsize;
 		/*
 		 * If we've extended the file, update the inode
 		 * now so we don't invalidate the cache.
 		 */
-		if (offset > inode->i_size)
-			inode->i_size = offset;
+		if (loffset > inode->i_size)
+			inode->i_size = loffset;
 	} while (count);
 
 io_error:
@@ -285,9 +303,9 @@
 	struct nfs_wreq *wreq;
 	struct rpc_task	*task;
 
-	dprintk("NFS:      create_write_request(%s/%s, %ld+%d)\n",
+	dprintk("NFS:      create_write_request(%s/%s, %Ld+%d)\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name,
-		(page->index << PAGE_CACHE_SHIFT) + offset, bytes);
+		(((loff_t)page->index) << PAGE_CACHE_SHIFT) + offset, bytes);
 
 	/* FIXME: Enforce hard limit on number of concurrent writes? */
 	wreq = kmem_cache_alloc(nfs_wreq_cachep, SLAB_KERNEL);
@@ -433,9 +451,9 @@
 	int		synchronous = file->f_flags & O_SYNC;
 	int		retval;
 
-	dprintk("NFS:      nfs_updatepage(%s/%s %d@%ld)\n",
+	dprintk("NFS:      nfs_updatepage(%s/%s %d@%Ld)\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name,
-		count, (page->index << PAGE_CACHE_SHIFT) +offset);
+		count, (((loff_t)page->index) << PAGE_CACHE_SHIFT) +offset);
 
 	/*
 	 * Try to find a corresponding request on the writeback queue.
@@ -620,7 +638,7 @@
 	/* Setup the task struct for a writeback call */
 	req->wb_flags |= NFS_WRITE_INPROGRESS;
 	req->wb_args.fh     = NFS_FH(dentry);
-	req->wb_args.offset = (page->index << PAGE_CACHE_SHIFT) + req->wb_offset;
+	req->wb_args.offset = (((loff_t)page->index) << PAGE_CACHE_SHIFT) + req->wb_offset;
 	req->wb_args.count  = req->wb_bytes;
 	req->wb_args.buffer = (void *) (page_address(page) + req->wb_offset);
 
diff -ur linux-23027p1/fs/nfsd/vfs.c linux-23027p1m1/fs/nfsd/vfs.c
--- linux-23027p1/fs/nfsd/vfs.c	Wed Nov  3 07:36:07 1999
+++ linux-23027p1m1/fs/nfsd/vfs.c	Mon Nov  8 22:58:51 1999
@@ -492,8 +492,9 @@
 
 	/* Write back readahead params */
 	if (ra != NULL) {
-		dprintk("nfsd: raparms %ld %ld %ld %ld %ld\n",
-			file.f_reada, file.f_ramax, file.f_raend,
+		dprintk("nfsd: raparms %d %d %Ld %d %d\n",
+			file.f_reada, file.f_ramax,
+			((loff_t)file.f_raend) << PAGE_CACHE_SHIFT,
 			file.f_ralen, file.f_rawin);
 		ra->p_reada = file.f_reada;
 		ra->p_ramax = file.f_ramax;
diff -ur linux-23027p1/fs/ntfs/super.c linux-23027p1m1/fs/ntfs/super.c
--- linux-23027p1/fs/ntfs/super.c	Mon Apr 12 20:05:58 1999
+++ linux-23027p1m1/fs/ntfs/super.c	Mon Nov  8 22:58:51 1999
@@ -253,7 +253,7 @@
  * Writes the volume size into vol_size. Returns 0 if successful
  * or error.
  */
-int ntfs_get_volumesize(ntfs_volume *vol, long *vol_size )
+int ntfs_get_volumesize(ntfs_volume *vol, ntfs_u64 *vol_size )
 {
 	ntfs_io io;
 	ntfs_u64 size;
@@ -274,9 +274,7 @@
 	ntfs_getput_clusters(vol,0,0,&io);
 	size=NTFS_GETU64(cluster0+0x28);
 	ntfs_free(cluster0);
-	/* FIXME: more than 2**32 cluster */
-	/* FIXME: gcc will emit udivdi3 if we don't truncate it */
-	*vol_size = ((unsigned long)size)/vol->clusterfactor;
+	*vol_size = size;
 	return 0;
 }
 
diff -ur linux-23027p1/fs/ntfs/super.h linux-23027p1m1/fs/ntfs/super.h
--- linux-23027p1/fs/ntfs/super.h	Mon Apr 12 20:05:58 1999
+++ linux-23027p1m1/fs/ntfs/super.h	Mon Nov  8 22:58:51 1999
@@ -10,7 +10,7 @@
 #define ALLOC_REQUIRE_SIZE     2
 
 int ntfs_get_free_cluster_count(ntfs_inode *bitmap);
-int ntfs_get_volumesize(ntfs_volume *vol, long *vol_size );
+int ntfs_get_volumesize(ntfs_volume *vol, ntfs_u64 *vol_size );
 int ntfs_init_volume(ntfs_volume *vol,char *boot);
 int ntfs_load_special_files(ntfs_volume *vol);
 int ntfs_release_volume(ntfs_volume *vol);
diff -ur linux-23027p1/fs/partitions/acorn.c linux-23027p1m1/fs/partitions/acorn.c
--- linux-23027p1/fs/partitions/acorn.c	Thu Sep 30 00:02:59 1999
+++ linux-23027p1m1/fs/partitions/acorn.c	Mon Nov  8 22:58:51 1999
@@ -16,6 +16,8 @@
 
 #include "acorn.h"
 
+extern unsigned int get_ptable_blocksize(kdev_t);
+
 extern void add_gd_partition(struct gendisk *hd, unsigned int minor, unsigned int start, unsigned int size);
 
 static void
diff -ur linux-23027p1/fs/qnx4/file.c linux-23027p1m1/fs/qnx4/file.c
--- linux-23027p1/fs/qnx4/file.c	Sun Jun 27 20:10:41 1999
+++ linux-23027p1m1/fs/qnx4/file.c	Mon Nov  8 22:58:51 1999
@@ -209,13 +237,13 @@
 	struct inode *inode = dentry->d_inode;
 	struct qnx4_inode_info *qnx4_ino = &inode->u.qnx4_i;
 	unsigned long buf;
-	unsigned long offset, avail, readlen;
+	unsigned long offset, avail, readlen; // 4G max size!
 	unsigned long start;
 	unsigned long count;
 	struct buffer_head *bh;
 	int res = -EIO;
 
-	QNX4DEBUG(("qnx4: readpage offset=[%ld]\n", (long) page->offset));
+	QNX4DEBUG(("qnx4: readpage offset=[%Ld]\n", page->index << PAGE_CACHE_SHIFT));
 
 	if (qnx4_ino->i_xblk != 0) {
 		printk("qnx4: sorry, this file is extended, don't know how to handle it (yet) !\n");
@@ -226,7 +254,7 @@
 	buf = page_address(page);
 	clear_bit(PG_uptodate, &page->flags);
 	clear_bit(PG_error, &page->flags);
-	offset = page->offset;
+	offset = page->index << PAGE_CACHE_SHIFT; // 4G limit
 
 	if (offset < inode->i_size) {
 		res = 0;
diff -ur linux-23027p1/fs/romfs/inode.c linux-23027p1m1/fs/romfs/inode.c
--- linux-23027p1/fs/romfs/inode.c	Wed Oct 27 01:03:19 1999
+++ linux-23027p1m1/fs/romfs/inode.c	Mon Nov  8 22:58:51 1999
@@ -404,7 +402,7 @@
 	get_page(page);
 	buf = page_address(page);
 
-	offset = page->offset;
+	offset = (page->index) << PAGE_CACHE_SHIFT;
 	if (offset < inode->i_size) {
 		avail = inode->i_size-offset;
 		readlen = min(avail, PAGE_SIZE);
diff -ur linux-23027p1/fs/smbfs/cache.c linux-23027p1m1/fs/smbfs/cache.c
--- linux-23027p1/fs/smbfs/cache.c	Thu Oct 28 20:53:51 1999
+++ linux-23027p1m1/fs/smbfs/cache.c	Mon Nov  8 22:58:51 1999
@@ -44,15 +44,15 @@
  * smb-cache code assumes we return a locked page.
  */
 static unsigned long
-get_cached_page(struct address_space *mapping, unsigned long offset, int new)
+get_cached_page(struct address_space *mapping, unsigned long index, int new)
 {
 	struct page * page;
 	struct page ** hash;
 	struct page *cached_page = NULL;
 
  again:
-	hash = page_hash(mapping, offset);
-	page = __find_lock_page(mapping, offset, hash);
+	hash = page_hash(mapping, index);
+	page = __find_lock_page(mapping, index, hash);
 	if(!page && new) {
 		/* not in cache, alloc a new page if we didn't do it yet */
 		if (!cached_page) {
@@ -67,7 +67,7 @@
 		if (page->buffers)
 			BUG();
 		printk(KERN_DEBUG "smbfs: get_cached_page\n");
-		if (add_to_page_cache_unique(page, mapping, offset, hash))
+		if (add_to_page_cache_unique(page, mapping, index, hash))
 			/* Hmm, a page has materialized in the
                            cache. Fine. Go back and get that page
                           instead... */
@@ -92,7 +92,7 @@
 
 /*
  * Get a pointer to the cache_head structure,
- * mapped as the page at offset 0. The page is
+ * mapped as the page at index 0. The page is
  * kept locked while we're using the cache.
  */
 struct cache_head *
@@ -112,7 +112,6 @@
 	{
 		struct cache_index * index = cachep->index;
 		struct cache_block * block;
-		unsigned long offset;
 		int i;
 
 		cachep->valid = 0;
@@ -126,9 +125,8 @@
 printk("smb_get_dircache: cache %s/%s has existing block!\n",
 dentry->d_parent->d_name.name, dentry->d_name.name);
 #endif
-			offset = PAGE_SIZE + (i << PAGE_SHIFT);
 			block = (struct cache_block *) get_cached_page(mapping,
-								offset, 0);
+								i+1, 0);
 			if (!block)
 				goto out;
 			index->block = block;
diff -ur linux-23027p1/fs/smbfs/file.c linux-23027p1m1/fs/smbfs/file.c
--- linux-23027p1/fs/smbfs/file.c	Sat Oct 30 02:45:32 1999
+++ linux-23027p1m1/fs/smbfs/file.c	Mon Nov  8 22:58:52 1999
@@ -120,25 +121,42 @@
  * Offset is the data offset within the page.
  */
 static int
-smb_writepage_sync(struct dentry *dentry, struct page *page,
+smb_writepage_sync(struct file *file, struct page *page,
 		   unsigned long offset, unsigned int count)
 {
+	struct dentry * dentry = file->f_dentry;
 	struct inode *inode = dentry->d_inode;
 	u8 *buffer = (u8 *) page_address(page) + offset;
 	int wsize = smb_get_wsize(server_from_dentry(dentry));
 	int result, written = 0;
 
-	offset += page->index << PAGE_CACHE_SHIFT;
+	loff_t loffset = offset + (((loff_t)page->index) << PAGE_CACHE_SHIFT);
+
 #ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_writepage_sync: file %s/%s, count=%d@%ld, wsize=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, count, offset, wsize);
+printk("smb_writepage_sync: file %s/%s, count=%d@%Ld, wsize=%d\n",
+dentry->d_parent->d_name.name, dentry->d_name.name, count, loffset, wsize);
 #endif
 
+	if (!(file->f_flags & O_LARGEFILE) &&
+	    !off_t_presentable(loffset+1))
+	  /* Write starts beyond allowed type-range of off_t */
+	  return -EFBIG; /* Might trap at 2G, or might go above .. */
+
+	if (!(file->f_flags & O_LARGEFILE) &&
+	    !off_t_presentable(loffset + count))
+	  /* Writing beyond LargeFile maximums without O_LARGEFILE */
+	  count = LONG_MAX - loffset;
+
+	if (loffset >= 0x7fffffffULL) /* 2G-1 */
+	  return -EFBIG;
+	if ((loffset + count) >= 0x7fffffffULL)
+	  count = 0x7fffffffULL - loffset;
+
 	do {
 		if (count < wsize)
 			wsize = count;
 
-		result = smb_proc_write(dentry, offset, wsize, buffer);
+		result = smb_proc_write(dentry, loffset, wsize, buffer);
 		if (result < 0)
 			break;
 		/* N.B. what if result < wsize?? */
@@ -147,15 +165,15 @@
 printk("smb_writepage_sync: short write, wsize=%d, result=%d\n", wsize, result);
 #endif
 		buffer += wsize;
-		offset += wsize;
+		loffset += wsize;
 		written += wsize;
 		count -= wsize;
 		/*
 		 * Update the inode now rather than waiting for a refresh.
 		 */
 		inode->i_mtime = inode->i_atime = CURRENT_TIME;
-		if (offset > inode->i_size)
-			inode->i_size = offset;
+		if (loffset > inode->i_size)
+			inode->i_size = loffset;
 		inode->u.smbfs_i.cache_valid |= SMB_F_LOCALWRITE;
 	} while (count);
 	return written ? written : result;
@@ -170,7 +188,6 @@
 static int
 smb_writepage(struct file *file, struct page *page)
 {
-	struct dentry *dentry = file->f_dentry;
 	int 	result;
 
 #ifdef SMBFS_PARANOIA
@@ -178,7 +195,7 @@
 		printk("smb_writepage: page not already locked!\n");
 #endif
 	get_page(page);
-	result = smb_writepage_sync(dentry, page, 0, PAGE_SIZE);
+	result = smb_writepage_sync(file, page, 0, PAGE_SIZE);
 	SetPageUptodate(page);
 	put_page(page);
 	return result;
@@ -189,11 +206,11 @@
 {
 	struct dentry *dentry = file->f_dentry;
 
-	pr_debug("SMBFS: smb_updatepage(%s/%s %d@%ld)\n",
+	pr_debug("SMBFS: smb_updatepage(%s/%s %d@%Ld)\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name,
-	 	count, (page->index << PAGE_CACHE_SHIFT)+offset);
+	 	count, (((loff_t)page->index) << PAGE_CACHE_SHIFT)+offset);
 
-	return smb_writepage_sync(dentry, page, offset, count);
+	return smb_writepage_sync(file, page, offset, count);
 }
 
 static ssize_t
@@ -203,9 +220,9 @@
 	ssize_t	status;
 
 #ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_file_read: file %s/%s, count=%lu@%lu\n",
+printk("smb_file_read: file %s/%s, count=%lu@%Lu\n",
 dentry->d_parent->d_name.name, dentry->d_name.name,
-(unsigned long) count, (unsigned long) *ppos);
+(unsigned long) count, *ppos);
 #endif
 
 	status = smb_revalidate_inode(dentry);
@@ -286,9 +303,9 @@
 	ssize_t	result;
 
 #ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_file_write: file %s/%s, count=%lu@%lu, pages=%ld\n",
+printk("smb_file_write: file %s/%s, count=%lu@%Ld, pages=%ld\n",
 dentry->d_parent->d_name.name, dentry->d_name.name,
-(unsigned long) count, (unsigned long) *ppos, dentry->d_inode->i_nrpages);
+(unsigned long) count, *ppos, dentry->d_inode->i_nrpages);
 #endif
 
 	result = smb_revalidate_inode(dentry);
@@ -309,8 +326,8 @@
 	{
 		result = generic_file_write(file, buf, count, ppos, smb_write_one_page);
 #ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_file_write: pos=%ld, size=%ld, mtime=%ld, atime=%ld\n",
-(long) file->f_pos, dentry->d_inode->i_size, dentry->d_inode->i_mtime,
+printk("smb_file_write: pos=%Ld, size=%ld, mtime=%ld, atime=%ld\n",
+file->f_pos, dentry->d_inode->i_size, dentry->d_inode->i_mtime,
 dentry->d_inode->i_atime);
 #endif
 	}
diff -ur linux-23027p1/fs/smbfs/proc.c linux-23027p1m1/fs/smbfs/proc.c
--- linux-23027p1/fs/smbfs/proc.c	Thu Jun 17 05:26:27 1999
+++ linux-23027p1m1/fs/smbfs/proc.c	Mon Nov  8 22:58:52 1999
@@ -1003,7 +1003,7 @@
    file-id would not be valid after a reconnection. */
 
 int
-smb_proc_read(struct dentry *dentry, off_t offset, int count, char *data)
+smb_proc_read(struct dentry *dentry, loff_t offset, int count, char *data)
 {
 	struct smb_sb_info *server = server_from_dentry(dentry);
 	__u16 returned_count, data_len;
@@ -1045,14 +1045,14 @@
 }
 
 int
-smb_proc_write(struct dentry *dentry, off_t offset, int count, const char *data)
+smb_proc_write(struct dentry *dentry, loff_t offset, int count, const char *data)
 {
 	struct smb_sb_info *server = server_from_dentry(dentry);
 	int result;
 	__u8 *p;
 
 #if SMBFS_DEBUG_VERBOSE
-printk("smb_proc_write: file %s/%s, count=%d@%ld, packet_size=%d\n",
+printk("smb_proc_write: file %s/%s, count=%d@%Ld, packet_size=%d\n",
        DENTRY_PATH(dentry), count, offset, server->packet_size);
 #endif
 	smb_lock_server(server);
diff -ur linux-23027p1/fs/ufs/balloc.c linux-23027p1m1/fs/ufs/balloc.c
--- linux-23027p1/fs/ufs/balloc.c	Tue Jul  6 05:59:55 1999
+++ linux-23027p1m1/fs/ufs/balloc.c	Mon Nov  8 22:58:52 1999
@@ -676,7 +676,7 @@
 	else
 		start = ucpi->c_frotor >> 3;
 		
-	length = howmany(uspi->s_fpg, 8) - start;
+	length = ((uspi->s_fpg + 7) >> 3) - start;
 	location = ubh_scanc(UCPI_UBH, ucpi->c_freeoff + start, length,
 		(uspi->s_fpb == 8) ? ufs_fragtable_8fpb : ufs_fragtable_other,
 		1 << (count - 1 + (uspi->s_fpb & 7))); 
diff -ur linux-23027p1/fs/ufs/super.c linux-23027p1m1/fs/ufs/super.c
--- linux-23027p1/fs/ufs/super.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/ufs/super.c	Mon Nov  8 22:58:52 1999
@@ -328,7 +328,7 @@
 	 * on the device. 
 	 */
 	size = uspi->s_cssize;
-	blks = howmany(size, uspi->s_fsize);
+	blks = (size + uspi->s_fsize-1) >> uspi->s_fshift;
 	base = space = kmalloc(size, GFP_KERNEL);
 	if (!base)
 		goto failed; 
@@ -405,7 +405,7 @@
 	uspi = sb->u.ufs_sb.s_uspi;
 
 	size = uspi->s_cssize;
-	blks = howmany(size, uspi->s_fsize);
+	blks = (size + uspi->s_fsize-1) >> uspi->s_fshift;
 	base = space = (char*) sb->u.ufs_sb.s_csp[0];
 	for (i = 0; i < blks; i += uspi->s_fpb) {
 		size = uspi->s_bsize;
diff -ur linux-23027p1/fs/ufs/truncate.c linux-23027p1m1/fs/ufs/truncate.c
--- linux-23027p1/fs/ufs/truncate.c	Wed Aug 18 20:15:19 1999
+++ linux-23027p1m1/fs/ufs/truncate.c	Mon Nov  8 22:58:52 1999
@@ -59,8 +59,8 @@
  *		Linus
  */
 
-#define DIRECT_BLOCK howmany (inode->i_size, uspi->s_bsize)
-#define DIRECT_FRAGMENT howmany (inode->i_size, uspi->s_fsize)
+#define DIRECT_BLOCK ((inode->i_size + uspi->s_bsize -1) >> uspi->s_bshift)
+#define DIRECT_FRAGMENT ((inode->i_size + uspi->s_fsize -1) >> uspi->s_fshift)
 
 #define DATA_BUFFER_USED(bh) \
 	(atomic_read(&bh->b_count) || buffer_locked(bh))
@@ -312,7 +312,7 @@
 	uspi = sb->u.ufs_sb.s_uspi;
 
 	dindirect_block = (DIRECT_BLOCK > offset) 
-		? ((DIRECT_BLOCK - offset) / uspi->s_apb) : 0;
+		? ((DIRECT_BLOCK - offset) >> uspi->s_apbshift) : 0;
 	retry = 0;
 	
 	tmp = SWAB32(*p);
@@ -382,7 +382,7 @@
 	retry = 0;
 	
 	tindirect_block = (DIRECT_BLOCK > (UFS_NDADDR + uspi->s_apb + uspi->s_2apb))
-		? ((DIRECT_BLOCK - UFS_NDADDR - uspi->s_apb - uspi->s_2apb) / uspi->s_2apb) : 0;
+		? ((DIRECT_BLOCK - UFS_NDADDR - uspi->s_apb - uspi->s_2apb) >> uspi->s_2apbshift) : 0;
 	p = inode->u.ufs_i.i_u1.i_data + UFS_TIND_BLOCK;
 	if (!(tmp = SWAB32(*p)))
 		return 0;
@@ -471,7 +471,8 @@
 		}
 	}
 	inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-	inode->u.ufs_i.i_lastfrag = howmany (inode->i_size, uspi->s_fsize);
+	inode->u.ufs_i.i_lastfrag =
+			(inode->i_size + uspi->s_fsize -1) >> uspi->s_fshift;
 	mark_inode_dirty(inode);
 	UFSD(("EXIT\n"))
 }
diff -ur linux-23027p1/fs/ufs/util.h linux-23027p1m1/fs/ufs/util.h
--- linux-23027p1/fs/ufs/util.h	Mon Nov  8 17:28:13 1999
+++ linux-23027p1m1/fs/ufs/util.h	Mon Nov  8 22:58:52 1999
@@ -14,7 +14,6 @@
  * some useful macros
  */
 #define in_range(b,first,len)	((b)>=(first)&&(b)<(first)+(len))
-#define howmany(x,y)		(((x)+(y)-1)/(y))
 #define min(x,y)		((x)<(y)?(x):(y))
 #define max(x,y)		((x)>(y)?(x):(y))
 
diff -ur linux-23027p1/include/asm-alpha/posix_types.h linux-23027p1m1/include/asm-alpha/posix_types.h
--- linux-23027p1/include/asm-alpha/posix_types.h	Fri Aug 21 16:33:36 1998
+++ linux-23027p1m1/include/asm-alpha/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -9,9 +9,11 @@
 
 typedef unsigned int	__kernel_dev_t;
 typedef unsigned int	__kernel_ino_t;
+typedef unsigned long	__kernel_ino64_t;
 typedef unsigned int	__kernel_mode_t;
 typedef unsigned int	__kernel_nlink_t;
 typedef long		__kernel_off_t;
+typedef long		__kernel_off64_t;
 typedef int		__kernel_pid_t;
 typedef int		__kernel_ipc_pid_t;
 typedef unsigned int	__kernel_uid_t;
diff -ur linux-23027p1/include/asm-arm/posix_types.h linux-23027p1m1/include/asm-arm/posix_types.h
--- linux-23027p1/include/asm-arm/posix_types.h	Sat May  8 21:06:57 1999
+++ linux-23027p1m1/include/asm-arm/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -17,9 +17,11 @@
 
 typedef unsigned short		__kernel_dev_t;
 typedef unsigned long		__kernel_ino_t;
+typedef unsigned long long	__kernel_ino64_t;
 typedef unsigned short		__kernel_mode_t;
 typedef unsigned short		__kernel_nlink_t;
 typedef long			__kernel_off_t;
+typedef long long		__kernel_off64_t;
 typedef int			__kernel_pid_t;
 typedef unsigned short		__kernel_ipc_pid_t;
 typedef unsigned short		__kernel_uid_t;
diff -ur linux-23027p1/include/asm-i386/posix_types.h linux-23027p1m1/include/asm-i386/posix_types.h
--- linux-23027p1/include/asm-i386/posix_types.h	Sun Dec 27 20:39:50 1998
+++ linux-23027p1m1/include/asm-i386/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -9,9 +9,11 @@
 
 typedef unsigned short	__kernel_dev_t;
 typedef unsigned long	__kernel_ino_t;
+typedef unsigned long long __kernel_ino64_t;
 typedef unsigned short	__kernel_mode_t;
 typedef unsigned short	__kernel_nlink_t;
 typedef long		__kernel_off_t;
+typedef long long	__kernel_off64_t;
 typedef int		__kernel_pid_t;
 typedef unsigned short	__kernel_ipc_pid_t;
 typedef unsigned short	__kernel_uid_t;
diff -ur linux-23027p1/include/asm-m68k/posix_types.h linux-23027p1m1/include/asm-m68k/posix_types.h
--- linux-23027p1/include/asm-m68k/posix_types.h	Mon Aug 10 21:02:24 1998
+++ linux-23027p1m1/include/asm-m68k/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -9,9 +9,11 @@
 
 typedef unsigned short	__kernel_dev_t;
 typedef unsigned long	__kernel_ino_t;
+typedef unsigned long long __kernel_ino64_t;
 typedef unsigned short	__kernel_mode_t;
 typedef unsigned short	__kernel_nlink_t;
 typedef long		__kernel_off_t;
+typedef long long	__kernel_off64_t;
 typedef int		__kernel_pid_t;
 typedef unsigned short	__kernel_ipc_pid_t;
 typedef unsigned short	__kernel_uid_t;
diff -ur linux-23027p1/include/asm-mips/posix_types.h linux-23027p1m1/include/asm-mips/posix_types.h
--- linux-23027p1/include/asm-mips/posix_types.h	Tue Oct 20 23:52:53 1998
+++ linux-23027p1m1/include/asm-mips/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -38,6 +38,8 @@
 typedef char *		__kernel_caddr_t;
 
 #ifdef __GNUC__
+typedef unsigned long long __kernel_ino64_t;
+typedef long long	__kernel_off64_t;
 typedef long long      __kernel_loff_t;
 #endif
 
diff -ur linux-23027p1/include/asm-ppc/posix_types.h linux-23027p1m1/include/asm-ppc/posix_types.h
--- linux-23027p1/include/asm-ppc/posix_types.h	Thu Apr 29 22:39:01 1999
+++ linux-23027p1m1/include/asm-ppc/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -26,6 +26,8 @@
 typedef short             __kernel_ipc_pid_t;
 
 #ifdef __GNUC__
+typedef unsigned long long __kernel_ino64_t;
+typedef long long	__kernel_off64_t;
 typedef long long	__kernel_loff_t;
 #endif
 
diff -ur linux-23027p1/include/asm-sparc/posix_types.h linux-23027p1m1/include/asm-sparc/posix_types.h
--- linux-23027p1/include/asm-sparc/posix_types.h	Thu Mar 11 02:53:37 1999
+++ linux-23027p1m1/include/asm-sparc/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -33,6 +33,8 @@
 typedef char *                 __kernel_caddr_t;
 
 #ifdef __GNUC__
+typedef unsigned long long     __kernel_ino64_t;
+typedef long long              __kernel_off64_t;
 typedef long long	__kernel_loff_t;
 #endif
 
diff -ur linux-23027p1/include/asm-sparc64/posix_types.h linux-23027p1m1/include/asm-sparc64/posix_types.h
--- linux-23027p1/include/asm-sparc64/posix_types.h	Thu Mar 11 02:53:38 1999
+++ linux-23027p1m1/include/asm-sparc64/posix_types.h	Mon Nov  8 22:58:52 1999
@@ -34,6 +34,8 @@
 typedef int		       __kernel_suseconds_t;
 
 #ifdef __GNUC__
+typedef unsigned long          __kernel_ino64_t;
+typedef long                   __kernel_off64_t;
 typedef long long              __kernel_loff_t;
 #endif
 
diff -ur linux-23027p1/include/linux/fs.h linux-23027p1m1/include/linux/fs.h
--- linux-23027p1/include/linux/fs.h	Mon Nov  8 22:57:35 1999
+++ linux-23027p1m1/include/linux/fs.h	Mon Nov  8 22:58:52 1999
@@ -428,7 +438,25 @@
 	unsigned int 		f_flags;
 	mode_t			f_mode;
 	loff_t			f_pos;
-	unsigned long 		f_reada, f_ramax, f_raend, f_ralen, f_rawin;
+
+/*
+ * Read-ahead context:
+ * -------------------
+ * The read ahead context fields of the "struct file" are the following:
+ * - f_raend : index of the last+1 page after attempted read-ahead.
+ * - f_ramax : current read-ahead maximum size.
+ * - f_ralen : length of the current IO read block we tried to read-ahead.
+ * - f_rawin : length of the current read-ahead window.
+ *
+ * For more info, see  mm/filemap.c
+ */
+	int			f_reada;	/* bool */ /* all around   */
+	/* following u_long could be done with u_int as well, and
+	   have slightly smaller 'struct file' for 64-bit machines.
+	   Presuming, of course, that we stay under 2 GB read-ahead ... */
+	u_int			f_ramax, f_ralen, f_rawin; /* mm/filemap.c */
+	u_long	 		f_raend;		   /* mm/filemap.c */
+
 	struct fown_struct	f_owner;
 	unsigned int		f_uid, f_gid;
 	int			f_error;
diff -ur linux-23027p1/include/linux/nfs.h linux-23027p1m1/include/linux/nfs.h
--- linux-23027p1/include/linux/nfs.h	Mon Oct 18 21:26:37 1999
+++ linux-23027p1m1/include/linux/nfs.h	Mon Nov  8 22:58:52 1999
@@ -111,7 +111,7 @@
 	__u32			nlink;
 	__u32			uid;
 	__u32			gid;
-	__u32			size;
+	__u64			size;
 	__u32			blocksize;
 	__u32			rdev;
 	__u32			blocks;
@@ -132,7 +132,7 @@
 
 struct nfs_writeargs {
 	struct nfs_fh *		fh;
-	__u32			offset;
+	__u64			offset;
 	__u32			count;
 	const void *		buffer;
 };
@@ -156,7 +156,7 @@
 
 struct nfs_readargs {
 	struct nfs_fh *		fh;
-	__u32			offset;
+	__u64			offset;
 	__u32			count;
 	void *			buffer;
 };
diff -ur linux-23027p1/include/linux/nfs_fs.h linux-23027p1m1/include/linux/nfs_fs.h
--- linux-23027p1/include/linux/nfs_fs.h	Mon Nov  8 14:11:45 1999
+++ linux-23027p1m1/include/linux/nfs_fs.h	Mon Nov  8 22:58:52 1999
@@ -145,10 +145,10 @@
 			const char *name, struct nfs_fh *fhandle,
 			struct nfs_fattr *fattr);
 extern int nfs_proc_read(struct nfs_server *server, struct nfs_fh *fhandle,
-			int swap, unsigned long offset, unsigned int count,
+			int swap, loff_t offset, unsigned int count,
 			void *buffer, struct nfs_fattr *fattr);
 extern int nfs_proc_write(struct nfs_server *server, struct nfs_fh *fhandle,
-			int swap, unsigned long offset, unsigned int count,
+			int swap, loff_t offset, unsigned int count,
 			const void *buffer, struct nfs_fattr *fattr);
 extern int nfs_proc_create(struct nfs_server *server, struct nfs_fh *dir,
 			const char *name, struct iattr *sattr,
diff -ur linux-23027p1/include/linux/smb_fs.h linux-23027p1m1/include/linux/smb_fs.h
--- linux-23027p1/include/linux/smb_fs.h	Mon Nov  8 14:14:22 1999
+++ linux-23027p1m1/include/linux/smb_fs.h	Mon Nov  8 22:58:52 1999
@@ -128,8 +128,8 @@
 void smb_close_dentry(struct dentry *);
 int smb_close_fileid(struct dentry *, __u16);
 int smb_open(struct dentry *, int);
-int smb_proc_read(struct dentry *, off_t, int, char *);
-int smb_proc_write(struct dentry *, off_t, int, const char *);
+int smb_proc_read(struct dentry *, loff_t, int, char *);
+int smb_proc_write(struct dentry *, loff_t, int, const char *);
 int smb_proc_create(struct dentry *, __u16, time_t, __u16 *);
 int smb_proc_mv(struct dentry *, struct dentry *);
 int smb_proc_mkdir(struct dentry *);
diff -ur linux-23027p1/include/linux/types.h linux-23027p1m1/include/linux/types.h
--- linux-23027p1/include/linux/types.h	Mon Nov  8 14:11:09 1999
+++ linux-23027p1m1/include/linux/types.h	Mon Nov  8 22:58:52 1999
@@ -9,9 +9,11 @@
 typedef __kernel_fd_set		fd_set;
 typedef __kernel_dev_t		dev_t;
 typedef __kernel_ino_t		ino_t;
+typedef __kernel_ino64_t	ino64_t;
 typedef __kernel_mode_t		mode_t;
 typedef __kernel_nlink_t	nlink_t;
 typedef __kernel_off_t		off_t;
+typedef __kernel_off64_t	off64_t;
 typedef __kernel_pid_t		pid_t;
 typedef __kernel_uid_t		uid_t;
 typedef __kernel_gid_t		gid_t;
diff -ur linux-23027p1/mm/vmscan.c linux-23027p1m1/mm/vmscan.c
--- linux-23027p1/mm/vmscan.c	Sat Oct 30 02:45:32 1999
+++ linux-23027p1m1/mm/vmscan.c	Mon Nov  8 22:58:52 1999
@@ -19,6 +19,8 @@
 #include <linux/init.h>
 #include <linux/highmem.h>
 #include <linux/file.h>
+#define __KERNEL_SYSCALLS__
+#include <linux/unistd.h>
 
 #include <asm/pgtable.h>
 
diff -ur linux-23027p1/net/khttpd/datasending.c linux-23027p1m1/net/khttpd/datasending.c
--- linux-23027p1/net/khttpd/datasending.c	Thu Aug 26 19:41:36 1999
+++ linux-23027p1m1/net/khttpd/datasending.c	Mon Nov  8 22:58:53 1999
@@ -55,7 +55,11 @@
 It sends the data to the socket indicated by desc->buf.
 
 */
-static int sock_send_actor(read_descriptor_t * desc, const char *area, unsigned long size)
+
+// FIXME: usage of these parameters is not corrected in code below,
+// FIXME: while call parameters are now modern...
+
+static int sock_send_actor(read_descriptor_t * desc, struct page * page, unsigned long offset, unsigned long size)
 {
 	int written;
 	unsigned long count = desc->count;
@@ -63,7 +67,7 @@
 
 	if (size > count)
 		size = count;
-	written = SendBuffer_async(sock,(char *)area,size);
+	written = SendBuffer_async(sock, page, size);
 
 	if (written < 0) {
 		desc->error = written;
diff -ur linux-23027p1/net/khttpd/main.c linux-23027p1m1/net/khttpd/main.c
--- linux-23027p1/net/khttpd/main.c	Tue Aug 31 21:30:48 1999
+++ linux-23027p1m1/net/khttpd/main.c	Mon Nov  8 22:58:53 1999
@@ -58,7 +58,7 @@
 #include <linux/init.h>
 #include <linux/wait.h>
 #include <linux/smp_lock.h>
-#include <asm/unistd.h>
+#include <linux/unistd.h>
 
 #include "structure.h"
 #include "prototypes.h"
