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

	This file contains statvfs64 things.
	( + inseparable do_truncate() and *truncate64() syscalls )

diff -ur linux-23027p1/arch/alpha/kernel/osf_sys.c linux-23027p1m1/arch/alpha/kernel/osf_sys.c
--- linux-23027p1/arch/alpha/kernel/osf_sys.c	Thu Jul 29 23:37:22 1999
+++ linux-23027p1m1/arch/alpha/kernel/osf_sys.c	Mon Nov  8 22:58:50 1999
@@ -295,7 +295,7 @@
 	__kernel_fsid_t f_fsid;
 } *osf_stat;
 
-static int linux_to_osf_statfs(struct statfs *linux_stat, struct osf_statfs *osf_stat, unsigned long bufsiz)
+static int linux_to_osf_statfs(struct statvfs64 *linux_stat, struct osf_statfs *osf_stat, unsigned long bufsiz)
 {
 	struct osf_statfs tmp_stat;
 
@@ -317,16 +317,15 @@
 
 static int do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer, unsigned long bufsiz)
 {
-	struct statfs linux_stat;
+	struct statvfs64 linux_stat;
 	struct inode * inode = dentry->d_inode;
 	struct super_block * sb = inode->i_sb;
 	int error;
 
 	error = -ENODEV;
-	if (sb && sb->s_op && sb->s_op->statfs) {
-		set_fs(KERNEL_DS);
-		error = sb->s_op->statfs(sb, &linux_stat, sizeof(linux_stat));
-		set_fs(USER_DS);
+	if (sb && sb->s_op && sb->s_op->statvfs) {
+		memset(&linux_stat, 0, sizeof(linux_stat));
+		error = sb->s_op->statvfs(sb, &linux_stat);
 		if (!error)
 			error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
 	}
diff -ur linux-23027p1/arch/mips/kernel/sysirix.c linux-23027p1m1/arch/mips/kernel/sysirix.c
--- linux-23027p1/arch/mips/kernel/sysirix.c	Sat Jun 26 03:40:12 1999
+++ linux-23027p1m1/arch/mips/kernel/sysirix.c	Mon Nov  8 22:58:50 1999
@@ -727,8 +727,7 @@
 {
 	struct dentry *dentry;
 	struct inode *inode;
-	mm_segment_t old_fs;
-	struct statfs kbuf;
+	struct statvfs64 kbuf;
 	int error, i;
 
 	lock_kernel();
@@ -747,10 +746,7 @@
 		goto out;
 
 	inode = dentry->d_inode;
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &kbuf);
 	if (error)
 		goto dput_and_out;
 
@@ -777,8 +773,7 @@
 asmlinkage int irix_fstatfs(unsigned int fd, struct irix_statfs *buf)
 {
 	struct inode *inode;
-	struct statfs kbuf;
-	mm_segment_t old_fs;
+	struct statvfs64 kbuf;
 	struct file *file;
 	int error, i;
 
@@ -799,15 +794,12 @@
 		error = -ENODEV;
 		goto out_f;
 	}
-	if (!inode->i_sb->s_op->statfs) {
+	if (!inode->i_sb->s_op->statvfs) {
 		error = -ENOSYS;
 		goto out_f;
 	}
 
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &kbuf);
 	if (error)
 		goto out_f;
 
@@ -1510,8 +1502,7 @@
 {
 	struct dentry *dentry;
 	struct inode *inode;
-	mm_segment_t old_fs;
-	struct statfs kbuf;
+	struct statvfs64 kbuf;
 	int error, i;
 
 	lock_kernel();
@@ -1527,13 +1518,10 @@
 	inode = dentry->d_inode;
 
 	error = -ENOSYS;
-	if(!inode->i_sb->s_op->statfs)
+	if(!inode->i_sb->s_op->statvfs)
 		goto dput_and_out;
 
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &kbuf);
 	if (error)
 		goto dput_and_out;
 
@@ -1569,8 +1557,7 @@
 asmlinkage int irix_fstatvfs(int fd, struct irix_statvfs *buf)
 {
 	struct inode *inode;
-	mm_segment_t old_fs;
-	struct statfs kbuf;
+	struct statvfs64 kbuf;
 	struct file *file;
 	int error, i;
 
@@ -1593,15 +1580,12 @@
 		error = -ENODEV;
 		goto out_f;
 	}
-	if (!inode->i_sb->s_op->statfs) {
+	if (!inode->i_sb->s_op->statvfs) {
 		error = -ENOSYS;
 		goto out_f;
 	}
 
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &kbuf);
 	if (error)
 		goto out_f;
 
@@ -1805,8 +1789,7 @@
 {
 	struct dentry *dentry;
 	struct inode *inode;
-	mm_segment_t old_fs;
-	struct statfs kbuf;
+	struct statvfs64 kbuf;
 	int error, i;
 
 	lock_kernel();
@@ -1821,13 +1804,10 @@
 		goto out;
 	error = -ENOSYS;
 	inode = dentry->d_inode;
-	if(!inode->i_sb->s_op->statfs)
+	if(!inode->i_sb->s_op->statvfs)
 		goto dput_and_out;
 
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &kbuf);
 	if (error)
 		goto dput_and_out;
 
@@ -1863,8 +1843,7 @@
 asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs *buf)
 {
 	struct inode *inode;
-	mm_segment_t old_fs;
-	struct statfs kbuf;
+	struct statvfs64 kbuf;
 	struct file *file;
 	int error, i;
 
@@ -1887,15 +1866,12 @@
 		error = -ENODEV;
 		goto out_f;
 	}
-	if (!inode->i_sb->s_op->statfs) {
+	if (!inode->i_sb->s_op->statvfs) {
 		error = -ENOSYS;
 		goto out_f;
 	}
 
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &kbuf);
 	if (error)
 		goto out_f;
 
diff -ur linux-23027p1/arch/sparc64/solaris/fs.c linux-23027p1m1/arch/sparc64/solaris/fs.c
--- linux-23027p1/arch/sparc64/solaris/fs.c	Sat May 15 21:12:09 1999
+++ linux-23027p1m1/arch/sparc64/solaris/fs.c	Mon Nov  8 22:58:50 1999
@@ -299,30 +299,41 @@
 
 asmlinkage int solaris_statfs(u32 path, u32 buf, int len, int fstype)
 {
-	int ret;
-	struct statfs s;
-	mm_segment_t old_fs = get_fs();
-	int (*sys_statfs)(const char *,struct statfs *) = 
-		(int (*)(const char *,struct statfs *))SYS(statfs);
+	struct statvfs64 s;
 	struct sol_statfs *ss = (struct sol_statfs *)A(buf);
+	struct dentry *dentry;
+	struct inode *inode;
+	int error, i;
 	
 	if (len != sizeof(struct sol_statfs)) return -EINVAL;
+
+	lock_kernel();
+
 	if (!fstype) {
-		set_fs (KERNEL_DS);
-		ret = sys_statfs((const char *)A(path), &s);
-		set_fs (old_fs);
-		if (!ret) {
-			if (put_user (s.f_type, &ss->f_type)		||
-			    __put_user (s.f_bsize, &ss->f_bsize)	||
-			    __put_user (0, &ss->f_frsize)		||
-			    __put_user (s.f_blocks, &ss->f_blocks)	||
-			    __put_user (s.f_bfree, &ss->f_bfree)	||
-			    __put_user (s.f_files, &ss->f_files)	||
-			    __put_user (s.f_ffree, &ss->f_ffree)	||
-			    __clear_user (&ss->f_fname, 12))
-				return -EFAULT;
+		dentry = namei(path);
+		error = PTR_ERR(dentry);
+		if (IS_ERR(dentry))
+			goto out;
+
+		inode = dentry->d_inode;
+		error = inode->i_sb->s_op->statvfs(inode->i_sb, &s);
+		if (error)
+			goto dput_and_out;
+
+		if (put_user (s.f_type, &ss->f_type)		||
+		    __put_user (s.f_bsize, &ss->f_bsize)	||
+		    __put_user (0, &ss->f_frsize)		||
+		    __put_user (s.f_blocks, &ss->f_blocks)	||
+		    __put_user (s.f_bfree, &ss->f_bfree)	||
+		    __put_user (s.f_files, &ss->f_files)	||
+		    __put_user (s.f_ffree, &ss->f_ffree)	||
+		    __clear_user (&ss->f_fname, 12)) {
+			error = -EFAULT;
 		}
-		return ret;
+	dput_and_out:
+		dput(dentry);
+
+		goto out;
 	}
 /* Linux can't stat unmounted filesystems so we
  * simply lie and claim 100MB of 1GB is free. Sorry.
@@ -335,39 +346,68 @@
 	    __put_user (60000, &ss->f_files)		||
 	    __put_user (50000, &ss->f_ffree)		||
 	    __clear_user (&ss->f_fname, 12))
-		return -EFAULT;
-	return 0;
+		error = -EFAULT;
+
+out:
+	unlock_kernel();
+	return error;
 }
 
 asmlinkage int solaris_fstatfs(u32 fd, u32 buf, int len, int fstype)
 {
-	int ret;
-	struct statfs s;
-	mm_segment_t old_fs = get_fs();
-	int (*sys_fstatfs)(unsigned,struct statfs *) = 
-		(int (*)(unsigned,struct statfs *))SYS(fstatfs);
+	struct statvfs64 s;
 	struct sol_statfs *ss = (struct sol_statfs *)A(buf);
+	struct inode *inode;
+	struct file *file;
+	int error, i;
 	
 	if (len != sizeof(struct sol_statfs)) return -EINVAL;
-	if (!fstype) {
-		set_fs (KERNEL_DS);
-		ret = sys_fstatfs(fd, &s);
-		set_fs (old_fs);
-		if (!ret) {
-			if (put_user (s.f_type, &ss->f_type)		||
-			    __put_user (s.f_bsize, &ss->f_bsize)	||
-			    __put_user (0, &ss->f_frsize)		||
-			    __put_user (s.f_blocks, &ss->f_blocks)	||
-			    __put_user (s.f_bfree, &ss->f_bfree)	||
-			    __put_user (s.f_files, &ss->f_files)	||
-			    __put_user (s.f_ffree, &ss->f_ffree)	||
-			    __clear_user (&ss->f_fname, 12))
-				return -EFAULT;
-		}
-		return ret;
+
+	if (fstype) {
+	  /* Otherwise fstatfs is the same as statfs */
+	  return solaris_statfs(0, buf, len, fstype);
 	}
-	/* Otherwise fstatfs is the same as statfs */
-	return solaris_statfs(0, buf, len, fstype);
+
+	lock_kernel();
+
+	if (!(file = fget(fd))) {
+		error = -EBADF;
+		goto out;
+	}
+
+	if (!(inode = file->f_dentry->d_inode)) {
+		error = -ENOENT;
+		goto out_f;
+	}
+	if (!inode->i_sb) {
+		error = -ENODEV;
+		goto out_f;
+	}
+	if (!inode->i_sb->s_op->statvfs) {
+		error = -ENOSYS;
+		goto out_f;
+	}
+
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &s);
+	if (error)
+		goto out_f;
+
+	if (!error) {
+		if (put_user (s.f_type, &ss->f_type)		||
+		    __put_user (s.f_bsize, &ss->f_bsize)	||
+		    __put_user (0, &ss->f_frsize)		||
+		    __put_user (s.f_blocks, &ss->f_blocks)	||
+		    __put_user (s.f_bfree, &ss->f_bfree)	||
+		    __put_user (s.f_files, &ss->f_files)	||
+		    __put_user (s.f_ffree, &ss->f_ffree)	||
+		    __clear_user (&ss->f_fname, 12))
+			error = -EFAULT;
+	}
+out_f:
+	fput(file);
+out:
+	unlock_kernel();
+	return error;
 }
 
 struct sol_statvfs {
@@ -406,18 +446,15 @@
 
 static int report_statvfs(struct inode *inode, u32 buf)
 {
-	struct statfs s;
-	mm_segment_t old_fs = get_fs();
+	struct statvfs64 s;
 	int error;
 	struct sol_statvfs *ss = (struct sol_statvfs *)A(buf);
 
 	if (!inode->i_sb)
 		return -ENODEV;
-	if (!inode->i_sb->s_op->statfs)
+	if (!inode->i_sb->s_op->statvfs)
 		return -ENOSYS;
-	set_fs (KERNEL_DS);
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &s, sizeof(struct statfs));
-	set_fs (old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &s);
 	if (!error) {
 		const char *p = inode->i_sb->s_type->name;
 		int i = 0;
@@ -447,18 +484,15 @@
 
 static int report_statvfs64(struct inode *inode, u32 buf)
 {
-	struct statfs s;
-	mm_segment_t old_fs = get_fs();
+	struct statvfs64 s;
 	int error;
 	struct sol_statvfs64 *ss = (struct sol_statvfs64 *)A(buf);
 			
 	if (!inode->i_sb)
 		return -ENODEV;
-	if (!inode->i_sb->s_op->statfs)
+	if (!inode->i_sb->s_op->statvfs)
 		return -ENOSYS;
-	set_fs (KERNEL_DS);
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &s, sizeof(struct statfs));
-	set_fs (old_fs);
+	error = inode->i_sb->s_op->statvfs(inode->i_sb, &s);
 	if (!error) {
 		const char *p = inode->i_sb->s_type->name;
 		int i = 0;
diff -ur linux-23027p1/fs/adfs/super.c linux-23027p1m1/fs/adfs/super.c
--- linux-23027p1/fs/adfs/super.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/adfs/super.c	Mon Nov  8 22:58:50 1999
@@ -23,7 +23,7 @@
 
 static void adfs_put_super(struct super_block *sb);
 static int adfs_remount(struct super_block *sb, int *flags, char *data);
-static int adfs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int adfs_statvfs(struct super_block *sb, struct statvfs64 *buf);
 void adfs_read_inode(struct inode *inode);
 
 void adfs_error(struct super_block *sb, const char *function, const char *fmt, ...)
@@ -92,7 +92,7 @@
 	NULL,
 	adfs_put_super,
 	NULL,
-	adfs_statfs,
+	adfs_statvfs,
 	adfs_remount
 };
 
@@ -322,16 +322,15 @@
 	return NULL;
 }
 
-static int adfs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int adfs_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
 	const unsigned int nidlen = sb->u.adfs_sb.s_idlen + 1;
 
-	tmp.f_type = ADFS_SUPER_MAGIC;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = sb->u.adfs_sb.s_dr->disc_size_high << (32 - sb->s_blocksize_bits) |
+	buf->f_type = ADFS_SUPER_MAGIC;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = sb->u.adfs_sb.s_dr->disc_size_high << (32 - sb->s_blocksize_bits) |
 		       sb->u.adfs_sb.s_dr->disc_size >> sb->s_blocksize_bits;
-	tmp.f_files = tmp.f_blocks >> nidlen;
+	buf->f_files = buf->f_blocks >> nidlen;
 	{
 		unsigned int i, j = 0;
 		const unsigned mask = (1 << (nidlen - 1)) - 1;
@@ -373,12 +372,12 @@
 			else if (freelink)
 				adfs_error(sb, NULL, "undersized free fragment\n");
 		}
-		tmp.f_bfree = tmp.f_bavail = j <<
+		buf->f_bfree = buf->f_bavail = j <<
 			(sb->u.adfs_sb.s_dr->log2bpmb - sb->s_blocksize_bits);
 	}
-	tmp.f_ffree = tmp.f_bfree >> nidlen;
-	tmp.f_namelen = ADFS_NAME_LEN;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_ffree = buf->f_bfree >> nidlen;
+	buf->f_namelen = ADFS_NAME_LEN;
+	return 0;
 }
 
 static struct file_system_type adfs_fs_type = {
diff -ur linux-23027p1/fs/affs/super.c linux-23027p1m1/fs/affs/super.c
--- linux-23027p1/fs/affs/super.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/affs/super.c	Mon Nov  8 22:58:51 1999
@@ -35,7 +35,7 @@
 
 #define MIN(a,b) (((a)<(b))?(a):(b))
 
-static int affs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int affs_statvfs(struct super_block *sb, struct statvfs64 *buf);
 static int affs_remount (struct super_block *sb, int *flags, char *data);
 
 static void
@@ -105,7 +105,7 @@
 	affs_notify_change,
 	affs_put_super,
 	affs_write_super,
-	affs_statfs,
+	affs_statvfs,
 	affs_remount
 };
 
@@ -662,23 +662,22 @@
 }
 
 static int
-affs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+affs_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
 	int		 free;
-	struct statfs	 tmp;
 
-	pr_debug("AFFS: statfs() partsize=%d, reserved=%d\n",sb->u.affs_sb.s_partition_size,
+	pr_debug("AFFS: statvfs() partsize=%d, reserved=%d\n",sb->u.affs_sb.s_partition_size,
 	     sb->u.affs_sb.s_reserved);
 
 	free          = affs_count_free_blocks(sb);
-	tmp.f_type    = AFFS_SUPER_MAGIC;
-	tmp.f_bsize   = sb->s_blocksize;
-	tmp.f_blocks  = sb->u.affs_sb.s_partition_size - sb->u.affs_sb.s_reserved;
-	tmp.f_bfree   = free;
-	tmp.f_bavail  = free;
-	tmp.f_files   = 0;
-	tmp.f_ffree   = 0;
-	return copy_to_user(buf,&tmp,bufsiz) ? -EFAULT : 0;
+	buf->f_type    = AFFS_SUPER_MAGIC;
+	buf->f_bsize   = sb->s_blocksize;
+	buf->f_blocks  = sb->u.affs_sb.s_partition_size - sb->u.affs_sb.s_reserved;
+	buf->f_bfree   = free;
+	buf->f_bavail  = free;
+	buf->f_files   = 0;
+	buf->f_ffree   = 0;
+	return 0;
 }
 
 static struct file_system_type affs_fs_type = {
diff -ur linux-23027p1/fs/autofs/inode.c linux-23027p1m1/fs/autofs/inode.c
--- linux-23027p1/fs/autofs/inode.c	Tue Jun  8 20:47:58 1999
+++ linux-23027p1m1/fs/autofs/inode.c	Mon Nov  8 22:58:51 1999
@@ -55,7 +55,7 @@
 #endif
 }
 
-static int autofs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int autofs_statvfs(struct super_block *sb, struct statvfs64 *buf);
 static void autofs_read_inode(struct inode *inode);
 static void autofs_write_inode(struct inode *inode);
 
@@ -67,7 +67,7 @@
 	NULL,			/* notify_change */
 	autofs_put_super,
 	NULL,			/* write_super */
-	autofs_statfs,
+	autofs_statvfs,
 	NULL
 };
 
@@ -277,19 +277,17 @@
 	return NULL;
 }
 
-static int autofs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int autofs_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = AUTOFS_SUPER_MAGIC;
-	tmp.f_bsize = 1024;
-	tmp.f_blocks = 0;
-	tmp.f_bfree = 0;
-	tmp.f_bavail = 0;
-	tmp.f_files = 0;
-	tmp.f_ffree = 0;
-	tmp.f_namelen = NAME_MAX;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = AUTOFS_SUPER_MAGIC;
+	buf->f_bsize = 1024;
+	buf->f_blocks = 0;
+	buf->f_bfree = 0;
+	buf->f_bavail = 0;
+	buf->f_files = 0;
+	buf->f_ffree = 0;
+	buf->f_namelen = NAME_MAX;
+	return 0;
 }
 
 static void autofs_read_inode(struct inode *inode)
diff -ur linux-23027p1/fs/bfs/inode.c linux-23027p1m1/fs/bfs/inode.c
--- linux-23027p1/fs/bfs/inode.c	Fri Nov  5 20:30:13 1999
+++ linux-23027p1m1/fs/bfs/inode.c	Mon Nov  8 22:58:51 1999
@@ -200,19 +200,17 @@
 	MOD_DEC_USE_COUNT;
 }
 
-static int bfs_statfs(struct super_block *s, struct statfs *buf, int bufsiz)
+static int bfs_statvfs(struct super_block *s, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = BFS_MAGIC;
-	tmp.f_bsize = s->s_blocksize;
-	tmp.f_blocks = s->su_blocks;
-	tmp.f_bfree = tmp.f_bavail = s->su_freeb;
-	tmp.f_files = s->su_lasti + 1 - BFS_ROOT_INO;
-	tmp.f_ffree = s->su_freei;
-	tmp.f_fsid.val[0] = s->s_dev;
-	tmp.f_namelen = BFS_NAMELEN;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = BFS_MAGIC;
+	buf->f_bsize = s->s_blocksize;
+	buf->f_blocks = s->su_blocks;
+	buf->f_bfree = buf->f_bavail = s->su_freeb;
+	buf->f_files = s->su_lasti + 1 - BFS_ROOT_INO;
+	buf->f_ffree = s->su_freei;
+	buf->f_fsid.val[0] = s->s_dev;
+	buf->f_namelen = BFS_NAMELEN;
+	return 0;
 }
 
 static void bfs_write_super(struct super_block *s)
@@ -230,7 +228,7 @@
 	notify_change:	NULL,
 	put_super:	bfs_put_super,
 	write_super:	bfs_write_super,
-	statfs:		bfs_statfs,
+	statvfs:	bfs_statvfs,
 	remount_fs:	NULL,
 	clear_inode:	NULL,
 	umount_begin:	NULL
diff -ur linux-23027p1/fs/coda/inode.c linux-23027p1m1/fs/coda/inode.c
--- linux-23027p1/fs/coda/inode.c	Mon Aug 23 20:14:44 1999
+++ linux-23027p1m1/fs/coda/inode.c	Mon Nov  8 22:58:51 1999
@@ -38,8 +38,7 @@
 static void coda_put_inode(struct inode *);
 static void coda_delete_inode(struct inode *);
 static void coda_put_super(struct super_block *);
-static int coda_statfs(struct super_block *sb, struct statfs *buf, 
-		       int bufsiz);
+static int coda_statvfs(struct super_block *sb, struct statvfs64 *buf);
 
 /* exported operations */
 struct super_operations coda_super_operations =
@@ -51,7 +50,7 @@
 	coda_notify_change,	/* notify_change */
 	coda_put_super,	        /* put_super */
 	NULL,			/* write_super */
-	coda_statfs,   		/* statfs */
+	coda_statvfs,  		/* statvfs */
 	NULL			/* remount_fs */
 };
 
@@ -237,31 +236,25 @@
         return error;
 }
 
-static int coda_statfs(struct super_block *sb, struct statfs *buf, 
-		       int bufsiz)
+static int coda_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
 	int error;
 
-	memset(&tmp, 0, sizeof(struct statfs));
-
-	error = venus_statfs(sb, &tmp);
+	error = venus_statvfs(sb, buf);
 
 	if (error) {
 		/* fake something like AFS does */
-		tmp.f_blocks = 9000000;
-		tmp.f_bfree  = 9000000;
-		tmp.f_bavail = 9000000;
-		tmp.f_files  = 9000000;
-		tmp.f_ffree  = 9000000;
+		buf->f_blocks = 9000000;
+		buf->f_bfree  = 9000000;
+		buf->f_bavail = 9000000;
+		buf->f_files  = 9000000;
+		buf->f_ffree  = 9000000;
 	}
 
 	/* and fill in the rest */
-	tmp.f_type = CODA_SUPER_MAGIC;
-	tmp.f_bsize = 1024;
-	tmp.f_namelen = CODA_MAXNAMLEN;
-
-	copy_to_user(buf, &tmp, bufsiz);
+	buf->f_type = CODA_SUPER_MAGIC;
+	buf->f_bsize = 1024;
+	buf->f_namelen = CODA_MAXNAMLEN;
 
 	return 0; 
 }
diff -ur linux-23027p1/fs/coda/upcall.c linux-23027p1m1/fs/coda/upcall.c
--- linux-23027p1/fs/coda/upcall.c	Tue Aug 31 21:30:48 1999
+++ linux-23027p1m1/fs/coda/upcall.c	Mon Nov  8 22:58:51 1999
@@ -580,7 +580,7 @@
 	return error;
 }
 
-int venus_statfs(struct super_block *sb, struct statfs *sfs) 
+int venus_statvfs(struct super_block *sb, struct statvfs64 *sfs) 
 { 
         union inputArgs *inp;
         union outputArgs *outp;
diff -ur linux-23027p1/fs/devpts/inode.c linux-23027p1m1/fs/devpts/inode.c
--- linux-23027p1/fs/devpts/inode.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/devpts/inode.c	Mon Nov  8 22:58:51 1999
@@ -57,7 +57,7 @@
 #endif
 }
 
-static int devpts_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int devpts_statvfs(struct super_block *sb, struct statvfs64 *buf);
 static void devpts_read_inode(struct inode *inode);
 static void devpts_write_inode(struct inode *inode);
 
@@ -69,7 +69,7 @@
 	NULL,			/* notify_change */
 	devpts_put_super,
 	NULL,			/* write_super */
-	devpts_statfs,
+	devpts_statvfs,
 	NULL,			/* remount_fs */
 	NULL,			/* clear_inode */
 };
@@ -244,19 +244,17 @@
 	return NULL;
 }
 
-static int devpts_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int devpts_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = DEVPTS_SUPER_MAGIC;
-	tmp.f_bsize = 1024;
-	tmp.f_blocks = 0;
-	tmp.f_bfree = 0;
-	tmp.f_bavail = 0;
-	tmp.f_files = 0;
-	tmp.f_ffree = 0;
-	tmp.f_namelen = NAME_MAX;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = DEVPTS_SUPER_MAGIC;
+	buf->f_bsize = 1024;
+	buf->f_blocks = 0;
+	buf->f_bfree = 0;
+	buf->f_bavail = 0;
+	buf->f_files = 0;
+	buf->f_ffree = 0;
+	buf->f_namelen = NAME_MAX;
+	return 0;
 }
 
 static void devpts_read_inode(struct inode *inode)
diff -ur linux-23027p1/fs/efs/super.c linux-23027p1m1/fs/efs/super.c
--- linux-23027p1/fs/efs/super.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/efs/super.c	Mon Nov  8 22:58:51 1999
@@ -13,6 +13,8 @@
 #include <linux/efs_vh.h>
 #include <linux/efs_fs_sb.h>
 
+static int efs_statvfs(struct super_block *s, struct statvfs64 *buf);
+
 static struct file_system_type efs_fs_type = {
 	"efs",			/* filesystem name */
 	FS_REQUIRES_DEV,	/* fs_flags */
@@ -28,7 +30,7 @@
 	NULL,		/* notify_change */
 	efs_put_super,	/* put_super */
 	NULL,		/* write_super */
-	efs_statfs,	/* statfs */
+	efs_statvfs,	/* statvfs */
 	NULL		/* remount */
 };
 
@@ -231,24 +233,23 @@
 	MOD_DEC_USE_COUNT;
 }
 
-int efs_statfs(struct super_block *s, struct statfs *buf, int bufsiz) {
+int efs_statvfs(struct super_block *s, struct statvfs64 *buf) {
 	struct statfs ret;
 	struct efs_sb_info *sb = SUPER_INFO(s);
 
-	ret.f_type    = EFS_SUPER_MAGIC;	/* efs magic number */
-	ret.f_bsize   = EFS_BLOCKSIZE;		/* blocksize */
-	ret.f_blocks  = sb->total_groups *	/* total data blocks */
+	buf->f_type    = EFS_SUPER_MAGIC;	/* efs magic number */
+	buf->f_bsize   = EFS_BLOCKSIZE;		/* blocksize */
+	buf->f_blocks  = sb->total_groups *	/* total data blocks */
 			(sb->group_size - sb->inode_blocks);
-	ret.f_bfree   = sb->data_free;		/* free data blocks */
-	ret.f_bavail  = sb->data_free;		/* free blocks for non-root */
-	ret.f_files   = sb->total_groups *	/* total inodes */
+	buf->f_bfree   = sb->data_free;		/* free data blocks */
+	buf->f_bavail  = sb->data_free;		/* free blocks for non-root */
+	buf->f_files   = sb->total_groups *	/* total inodes */
 			sb->inode_blocks *
 			(EFS_BLOCKSIZE / sizeof(struct efs_dinode));
-	ret.f_ffree   = sb->inode_free;	/* free inodes */
-	ret.f_fsid.val[0] = (sb->fs_magic >> 16) & 0xffff; /* fs ID */
-	ret.f_fsid.val[1] =  sb->fs_magic        & 0xffff; /* fs ID */
-	ret.f_namelen = EFS_MAXNAMELEN;		/* max filename length */
+	buf->f_ffree   = sb->inode_free;	/* free inodes */
+	buf->f_fsid.val[0] = (sb->fs_magic >> 16) & 0xffff; /* fs ID */
+	buf->f_fsid.val[1] =  sb->fs_magic        & 0xffff; /* fs ID */
+	buf->f_namelen = EFS_MAXNAMELEN;		/* max filename length */
 
-	return copy_to_user(buf, &ret, bufsiz) ? -EFAULT : 0;
+	return 0;
 }
-
diff -ur linux-23027p1/fs/ext2/super.c linux-23027p1m1/fs/ext2/super.c
--- linux-23027p1/fs/ext2/super.c	Thu Oct 28 23:23:10 1999
+++ linux-23027p1m1/fs/ext2/super.c	Mon Nov  8 22:58:51 1999
@@ -128,7 +128,7 @@
 	NULL,
 	ext2_put_super,
 	ext2_write_super,
-	ext2_statfs,
+	ext2_statvfs,
 	ext2_remount
 };
 
@@ -750,10 +750,9 @@
 
 #endif
 
-int ext2_statfs (struct super_block * sb, struct statfs * buf, int bufsiz)
+int ext2_statvfs (struct super_block * sb, struct statvfs64 * buf)
 {
 	unsigned long overhead;
-	struct statfs tmp;
 	int	ngroups, i;
 
 	if (test_opt (sb, MINIX_DF))
@@ -793,15 +792,15 @@
 			     (2 + sb->u.ext2_sb.s_itb_per_group));
 	}
 
-	tmp.f_type = EXT2_SUPER_MAGIC;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = le32_to_cpu(sb->u.ext2_sb.s_es->s_blocks_count) - overhead;
-	tmp.f_bfree = ext2_count_free_blocks (sb);
-	tmp.f_bavail = tmp.f_bfree - le32_to_cpu(sb->u.ext2_sb.s_es->s_r_blocks_count);
-	if (tmp.f_bfree < le32_to_cpu(sb->u.ext2_sb.s_es->s_r_blocks_count))
-		tmp.f_bavail = 0;
-	tmp.f_files = le32_to_cpu(sb->u.ext2_sb.s_es->s_inodes_count);
-	tmp.f_ffree = ext2_count_free_inodes (sb);
-	tmp.f_namelen = EXT2_NAME_LEN;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = EXT2_SUPER_MAGIC;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = le32_to_cpu(sb->u.ext2_sb.s_es->s_blocks_count) - overhead;
+	buf->f_bfree = ext2_count_free_blocks (sb);
+	buf->f_bavail = buf->f_bfree - le32_to_cpu(sb->u.ext2_sb.s_es->s_r_blocks_count);
+	if (buf->f_bfree < le32_to_cpu(sb->u.ext2_sb.s_es->s_r_blocks_count))
+		buf->f_bavail = 0;
+	buf->f_files = le32_to_cpu(sb->u.ext2_sb.s_es->s_inodes_count);
+	buf->f_ffree = ext2_count_free_inodes (sb);
+	buf->f_namelen = EXT2_NAME_LEN;
+	return 0;
 }
diff -ur linux-23027p1/fs/fat/fatfs_syms.c linux-23027p1m1/fs/fat/fatfs_syms.c
--- linux-23027p1/fs/fat/fatfs_syms.c	Tue Oct 26 21:21:46 1999
+++ linux-23027p1m1/fs/fat/fatfs_syms.c	Mon Nov  8 22:58:51 1999
@@ -43,7 +43,8 @@
 EXPORT_SYMBOL(fat_search_long);
 EXPORT_SYMBOL(fat_readdir);
 EXPORT_SYMBOL(fat_scan);
-EXPORT_SYMBOL(fat_statfs);
+EXPORT_SYMBOL(fat_statvfs);
+EXPORT_SYMBOL(fat_pathconf);
 EXPORT_SYMBOL(fat_uni2esc);
 EXPORT_SYMBOL(fat_unlock_creation);
 EXPORT_SYMBOL(fat_write_inode);
diff -ur linux-23027p1/fs/fat/inode.c linux-23027p1m1/fs/fat/inode.c
--- linux-23027p1/fs/fat/inode.c	Sat Nov  6 02:27:28 1999
+++ linux-23027p1m1/fs/fat/inode.c	Mon Nov  8 22:58:51 1999
@@ -413,7 +413,7 @@
 	fat_notify_change,
 	fat_put_super,
 	NULL,		/* write_super */
-	fat_statfs,
+	fat_statvfs,
 	NULL,		/* remount */
 	fat_clear_inode
 };
@@ -707,14 +707,13 @@
 	return NULL;
 }
 
-int fat_statfs(struct super_block *sb,struct statfs *buf, int bufsiz)
+int fat_statvfs(struct super_block *sb,struct statvfs64 *buf)
 {
 	int free,nr;
-	struct statfs tmp;
        
 	if (MSDOS_SB(sb)->cvf_format &&
-	    MSDOS_SB(sb)->cvf_format->cvf_statfs)
-		return MSDOS_SB(sb)->cvf_format->cvf_statfs(sb,buf,bufsiz);
+	    MSDOS_SB(sb)->cvf_format->cvf_statvfs)
+		return MSDOS_SB(sb)->cvf_format->cvf_statvfs(sb,buf);
 	  
 	lock_fat(sb);
 	if (MSDOS_SB(sb)->free_clusters != -1)
@@ -726,15 +725,15 @@
 		MSDOS_SB(sb)->free_clusters = free;
 	}
 	unlock_fat(sb);
-	tmp.f_type = sb->s_magic;
-	tmp.f_bsize = MSDOS_SB(sb)->cluster_size*SECTOR_SIZE;
-	tmp.f_blocks = MSDOS_SB(sb)->clusters;
-	tmp.f_bfree = free;
-	tmp.f_bavail = free;
-	tmp.f_files = 0;
-	tmp.f_ffree = 0;
-	tmp.f_namelen = MSDOS_SB(sb)->options.isvfat ? 260 : 12;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = sb->s_magic;
+	buf->f_bsize = MSDOS_SB(sb)->cluster_size*SECTOR_SIZE;
+	buf->f_blocks = MSDOS_SB(sb)->clusters;
+	buf->f_bfree = free;
+	buf->f_bavail = free;
+	buf->f_files = 0;
+	buf->f_ffree = 0;
+	buf->f_namelen = MSDOS_SB(sb)->options.isvfat ? 260 : 12;
+	return 0;
 }
 
 static int is_exec(char *extension)
diff -ur linux-23027p1/fs/hfs/super.c linux-23027p1m1/fs/hfs/super.c
--- linux-23027p1/fs/hfs/super.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/hfs/super.c	Mon Nov  8 22:58:51 1999
@@ -36,7 +36,7 @@
 
 static void hfs_read_inode(struct inode *);
 static void hfs_put_super(struct super_block *);
-static int hfs_statfs(struct super_block *, struct statfs *, int);
+static int hfs_statvfs(struct super_block *, struct statvfs64 *);
 static void hfs_write_super(struct super_block *);
 
 /*================ Global variables ================*/
@@ -49,7 +49,7 @@
 	hfs_notify_change,	/* notify_change - in inode.c */
 	hfs_put_super,		/* put_super */
 	hfs_write_super,	/* write_super */
-	hfs_statfs,		/* statfs */
+	hfs_statvfs,		/* statvfs */
 	NULL			/* remount_fs */
 };
 
@@ -136,29 +136,28 @@
 }
 
 /*
- * hfs_statfs()
+ * hfs_statvfs()
  *
- * This is the statfs() entry in the super_operations structure for
+ * This is the statvfs() entry in the super_operations structure for
  * HFS filesystems.  The purpose is to return various data about the
  * filesystem.
  *
  * changed f_files/f_ffree to reflect the fs_ablock/free_ablocks.
  */
-static int hfs_statfs(struct super_block *sb, struct statfs *buf, int len)
+static int hfs_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
 	struct hfs_mdb *mdb = HFS_SB(sb)->s_mdb;
-	struct statfs tmp;
 
-	tmp.f_type = HFS_SUPER_MAGIC;
-	tmp.f_bsize = HFS_SECTOR_SIZE;
-	tmp.f_blocks = mdb->alloc_blksz * mdb->fs_ablocks;
-	tmp.f_bfree = mdb->alloc_blksz * mdb->free_ablocks;
-	tmp.f_bavail = tmp.f_bfree;
-	tmp.f_files = mdb->fs_ablocks;  
-	tmp.f_ffree = mdb->free_ablocks;
-	tmp.f_namelen = HFS_NAMELEN;
+	buf->f_type = HFS_SUPER_MAGIC;
+	buf->f_bsize = HFS_SECTOR_SIZE;
+	buf->f_blocks = mdb->alloc_blksz * mdb->fs_ablocks;
+	buf->f_bfree = mdb->alloc_blksz * mdb->free_ablocks;
+	buf->f_bavail = buf->f_bfree;
+	buf->f_files = mdb->fs_ablocks;  
+	buf->f_ffree = mdb->free_ablocks;
+	buf->f_namelen = HFS_NAMELEN;
 
-	return copy_to_user(buf, &tmp, len) ? -EFAULT : 0;
+	return 0;
 }
 
 /*
diff -ur linux-23027p1/fs/hpfs/super.c linux-23027p1m1/fs/hpfs/super.c
--- linux-23027p1/fs/hpfs/super.c	Sun Jun 27 20:10:41 1999
+++ linux-23027p1m1/fs/hpfs/super.c	Mon Nov  8 22:58:51 1999
@@ -132,22 +132,21 @@
 	return count;
 }
 
-int hpfs_statfs(struct super_block *s, struct statfs *buf, int bufsiz)
+int hpfs_statvfs(struct super_block *s, struct statvfs64 *buf)
 {
-	struct statfs tmp;
 	/*if (s->s_hpfs_n_free == -1) {*/
 		s->s_hpfs_n_free = count_bitmaps(s);
 		s->s_hpfs_n_free_dnodes = hpfs_count_one_bitmap(s, s->s_hpfs_dmap);
 	/*}*/
-	tmp.f_type = s->s_magic;
-	tmp.f_bsize = 512;
-	tmp.f_blocks = s->s_hpfs_fs_size;
-	tmp.f_bfree = s->s_hpfs_n_free;
-	tmp.f_bavail = s->s_hpfs_n_free;
-	tmp.f_files = s->s_hpfs_dirband_size / 4;
-	tmp.f_ffree = s->s_hpfs_n_free_dnodes;
-	tmp.f_namelen = 254;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = s->s_magic;
+	buf->f_bsize = 512;
+	buf->f_blocks = s->s_hpfs_fs_size;
+	buf->f_bfree = s->s_hpfs_n_free;
+	buf->f_bavail = s->s_hpfs_n_free;
+	buf->f_files = s->s_hpfs_dirband_size / 4;
+	buf->f_ffree = s->s_hpfs_n_free_dnodes;
+	buf->f_namelen = 254;
+	return 0;
 }
 
 /* Super operations */
@@ -161,7 +160,7 @@
         hpfs_notify_change,		/* notify_change */
         hpfs_put_super,			/* put_super */
         NULL,				/* write_super */
-        hpfs_statfs,			/* statfs */
+        hpfs_statvfs,			/* statvfs */
         hpfs_remount_fs,		/* remount_fs */
 	NULL,				/* clear inode */
 	NULL,				/* umount_begin */
diff -ur linux-23027p1/fs/isofs/inode.c linux-23027p1m1/fs/isofs/inode.c
--- linux-23027p1/fs/isofs/inode.c	Fri Nov  5 01:50:50 1999
+++ linux-23027p1m1/fs/isofs/inode.c	Mon Nov  8 22:58:51 1999
@@ -74,7 +74,7 @@
 }
 
 static void isofs_read_inode(struct inode *);
-static int isofs_statfs (struct super_block *, struct statfs *, int);
+static int isofs_statvfs (struct super_block *, struct statvfs64 *);
 
 static struct super_operations isofs_sops = {
 	isofs_read_inode,
@@ -84,7 +84,7 @@
 	NULL,			/* notify_change */
 	isofs_put_super,
 	NULL,			/* write_super */
-	isofs_statfs,
+	isofs_statvfs,
 	NULL
 };
 
@@ -905,20 +905,18 @@
 	return NULL;
 }
 
-static int isofs_statfs (struct super_block *sb, struct statfs *buf, int bufsiz)
+static int isofs_statvfs (struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = ISOFS_SUPER_MAGIC;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = (sb->u.isofs_sb.s_nzones
+	buf->f_type = ISOFS_SUPER_MAGIC;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = (sb->u.isofs_sb.s_nzones
                   << (sb->u.isofs_sb.s_log_zone_size - sb->s_blocksize_bits));
-	tmp.f_bfree = 0;
-	tmp.f_bavail = 0;
-	tmp.f_files = sb->u.isofs_sb.s_ninodes;
-	tmp.f_ffree = 0;
-	tmp.f_namelen = NAME_MAX;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_bfree = 0;
+	buf->f_bavail = 0;
+	buf->f_files = sb->u.isofs_sb.s_ninodes;
+	buf->f_ffree = 0;
+	buf->f_namelen = NAME_MAX;
+	return 0;
 }
 
 /* Life is simpler than for other filesystem since we never
@@ -1008,8 +1006,8 @@
 	goto abort;
 
 abort_beyond_end:
-	printk("_isofs_bmap: block >= EOF (%ld, %ld)\n",
-	       iblock, (unsigned long) inode->i_size);
+	printk("_isofs_bmap: block >= EOF (%ld, %Ld)\n",
+	       iblock, inode->i_size);
 	goto abort;
 
 abort_too_many_sections:
@@ -1228,7 +1226,7 @@
 #endif
 
 #ifdef DEBUG
-	printk("Get inode %x: %d %d: %d\n",inode->i_ino, block,
+	printk("Get inode %x: %d %d: %Ld\n",inode->i_ino, block,
 	       ((int)pnt) & 0x3ff, inode->i_size);
 #endif
 
diff -ur linux-23027p1/fs/minix/inode.c linux-23027p1m1/fs/minix/inode.c
--- linux-23027p1/fs/minix/inode.c	Tue Aug 31 21:23:03 1999
+++ linux-23027p1m1/fs/minix/inode.c	Mon Nov  8 22:58:51 1999
@@ -29,7 +29,7 @@
 
 static void minix_read_inode(struct inode * inode);
 static void minix_write_inode(struct inode * inode);
-static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int minix_statvfs(struct super_block *sb, struct statvfs64 *buf);
 static int minix_remount (struct super_block * sb, int * flags, char * data);
 
 static void minix_delete_inode(struct inode *inode)
@@ -87,7 +87,7 @@
 	NULL,			/* notify_change */
 	minix_put_super,
 	minix_write_super,
-	minix_statfs,
+	minix_statvfs,
 	minix_remount
 };
 
@@ -331,19 +331,17 @@
 	return NULL;
 }
 
-static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int minix_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = sb->s_magic;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = (sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone) << sb->u.minix_sb.s_log_zone_size;
-	tmp.f_bfree = minix_count_free_blocks(sb);
-	tmp.f_bavail = tmp.f_bfree;
-	tmp.f_files = sb->u.minix_sb.s_ninodes;
-	tmp.f_ffree = minix_count_free_inodes(sb);
-	tmp.f_namelen = sb->u.minix_sb.s_namelen;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = sb->s_magic;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = (sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone) << sb->u.minix_sb.s_log_zone_size;
+	buf->f_bfree = minix_count_free_blocks(sb);
+	buf->f_bavail = buf->f_bfree;
+	buf->f_files = sb->u.minix_sb.s_ninodes;
+	buf->f_ffree = minix_count_free_inodes(sb);
+	buf->f_namelen = sb->u.minix_sb.s_namelen;
+	return 0;
 }
 
 /*
diff -ur linux-23027p1/fs/ncpfs/inode.c linux-23027p1m1/fs/ncpfs/inode.c
--- linux-23027p1/fs/ncpfs/inode.c	Sat Nov  6 00:22:05 1999
+++ linux-23027p1m1/fs/ncpfs/inode.c	Mon Nov  8 22:58:51 1999
@@ -34,7 +34,7 @@
 static void ncp_put_inode(struct inode *);
 static void ncp_delete_inode(struct inode *);
 static void ncp_put_super(struct super_block *);
-static int  ncp_statfs(struct super_block *, struct statfs *, int);
+static int  ncp_statvfs(struct super_block *, struct statvfs64 *);
 
 static struct super_operations ncp_sops =
 {
@@ -45,7 +45,7 @@
 	ncp_notify_change,	/* notify change */
 	ncp_put_super,		/* put superblock */
 	NULL,			/* write superblock */
-	ncp_statfs,		/* stat filesystem */
+	ncp_statvfs,		/* stat filesystem */
 	NULL                    /* remount */
 };
 
@@ -485,25 +485,23 @@
 	MOD_DEC_USE_COUNT;
 }
 
-static int ncp_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int ncp_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
 	/* We cannot say how much disk space is left on a mounted
 	   NetWare Server, because free space is distributed over
 	   volumes, and the current user might have disk quotas. So
 	   free space is not that simple to determine. Our decision
 	   here is to err conservatively. */
 
-	tmp.f_type = NCP_SUPER_MAGIC;
-	tmp.f_bsize = NCP_BLOCK_SIZE;
-	tmp.f_blocks = 0;
-	tmp.f_bfree = 0;
-	tmp.f_bavail = 0;
-	tmp.f_files = -1;
-	tmp.f_ffree = -1;
-	tmp.f_namelen = 12;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = NCP_SUPER_MAGIC;
+	buf->f_bsize = NCP_BLOCK_SIZE;
+	buf->f_blocks = 0;
+	buf->f_bfree = 0;
+	buf->f_bavail = 0;
+	buf->f_files = -1;
+	buf->f_ffree = -1;
+	buf->f_namelen = 12;
+	return 0;
 }
 
 int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
diff -ur linux-23027p1/fs/nfs/inode.c linux-23027p1m1/fs/nfs/inode.c
--- linux-23027p1/fs/nfs/inode.c	Fri Nov  5 01:48:15 1999
+++ linux-23027p1m1/fs/nfs/inode.c	Mon Nov  8 22:58:51 1999
@@ -46,7 +46,7 @@
 static int  nfs_notify_change(struct dentry *, struct iattr *);
 static void nfs_put_super(struct super_block *);
 static void nfs_umount_begin(struct super_block *);
-static int  nfs_statfs(struct super_block *, struct statfs *, int);
+static int  nfs_statvfs(struct super_block *, struct statvfs64 *);
 
 static struct super_operations nfs_sops = { 
 	nfs_read_inode,		/* read inode */
@@ -56,7 +56,7 @@
 	nfs_notify_change,	/* notify change */
 	nfs_put_super,		/* put superblock */
 	NULL,			/* write superblock */
-	nfs_statfs,		/* stat filesystem */
+	nfs_statvfs,		/* stat filesystem */
 	NULL,			/* no remount */
 	NULL,			/* no clear inode */
 	nfs_umount_begin	/* umount attempt begin */
@@ -370,27 +370,26 @@
 }
 
 static int
-nfs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+nfs_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
 	int error;
 	struct nfs_fsinfo res;
-	struct statfs tmp;
 
-	error = nfs_proc_statfs(&sb->u.nfs_sb.s_server, &sb->u.nfs_sb.s_root,
+	error = nfs_proc_statvfs(&sb->u.nfs_sb.s_server, &sb->u.nfs_sb.s_root,
 		&res);
 	if (error) {
-		printk("nfs_statfs: statfs error = %d\n", -error);
+		printk("nfs_statvfs: statfs error = %d\n", -error);
 		res.bsize = res.blocks = res.bfree = res.bavail = 0;
 	}
-	tmp.f_type = NFS_SUPER_MAGIC;
-	tmp.f_bsize = res.bsize;
-	tmp.f_blocks = res.blocks;
-	tmp.f_bfree = res.bfree;
-	tmp.f_bavail = res.bavail;
-	tmp.f_files = 0;
-	tmp.f_ffree = 0;
-	tmp.f_namelen = NAME_MAX;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = NFS_SUPER_MAGIC;
+	buf->f_bsize = res.bsize;
+	buf->f_blocks = res.blocks;
+	buf->f_bfree = res.bfree;
+	buf->f_bavail = res.bavail;
+	buf->f_files = 0;
+	buf->f_ffree = 0;
+	buf->f_namelen = NAME_MAX;
+	return 0;
 }
 
 /*
@@ -680,7 +679,7 @@
 	 */
 	if (attr->ia_valid & ATTR_SIZE) {
 		if (attr->ia_size != fattr.size)
-			printk("nfs_notify_change: attr=%Ld, fattr=%d??\n",
+			printk("nfs_notify_change: attr.size=%Ld, fattr.size=%Ld??\n",
 				attr->ia_size, fattr.size);
 		inode->i_size  = attr->ia_size;
 		inode->i_mtime = fattr.mtime.seconds;
diff -ur linux-23027p1/fs/nfsd/nfs3proc.c linux-23027p1m1/fs/nfsd/nfs3proc.c
--- linux-23027p1/fs/nfsd/nfs3proc.c	Mon Apr 12 20:07:36 1999
+++ linux-23027p1m1/fs/nfsd/nfs3proc.c	Mon Nov  8 22:58:51 1999
@@ -427,16 +427,16 @@
  * Get file system info
  */
 static int
-nfsd3_proc_statfs(struct svc_rqst * rqstp, struct nfsd_fhandle   *argp,
+nfsd3_proc_statvfs(struct svc_rqst * rqstp, struct nfsd_fhandle   *argp,
 					  struct nfsd3_statfsres *resp)
 {
 	int	nfserr;
 
-	dprintk("nfsd: STATFS   %x/%ld\n",
+	dprintk("nfsd: STATVFS   %x/%ld\n",
 				SVCFH_DEV(&argp->fh),
 				SVCFH_INO(&argp->fh));
 
-	nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats);
+	nfserr = nfsd_statvfs(rqstp, &argp->fh, &resp->stats);
 	fh_put(&argp->fh);
 	RETURN(nfserr);
 }
@@ -479,7 +479,7 @@
   PROC(mkdir,	 createargs,	diropres,	fhandle, RC_REPLBUFF),
   PROC(rmdir,	 diropargs,	void,		void,	 RC_REPLSTAT),
   PROC(readdir,	 readdirargs,	readdirres,	void,	 RC_REPLSTAT),
-  PROC(statfs,	 fhandle,	statfsres,	void,	 RC_NOCACHE),
+  PROC(statvfs,	 fhandle,	statfsres,	void,	 RC_NOCACHE),
 };
 
 
diff -ur linux-23027p1/fs/nfsd/nfs3xdr.c linux-23027p1m1/fs/nfsd/nfs3xdr.c
--- linux-23027p1/fs/nfsd/nfs3xdr.c	Mon Apr  7 21:35:31 1997
+++ linux-23027p1m1/fs/nfsd/nfs3xdr.c	Mon Nov  8 22:58:51 1999
@@ -690,8 +690,8 @@
 nfs3svc_encode_statfsres(struct svc_rqst *rqstp, u32 *p,
 					struct nfsd3_statfsres *resp)
 {
-	struct statfs	*s = &resp->stats;
-	u64		bs = s->f_bsize;
+	struct statvfs64 *s = &resp->stats;
+	u64		  bs = s->f_bsize;
 
 	*p++ = xdr_zero;	/* no post_op_attr */
 
diff -ur linux-23027p1/fs/nfsd/nfsproc.c linux-23027p1m1/fs/nfsd/nfsproc.c
--- linux-23027p1/fs/nfsd/nfsproc.c	Mon Apr 12 20:08:18 1999
+++ linux-23027p1m1/fs/nfsd/nfsproc.c	Mon Nov  8 22:58:51 1999
@@ -471,14 +471,14 @@
  * Get file system info
  */
 static int
-nfsd_proc_statfs(struct svc_rqst * rqstp, struct nfsd_fhandle   *argp,
+nfsd_proc_statvfs(struct svc_rqst * rqstp, struct nfsd_fhandle   *argp,
 					  struct nfsd_statfsres *resp)
 {
 	int	nfserr;
 
-	dprintk("nfsd: STATFS   %p\n", SVCFH_DENTRY(&argp->fh));
+	dprintk("nfsd: STATVFS   %p\n", SVCFH_DENTRY(&argp->fh));
 
-	nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats);
+	nfserr = nfsd_statvfs(rqstp, &argp->fh, &resp->stats);
 	fh_put(&argp->fh);
 	RETURN(nfserr);
 }
@@ -519,7 +519,7 @@
   PROC(mkdir,	 createargs,	diropres,	fhandle,	RC_REPLBUFF),
   PROC(rmdir,	 diropargs,	void,		none,		RC_REPLSTAT),
   PROC(readdir,	 readdirargs,	readdirres,	none,		RC_REPLBUFF),
-  PROC(statfs,	 fhandle,	statfsres,	none,		RC_NOCACHE),
+  PROC(statvfs,	 fhandle,	statfsres,	none,		RC_NOCACHE),
 };
 
 
diff -ur linux-23027p1/fs/nfsd/nfsxdr.c linux-23027p1m1/fs/nfsd/nfsxdr.c
--- linux-23027p1/fs/nfsd/nfsxdr.c	Wed Nov 26 23:08:38 1997
+++ linux-23027p1m1/fs/nfsd/nfsxdr.c	Mon Nov  8 22:58:51 1999
@@ -412,7 +412,7 @@
 nfssvc_encode_statfsres(struct svc_rqst *rqstp, u32 *p,
 					struct nfsd_statfsres *resp)
 {
-	struct statfs	*stat = &resp->stats;
+	struct statvfs64	*stat = &resp->stats;
 
 	*p++ = htonl(8 * 1024);		/* max transfer size */
 	*p++ = htonl(stat->f_bsize);
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
@@ -1298,12 +1299,11 @@
  * N.B. After this call fhp needs an fh_put
  */
 int
-nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct statfs *stat)
+nfsd_statvfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct statvfs64 *stat)
 {
 	struct dentry		*dentry;
 	struct inode		*inode;
 	struct super_block	*sb;
-	mm_segment_t		oldfs;
 	int			err;
 
 	err = fh_verify(rqstp, fhp, 0, MAY_NOP);
@@ -1313,13 +1313,10 @@
 	inode = dentry->d_inode;
 
 	err = nfserr_io;
-	if (!(sb = inode->i_sb) || !sb->s_op->statfs)
+	if (!(sb = inode->i_sb) || !sb->s_op->statvfs)
 		goto out;
 
-	oldfs = get_fs();
-	set_fs (KERNEL_DS);
-	sb->s_op->statfs(sb, stat, sizeof(*stat));
-	set_fs (oldfs);
+	sb->s_op->statvfs(sb, stat);
 	err = 0;
 
 out:
diff -ur linux-23027p1/fs/ntfs/fs.c linux-23027p1m1/fs/ntfs/fs.c
--- linux-23027p1/fs/ntfs/fs.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/ntfs/fs.c	Mon Nov  8 22:58:51 1999
@@ -813,34 +844,33 @@
 }
 
 /* Called by the kernel when asking for stats */
-static int ntfs_statfs(struct super_block *sb, struct statfs *sf, int bufsize)
+static int ntfs_statvfs(struct super_block *sb, struct statvfs64 *sf)
 {
-	struct statfs fs;
 	struct inode *mft;
 	ntfs_volume *vol;
 	int error;
 
-	ntfs_debug(DEBUG_OTHER, "ntfs_statfs\n");
+	ntfs_debug(DEBUG_OTHER, "ntfs_statvfs\n");
 	vol=NTFS_SB2VOL(sb);
-	memset(&fs,0,sizeof(fs));
-	fs.f_type=NTFS_SUPER_MAGIC;
-	fs.f_bsize=vol->clustersize;
+	sf->f_type=NTFS_SUPER_MAGIC;
+	sf->f_bsize=vol->clustersize;
 
-	error = ntfs_get_volumesize( NTFS_SB2VOL( sb ), &fs.f_blocks );
+	error = ntfs_get_volumesize( NTFS_SB2VOL( sb ), &sf->f_blocks );
 	if( error )
 		return -error;
-	fs.f_bfree=ntfs_get_free_cluster_count(vol->bitmap);
-	fs.f_bavail=fs.f_bfree;
+	sf->f_bfree=ntfs_get_free_cluster_count(vol->bitmap);
+	sf->f_bavail=sf->f_bfree;
 
 	/* Number of files is limited by free space only, so we lie here */
-	fs.f_ffree=0;
+	sf->f_ffree=0;
 	mft=iget(sb,FILE_MFT);
-	fs.f_files=mft->i_size/vol->mft_recordsize;
+	/* So ... we lie... thus this following cast of loff_t value
+	   is ok here.. */
+	sf->f_files = (u_long)mft->i_size / vol->mft_recordsize;
 	iput(mft);
 
 	/* should be read from volume */
-	fs.f_namelen=255;
-	copy_to_user(sf,&fs,bufsize);
+	sf->f_namelen=255;
 	return 0;
 }
 
@@ -865,7 +895,7 @@
 	NULL, /* notify_change */
 	ntfs_put_super,
 	NULL, /* write_super */
-	ntfs_statfs,
+	ntfs_statvfs,
 	ntfs_remount_fs, /* remount */
 	_ntfs_clear_inode, /* clear_inode */ 
 };
diff -ur linux-23027p1/fs/open.c linux-23027p1m1/fs/open.c
--- linux-23027p1/fs/open.c	Sun Oct 31 19:25:38 1999
+++ linux-23027p1m1/fs/open.c	Mon Nov  8 22:58:51 1999
@@ -9,12 +9,14 @@
 #include <linux/file.h>
 #include <linux/smp_lock.h>
 #include <linux/quotaops.h>
+#include <linux/unistd.h>
 
 #include <asm/uaccess.h>
 
 asmlinkage long sys_statfs(const char * path, struct statfs * buf)
 {
 	struct dentry * dentry;
+	struct statvfs64 sbuf64;
 	int error;
 
 	lock_kernel();
@@ -25,10 +27,25 @@
 		struct super_block * sb = inode->i_sb;
 
 		error = -ENODEV;
-		if (sb && sb->s_op && sb->s_op->statfs)
-			error = sb->s_op->statfs(sb, buf, sizeof(struct statfs));
+		if (sb && sb->s_op && sb->s_op->statvfs)
+			error = sb->s_op->statvfs(sb, &sbuf64);
 
 		dput(dentry);
+
+		if (!error) {
+			struct statfs   sbuf;
+			memset(&sbuf,0,sizeof(sbuf));
+			sbuf.f_type    = sbuf64.f_type;
+			sbuf.f_bsize   = sbuf64.f_bsize;
+			sbuf.f_blocks  = sbuf64.f_blocks;
+			sbuf.f_bfree   = sbuf64.f_bfree;
+			sbuf.f_bavail  = sbuf64.f_bavail;
+			sbuf.f_files   = sbuf64.f_files;
+			sbuf.f_ffree   = sbuf64.f_ffree;
+			sbuf.f_fsid    = sbuf64.f_fsid;
+			sbuf.f_namelen = sbuf64.f_namelen;
+			error = copy_to_user(buf, &sbuf, sizeof(*buf));
+		}
 	}
 	unlock_kernel();
 	return error;
@@ -38,6 +55,7 @@
 {
 	struct file * file;
 	struct super_block * sb;
+	struct statvfs64 sbuf64;
 	int error;
 
 	error = -EBADF;
@@ -47,24 +65,113 @@
 	error = -ENODEV;
 	sb = file->f_dentry->d_inode->i_sb;
 	lock_kernel();
-	if (sb && sb->s_op && sb->s_op->statfs)
-		error = sb->s_op->statfs(sb, buf, sizeof(struct statfs));
+	if (sb && sb->s_op && sb->s_op->statvfs)
+		error = sb->s_op->statvfs(sb, &sbuf64);
+	if (!error) {
+		struct statfs   sbuf;
+		memset(&sbuf,0,sizeof(sbuf));
+		sbuf.f_type    = sbuf64.f_type;
+		sbuf.f_bsize   = sbuf64.f_bsize;
+		sbuf.f_blocks  = sbuf64.f_blocks;
+		sbuf.f_bfree   = sbuf64.f_bfree;
+		sbuf.f_bavail  = sbuf64.f_bavail;
+		sbuf.f_files   = sbuf64.f_files;
+		sbuf.f_ffree   = sbuf64.f_ffree;
+		sbuf.f_fsid    = sbuf64.f_fsid;
+		sbuf.f_namelen = sbuf64.f_namelen;
+		error = copy_to_user(buf, &sbuf, sizeof(*buf));
+	}
 	unlock_kernel();
 	fput(file);
 out:
 	return error;
 }
 
-int do_truncate(struct dentry *dentry, unsigned long length)
+asmlinkage long sys_statvfs64(const char * path, struct statvfs64 * buf)
+{
+	struct dentry * dentry;
+	int error;
+	struct statvfs64 sbuf64;
+
+	lock_kernel();
+	dentry = namei(path);
+	error = PTR_ERR(dentry);
+	if (!IS_ERR(dentry)) {
+		struct inode * inode = dentry->d_inode;
+
+		error = -ENOSYS;
+		if (inode->i_sb->s_op->statvfs)
+			error = inode->i_sb->s_op->statvfs(inode->i_sb, &sbuf64);
+		dput(dentry);
+		if (!error)
+			error = copy_to_user(buf, &sbuf64, sizeof(*buf));
+	}
+	unlock_kernel();
+	return error;
+}
+
+asmlinkage long sys_fstatvfs64(unsigned int fd, struct statvfs64 * buf)
+{
+	struct file * file;
+	struct inode * inode;
+	struct dentry * dentry;
+	struct super_block * sb;
+	struct statvfs64 sbuf64;
+	int error;
+
+	lock_kernel();
+	error = -EBADF;
+	file = fget(fd);
+	if (!file)
+		goto out;
+	error = -ENOENT;
+	if (!(dentry = file->f_dentry))
+		goto out_putf;
+	if (!(inode = dentry->d_inode))
+		goto out_putf;
+	error = -ENODEV;
+	if (!(sb = inode->i_sb))
+		goto out_putf;
+	error = -ENOSYS;
+	if (sb->s_op->statvfs)
+		error = sb->s_op->statvfs(sb, &sbuf64);
+	if (!error)
+		error = copy_to_user(buf, &sbuf64, sizeof(*buf));
+
+out_putf:
+	fput(file);
+out:
+	unlock_kernel();
+	return error;
+}
+
+long do_truncate(struct dentry *dentry, loff_t length)
 {
 	struct inode *inode = dentry->d_inode;
 	int error;
 	struct iattr newattrs;
 
-	/* Not pretty: "inode->i_size" shouldn't really be "off_t". But it is. */
-	if ((off_t) length < 0)
+	if (length < 0)
 		return -EINVAL;
 
+	if (inode->i_op->pathconf &&
+	    inode->i_op->pathconf(inode,_PC_FILESIZEBITS) <= 32) {
+	  if (length > 0x7fffffffULL) {
+	    /* Target filesystem doesn't support Large Files;
+	       now we presume this means *only* 2G, although some
+	       may have up to 4G ... */
+	    return -EFBIG;
+	  }
+	}
+
+	if (current->rlimfsz.rlim_cur < inode->i_size) {
+		/* If the target size is higher than our current (soft)
+		   file size limit, a SIGXFSZ shall be sent along
+		   with error -EFBIG. */
+		send_sig(SIGXFSZ, current, 0);
+		return -EFBIG;
+	}
+
 	down(&inode->i_sem);
 	newattrs.ia_size = length;
 	newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
@@ -79,11 +186,12 @@
 	return error;
 }
 
-asmlinkage long sys_truncate(const char * path, unsigned long length)
+asmlinkage long sys_truncate(const char * path, unsigned long slength)
 {
 	struct dentry * dentry;
 	struct inode * inode;
 	int error;
+	loff_t length = slength;
 
 	lock_kernel();
 	dentry = namei(path);
@@ -93,7 +201,7 @@
 		goto out;
 	inode = dentry->d_inode;
 
-	error = -EACCES;
+	error = -EISDIR;
 	if (S_ISDIR(inode->i_mode))
 		goto dput_and_out;
 
@@ -109,6 +217,10 @@
 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
 		goto dput_and_out;
 
+	error = -EINVAL;	/* New length may not exceed current size */
+	if (inode->i_size < length)
+		goto dput_and_out;
+
 	error = get_write_access(inode);
 	if (error)
 		goto dput_and_out;
@@ -144,12 +256,120 @@
 		goto out_putf;
 	if (!(inode = dentry->d_inode))
 		goto out_putf;
+	error = -EISDIR;
+	if (S_ISDIR(inode->i_mode))
+		goto out_putf;
+	error = -EACCES;
+	if (!(file->f_mode & FMODE_WRITE))
+		goto out_putf;
+	error = -EPERM;
+	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+		goto out_putf;
+	error = -EINVAL;
+	if (inode->i_size < length)
+		goto out_putf;
+	/* Large File Summit */
+	error = -EFBIG;
+	if (S_ISREG(inode->i_mode) && !(file->f_flags & O_LARGEFILE) &&
+	    !off_t_presentable(inode->i_size))
+		goto out_putf;
+	error = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file,
+				  length<inode->i_size ? length : inode->i_size,
+				  abs(inode->i_size - length));
+	if (!error)
+		error = do_truncate(dentry, length);
+out_putf:
+	fput(file);
+out:
+	unlock_kernel();
+	return error;
+}
+
+#if BITS_PER_LONG < 64
+asmlinkage long sys_truncate64(const char * path, loff_t length)
+{
+	struct dentry * dentry;
+	struct inode * inode;
+	int error;
+
+	lock_kernel();
+	dentry = namei(path);
+
+	error = PTR_ERR(dentry);
+	if (IS_ERR(dentry))
+		goto out;
+	inode = dentry->d_inode;
+
+	error = -EACCES;
+	if (S_ISDIR(inode->i_mode))
+		goto dput_and_out;
+
+	error = permission(inode,MAY_WRITE);
+	if (error)
+		goto dput_and_out;
+
+	error = -EROFS;
+	if (IS_RDONLY(inode))
+		goto dput_and_out;
+
+	error = -EPERM;
+	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+		goto dput_and_out;
+
+	error = -EFBIG;
+	if (inode->i_size < length)
+		goto dput_and_out;
+
+	error = get_write_access(inode);
+	if (error)
+		goto dput_and_out;
+
+	error = locks_verify_area(FLOCK_VERIFY_WRITE, inode, NULL,
+				  length < inode->i_size ? length : inode->i_size,
+				  abs(inode->i_size - length));
+	if (!error) {
+		DQUOT_INIT(inode);
+		error = do_truncate(dentry, length);
+	}
+	put_write_access(inode);
+dput_and_out:
+	dput(dentry);
+out:
+	unlock_kernel();
+	return error;
+}
+
+asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length)
+{
+	struct inode * inode;
+	struct dentry *dentry;
+	struct file * file;
+	int error;
+
+	lock_kernel();
+	error = -EBADF;
+	file = fget(fd);
+	if (!file)
+		goto out;
+	error = -ENOENT;
+	if (!(dentry = file->f_dentry))
+		goto out_putf;
+	if (!(inode = dentry->d_inode))
+		goto out_putf;
 	error = -EACCES;
 	if (S_ISDIR(inode->i_mode) || !(file->f_mode & FMODE_WRITE))
 		goto out_putf;
 	error = -EPERM;
 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
 		goto out_putf;
+	error = -EINVAL;
+	if (inode->i_size < length || length < 0)
+		goto out_putf;
+	/* Large File Summit */
+	error = -EFBIG;
+	if (S_ISREG(inode->i_mode) && !(file->f_flags & O_LARGEFILE) &&
+	    !off_t_presentable(inode->i_size))
+		goto out_putf;
 	error = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file,
 				  length<inode->i_size ? length : inode->i_size,
 				  abs(inode->i_size - length));
@@ -162,6 +382,7 @@
 out:
 	return error;
 }
+#endif /* BITS_PER_LONG < 64 */
 
 #if !(defined(__alpha__) || defined(__ia64__))
 
@@ -653,6 +874,16 @@
 			goto cleanup_dentry;
 	}
 
+	/* L-F-S spec: 3.1.1.3:  If open() is done without  O_LARGEFILE,
+	   and the target (regular) file size exceeds that presentable with
+	   'off_t' datatype in the system, the open shall be rejected with
+	   EOVERFLOW  error. */
+	if (S_ISREG(inode->i_mode) && !(flags & O_LARGEFILE) &&
+	    !off_t_presentable(inode->i_size)) {
+		error = -EOVERFLOW;
+		goto cleanup_all;
+	}
+
 	f->f_dentry = dentry;
 	f->f_pos = 0;
 	f->f_reada = 0;
@@ -786,8 +1017,7 @@
 #ifndef __alpha__
 
 /*
- * For backward compatibility?  Maybe this should be moved
- * into arch/i386 instead?
+ * This one is used at about all platforms, except Alpha..
  */
 asmlinkage long sys_creat(const char * pathname, int mode)
 {
@@ -827,7 +1057,7 @@
  * or not in the open-files bitmap.  dup2 uses this to retain the fd
  * without races.
  */
-int do_close(unsigned int fd, int release)
+long do_close(unsigned int fd, int release)
 {
 	int error;
 	struct file * filp;
diff -ur linux-23027p1/fs/proc/inode.c linux-23027p1m1/fs/proc/inode.c
--- linux-23027p1/fs/proc/inode.c	Mon Nov  8 22:57:35 1999
+++ linux-23027p1m1/fs/proc/inode.c	Mon Nov  8 22:58:51 1999
@@ -107,7 +107,7 @@
 	NULL,
 	proc_put_super,
 	NULL,
-	proc_statfs,
+	proc_statvfs,
 	NULL
 };
 
@@ -236,19 +236,17 @@
 	return NULL;
 }
 
-int proc_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+int proc_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = PROC_SUPER_MAGIC;
-	tmp.f_bsize = PAGE_SIZE/sizeof(long);
-	tmp.f_blocks = 0;
-	tmp.f_bfree = 0;
-	tmp.f_bavail = 0;
-	tmp.f_files = 0;
-	tmp.f_ffree = 0;
-	tmp.f_namelen = NAME_MAX;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = PROC_SUPER_MAGIC;
+	buf->f_bsize = PAGE_SIZE/sizeof(long);
+	buf->f_blocks = 0;
+	buf->f_bfree = 0;
+	buf->f_bavail = 0;
+	buf->f_files = 0;
+	buf->f_ffree = 0;
+	buf->f_namelen = NAME_MAX;
+	return 0;
 }
 
 void proc_read_inode(struct inode * inode)
diff -ur linux-23027p1/fs/qnx4/inode.c linux-23027p1m1/fs/qnx4/inode.c
--- linux-23027p1/fs/qnx4/inode.c	Sat Oct  2 17:49:29 1999
+++ linux-23027p1m1/fs/qnx4/inode.c	Mon Nov  8 22:58:51 1999
@@ -124,7 +124,7 @@
 static void qnx4_put_super(struct super_block *sb);
 static void qnx4_read_inode(struct inode *);
 static int qnx4_remount(struct super_block *sb, int *flags, char *data);
-static int qnx4_statfs(struct super_block *, struct statfs *, int);
+static int qnx4_statvfs(struct super_block *, struct statvfs64 *);
 
 static struct super_operations qnx4_sops =
 {
@@ -149,7 +149,7 @@
 #else
 	NULL,
 #endif
-	qnx4_statfs,
+	qnx4_statvfs,
 	qnx4_remount,
 	NULL			/* clear_inode */
 };
@@ -225,22 +225,18 @@
 	return NULL;
 }
 
-static int qnx4_statfs(struct super_block *sb,
-		       struct statfs *buf, int bufsize)
+static int qnx4_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
+	buf->f_type = sb->s_magic;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = le32_to_cpu(sb->u.qnx4_sb.BitMap->di_size) * 8;
+	buf->f_bfree = qnx4_count_free_blocks(sb);
+	buf->f_bavail = buf->f_bfree;
+	buf->f_files = 0x00;	/* change this !!! */
+	buf->f_ffree = qnx4_count_free_inodes(sb);
+	buf->f_namelen = QNX4_NAME_MAX;
 
-	memset(&tmp, 0, sizeof tmp);
-	tmp.f_type = sb->s_magic;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = le32_to_cpu(sb->u.qnx4_sb.BitMap->di_size) * 8;
-	tmp.f_bfree = qnx4_count_free_blocks(sb);
-	tmp.f_bavail = tmp.f_bfree;
-	tmp.f_files = 0x00;	/* change this !!! */
-	tmp.f_ffree = qnx4_count_free_inodes(sb);
-	tmp.f_namelen = QNX4_NAME_MAX;
-
-	return copy_to_user(buf, &tmp, bufsize) ? -EFAULT : 0;
+	return 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
@@ -166,16 +167,13 @@
 /* That's simple too. */
 
 static int
-romfs_statfs(struct super_block *sb, struct statfs *buf, int bufsize)
+romfs_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	memset(&tmp, 0, sizeof(tmp));
-	tmp.f_type = ROMFS_MAGIC;
-	tmp.f_bsize = ROMBSIZE;
-	tmp.f_blocks = (sb->u.romfs_sb.s_maxsize+ROMBSIZE-1)>>ROMBSBITS;
-	tmp.f_namelen = ROMFS_MAXFN;
-	return copy_to_user(buf, &tmp, bufsize) ? -EFAULT : 0;
+	buf->f_type = ROMFS_MAGIC;
+	buf->f_bsize = ROMBSIZE;
+	buf->f_blocks = (sb->u.romfs_sb.s_maxsize+ROMBSIZE-1)>>ROMBSBITS;
+	buf->f_namelen = ROMFS_MAXFN;
+	return 0;
 }
 
 /* some helper routines */
diff -ur linux-23027p1/fs/smbfs/inode.c linux-23027p1m1/fs/smbfs/inode.c
--- linux-23027p1/fs/smbfs/inode.c	Fri Oct 15 00:22:09 1999
+++ linux-23027p1m1/fs/smbfs/inode.c	Mon Nov  8 22:58:52 1999
@@ -33,7 +33,7 @@
 static void smb_put_inode(struct inode *);
 static void smb_delete_inode(struct inode *);
 static void smb_put_super(struct super_block *);
-static int  smb_statfs(struct super_block *, struct statfs *, int);
+static int  smb_statvfs(struct super_block *, struct statvfs64 *);
 static void smb_set_inode_attr(struct inode *, struct smb_fattr *);
 
 static struct super_operations smb_sops =
@@ -45,7 +45,7 @@
 	smb_notify_change,	/* notify change */
 	smb_put_super,		/* put superblock */
 	NULL,			/* write superblock */
-	smb_statfs,		/* stat filesystem */
+	smb_statvfs,		/* stat filesystem */
 	NULL			/* remount filesystem */
 };
 
@@ -427,19 +427,15 @@
 }
 
 static int
-smb_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+smb_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs attr;
+	smb_proc_dskattr(sb, buf);
 
-	memset(&attr, 0, sizeof(attr));
-
-	smb_proc_dskattr(sb, &attr);
-
-	attr.f_type = SMB_SUPER_MAGIC;
-	attr.f_files = -1;
-	attr.f_ffree = -1;
-	attr.f_namelen = SMB_MAXPATHLEN;
-	return copy_to_user(buf, &attr, bufsiz) ? -EFAULT : 0;
+	buf->f_type = SMB_SUPER_MAGIC;
+	buf->f_files = -1;
+	buf->f_ffree = -1;
+	buf->f_namelen = SMB_MAXPATHLEN;
+	return 0;
 }
 
 int
diff -ur linux-23027p1/fs/super.c linux-23027p1m1/fs/super.c
--- linux-23027p1/fs/super.c	Sun Oct 31 09:19:22 1999
+++ linux-23027p1m1/fs/super.c	Mon Nov  8 22:58:52 1999
@@ -478,8 +478,7 @@
 {
         struct super_block *s;
         struct ustat tmp;
-        struct statfs sbuf;
-        mm_segment_t old_fs;
+        struct statvfs64 sbuf64;
 	int err = -EINVAL;
 
 	lock_kernel();
@@ -487,17 +486,14 @@
         if (s == NULL)
                 goto out;
 	err = -ENOSYS;
-        if (!(s->s_op->statfs))
+        if (!(s->s_op->statvfs))
                 goto out;
 
-        old_fs = get_fs();
-        set_fs(get_ds());
-        s->s_op->statfs(s,&sbuf,sizeof(struct statfs));
-        set_fs(old_fs);
+        s->s_op->statvfs(s,&sbuf64);
 
         memset(&tmp,0,sizeof(struct ustat));
-        tmp.f_tfree = sbuf.f_bfree;
-        tmp.f_tinode = sbuf.f_ffree;
+        tmp.f_tfree = sbuf64.f_bfree;
+        tmp.f_tinode = sbuf64.f_ffree;
 
         err = copy_to_user(ubuf,&tmp,sizeof(struct ustat)) ? -EFAULT : 0;
 out:
diff -ur linux-23027p1/fs/sysv/inode.c linux-23027p1m1/fs/sysv/inode.c
--- linux-23027p1/fs/sysv/inode.c	Thu Oct  7 20:17:09 1999
+++ linux-23027p1m1/fs/sysv/inode.c	Mon Nov  8 22:58:52 1999
@@ -67,7 +67,7 @@
 static void sysv_write_super(struct super_block *);
 static void sysv_read_inode(struct inode *);
 static int sysv_notify_change(struct dentry *, struct iattr *);
-static int sysv_statfs(struct super_block *, struct statfs *, int);
+static int sysv_statvfs(struct super_block *, struct statvfs64 *);
 
 static struct super_operations sysv_sops = {
 	sysv_read_inode,
@@ -77,7 +77,7 @@
 	sysv_notify_change,
 	sysv_put_super,
 	sysv_write_super,
-	sysv_statfs,
+	sysv_statvfs,
 	NULL			/* remount_fs */
 };
 
@@ -564,20 +564,18 @@
 	MOD_DEC_USE_COUNT;
 }
 
-static int sysv_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int sysv_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = sb->s_magic;			/* type of filesystem */
-	tmp.f_bsize = sb->sv_block_size;		/* block size */
-	tmp.f_blocks = sb->sv_ndatazones;		/* total data blocks in file system */
-	tmp.f_bfree = sysv_count_free_blocks(sb);	/* free blocks in fs */
-	tmp.f_bavail = tmp.f_bfree;			/* free blocks available to non-superuser */
-	tmp.f_files = sb->sv_ninodes;			/* total file nodes in file system */
-	tmp.f_ffree = sysv_count_free_inodes(sb);	/* free file nodes in fs */
-	tmp.f_namelen = SYSV_NAMELEN;
-	/* Don't know what value to put in tmp.f_fsid */ /* file system id */
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = sb->s_magic;			/* type of filesystem */
+	buf->f_bsize = sb->sv_block_size;		/* block size */
+	buf->f_blocks = sb->sv_ndatazones;		/* total data blocks in file system */
+	buf->f_bfree = sysv_count_free_blocks(sb);	/* free blocks in fs */
+	buf->f_bavail = buf->f_bfree;			/* free blocks available to non-superuser */
+	buf->f_files = sb->sv_ninodes;			/* total file nodes in file system */
+	buf->f_ffree = sysv_count_free_inodes(sb);	/* free file nodes in fs */
+	buf->f_namelen = SYSV_NAMELEN;
+	/* Don't know what value to put in buf->f_fsid */ /* file system id */
+	return 0;
 }
 
 
diff -ur linux-23027p1/fs/udf/super.c linux-23027p1m1/fs/udf/super.c
--- linux-23027p1/fs/udf/super.c	Sat Nov  6 19:51:19 1999
+++ linux-23027p1m1/fs/udf/super.c	Mon Nov  8 22:58:52 1999
@@ -86,7 +86,7 @@
 static unsigned int udf_count_free(struct super_block *);
 
 /* version specific functions */
-static int udf_statfs(struct super_block *, struct statfs *, int);
+static int udf_statvfs(struct super_block *, struct statvfs64 *);
 
 /* UDF filesystem type */
 static struct file_system_type udf_fstype = {
@@ -114,7 +114,7 @@
 	NULL,				/* notify_change */
 	udf_put_super,		/* put_super */
 	NULL,				/* write_super */
-	udf_statfs,			/* statfs */
+	udf_statvfs,			/* statvfs */
 	udf_remount_fs,		/* remount_fs */
 	NULL,				/* clear_inode */
 	NULL,				/* umount_begin */
@@ -1508,36 +1508,27 @@
  *	Return info about the filesystem.
  *
  * DESCRIPTION
- *	Called by sys_statfs()
+ *	Called by sys_statvfs()
  *
  * HISTORY
  *	July 1, 1997 - Andrew E. Mileski
  *	Written, tested, and released.
  */
 static int
-udf_statfs(struct super_block *sb, struct statfs *buf, int bufsize)
+udf_statvfs(struct super_block *sb, struct statvfs64 *buf)
 {
-	int size;
-	struct statfs tmp;
-	int rc;
-
-	size = (bufsize < sizeof(tmp)) ? bufsize: sizeof(tmp);
-
-	memset(&tmp, 0, sizeof(tmp));
-	tmp.f_type = UDF_SUPER_MAGIC;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = UDF_SB_PARTLEN(sb, UDF_SB_PARTITION(sb));
-	tmp.f_bfree = udf_count_free(sb);
-	tmp.f_bavail = tmp.f_bfree;
-	tmp.f_files = (UDF_SB_LVIDBH(sb) ?
+	buf->f_type = UDF_SUPER_MAGIC;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = UDF_SB_PARTLEN(sb, UDF_SB_PARTITION(sb));
+	buf->f_bfree = udf_count_free(sb);
+	buf->f_bavail = buf->f_bfree;
+	buf->f_files = (UDF_SB_LVIDBH(sb) ?
 		(le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) +
-		le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs)) : 0) + tmp.f_bfree;
-	tmp.f_ffree = tmp.f_bfree;
+		le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs)) : 0) + buf->f_bfree;
+	buf->f_ffree = buf->f_bfree;
 	/* __kernel_fsid_t f_fsid */
-	tmp.f_namelen = UDF_NAME_LEN;
-
-	rc= copy_to_user(buf, &tmp, size) ? -EFAULT: 0;
-	return rc;
+	buf->f_namelen = UDF_NAME_LEN;
+	return 0;
 }
 
 static unsigned char udf_bitmap_lookup[16] = {
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
@@ -892,28 +892,27 @@
 	return 0;
 }
 
-int ufs_statfs (struct super_block * sb, struct statfs * buf, int bufsiz)
+int ufs_statvfs (struct super_block * sb, struct statvfs64 * buf)
 {
 	struct ufs_sb_private_info * uspi;
 	struct ufs_super_block_first * usb1;
-	struct statfs tmp;
 	unsigned swab;
 
 	swab = sb->u.ufs_sb.s_swab;
 	uspi = sb->u.ufs_sb.s_uspi;
 	usb1 = ubh_get_usb_first (USPI_UBH);
 	
-	tmp.f_type = UFS_MAGIC;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = uspi->s_dsize;
-	tmp.f_bfree = ufs_blkstofrags(SWAB32(usb1->fs_cstotal.cs_nbfree)) +
+	buf->f_type = UFS_MAGIC;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = uspi->s_dsize;
+	buf->f_bfree = ufs_blkstofrags(SWAB32(usb1->fs_cstotal.cs_nbfree)) +
 		SWAB32(usb1->fs_cstotal.cs_nffree);
-	tmp.f_bavail = (tmp.f_bfree > ((tmp.f_blocks / 100) * uspi->s_minfree))
-		? (tmp.f_bfree - ((tmp.f_blocks / 100) * uspi->s_minfree)) : 0;
-	tmp.f_files = uspi->s_ncg * uspi->s_ipg;
-	tmp.f_ffree = SWAB32(usb1->fs_cstotal.cs_nifree);
-	tmp.f_namelen = UFS_MAXNAMLEN;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_bavail = (buf->f_bfree > (((u_long)buf->f_blocks / 100) * uspi->s_minfree))
+		? (buf->f_bfree - (((u_long)buf->f_blocks / 100) * uspi->s_minfree)) : 0;
+	buf->f_files = uspi->s_ncg * uspi->s_ipg;
+	buf->f_ffree = SWAB32(usb1->fs_cstotal.cs_nifree);
+	buf->f_namelen = UFS_MAXNAMLEN;
+	return 0;
 }
 
 static struct super_operations ufs_super_ops = {
@@ -924,7 +923,7 @@
 	NULL,			/* notify_change() */
 	ufs_put_super,
 	ufs_write_super,
-	ufs_statfs,
+	ufs_statvfs,
 	ufs_remount
 };
 
diff -ur linux-23027p1/fs/umsdos/inode.c linux-23027p1m1/fs/umsdos/inode.c
--- linux-23027p1/fs/umsdos/inode.c	Fri Aug 27 00:18:06 1999
+++ linux-23027p1m1/fs/umsdos/inode.c	Mon Nov  8 22:58:52 1999
@@ -309,7 +309,7 @@
 	UMSDOS_notify_change,	/* notify_change */
 	UMSDOS_put_super,	/* put_super */
 	NULL,			/* write_super */
-	fat_statfs,		/* statfs */
+	fat_statvfs,		/* statvfs */
 	NULL,			/* remount_fs */
 	fat_clear_inode,	/* clear_inode */
 };
diff -ur linux-23027p1/include/asm-alpha/statfs.h linux-23027p1m1/include/asm-alpha/statfs.h
--- linux-23027p1/include/asm-alpha/statfs.h	Sun Aug 18 10:42:02 1996
+++ linux-23027p1m1/include/asm-alpha/statfs.h	Mon Nov  8 22:58:52 1999
@@ -22,4 +22,17 @@
 	int f_spare[6];
 };
 
+struct statvfs64 {
+	__u32 f_type;
+	__u32 f_bsize;
+	__u64 f_blocks;
+	__u64 f_bfree;
+	__u64 f_bavail;
+	__u64 f_files;
+	__u64 f_ffree;
+	__kernel_fsid_t f_fsid;
+	int f_namelen;
+	int f_spare[6];
+};
+
 #endif
diff -ur linux-23027p1/include/asm-arm/statfs.h linux-23027p1m1/include/asm-arm/statfs.h
--- linux-23027p1/include/asm-arm/statfs.h	Wed Jan 21 02:39:43 1998
+++ linux-23027p1m1/include/asm-arm/statfs.h	Mon Nov  8 22:58:52 1999
@@ -22,4 +22,17 @@
 	long f_spare[6];
 };
 
+struct statvfs64 {
+	__u32 f_type;
+	__u32 f_bsize;
+	__u64 f_blocks;
+	__u64 f_bfree;
+	__u64 f_bavail;
+	__u64 f_files;
+	__u64 f_ffree;
+	__kernel_fsid_t f_fsid;
+	int f_namelen;
+	int f_spare[6];
+};
+
 #endif
diff -ur linux-23027p1/include/asm-i386/statfs.h linux-23027p1m1/include/asm-i386/statfs.h
--- linux-23027p1/include/asm-i386/statfs.h	Mon Nov  8 14:11:09 1999
+++ linux-23027p1m1/include/asm-i386/statfs.h	Mon Nov  8 22:58:52 1999
@@ -22,4 +22,17 @@
 	long f_spare[6];
 };
 
+struct statvfs64 {
+	__u32 f_type;
+	__u32 f_bsize;
+	__u64 f_blocks;
+	__u64 f_bfree;
+	__u64 f_bavail;
+	__u64 f_files;
+	__u64 f_ffree;
+	__kernel_fsid_t f_fsid;
+	int f_namelen;
+	int f_spare[6];
+};
+
 #endif
diff -ur linux-23027p1/include/asm-m68k/statfs.h linux-23027p1m1/include/asm-m68k/statfs.h
--- linux-23027p1/include/asm-m68k/statfs.h	Mon Jun  3 10:09:13 1996
+++ linux-23027p1m1/include/asm-m68k/statfs.h	Mon Nov  8 22:58:52 1999
@@ -22,4 +22,17 @@
 	long f_spare[6];
 };
 
+struct statvfs64 {
+	__u32 f_type;
+	__u32 f_bsize;
+	__u64 f_blocks;
+	__u64 f_bfree;
+	__u64 f_bavail;
+	__u64 f_files;
+	__u64 f_ffree;
+	__kernel_fsid_t f_fsid;
+	int f_namelen;
+	int f_spare[6];
+};
+
 #endif /* _M68K_STATFS_H */
diff -ur linux-23027p1/include/asm-mips/statfs.h linux-23027p1m1/include/asm-mips/statfs.h
--- linux-23027p1/include/asm-mips/statfs.h	Thu Jun 26 22:33:40 1997
+++ linux-23027p1m1/include/asm-mips/statfs.h	Mon Nov  8 22:58:52 1999
@@ -37,4 +37,21 @@
 	long		f_spare[6];
 };
 
+struct statvfs64 {
+	long		f_type;
+#define f_fstyp f_type
+	long		f_bsize;
+	__u64		f_frsize;	/* Fragment size - fs specific */
+	__u64		f_blocks;
+	__u64		f_bfree;
+	__u64		f_files;
+	__u64		f_ffree;
+
+	/* Linux specials */
+	__u64		f_bavail;
+	__kernel_fsid_t	f_fsid;
+	long		f_namelen;
+	long		f_spare[6];
+};
+
 #endif /* __ASM_MIPS_STATFS_H */
diff -ur linux-23027p1/include/asm-ppc/statfs.h linux-23027p1m1/include/asm-ppc/statfs.h
--- linux-23027p1/include/asm-ppc/statfs.h	Mon Jun  3 10:09:13 1996
+++ linux-23027p1m1/include/asm-ppc/statfs.h	Mon Nov  8 22:58:52 1999
@@ -22,7 +22,17 @@
 	long f_spare[6];
 };
 
-#endif
-
-
+struct statvfs64 {
+	long f_type;
+	long f_bsize;
+	__u64 f_blocks;
+	__u64 f_bfree;
+	__u64 f_bavail;
+	__u64 f_files;
+	__u64 f_ffree;
+	__kernel_fsid_t f_fsid;
+	long f_namelen;
+	long f_spare[6];
+};
 
+#endif
diff -ur linux-23027p1/include/asm-sparc/statfs.h linux-23027p1m1/include/asm-sparc/statfs.h
--- linux-23027p1/include/asm-sparc/statfs.h	Sat Nov  9 21:39:33 1996
+++ linux-23027p1m1/include/asm-sparc/statfs.h	Mon Nov  8 22:58:52 1999
@@ -23,4 +23,17 @@
 	long f_spare[6];
 };
 
+struct statvfs64 {
+	long f_type;
+	long f_bsize;
+	__u64 f_blocks;
+	__u64 f_bfree;
+	__u64 f_bavail;
+	__u64 f_files;
+	__u64 f_ffree;
+	__kernel_fsid_t f_fsid;
+	long f_namelen;  /* SunOS ignores this field. */
+	long f_spare[6];
+};
+
 #endif
diff -ur linux-23027p1/include/asm-sparc64/statfs.h linux-23027p1m1/include/asm-sparc64/statfs.h
--- linux-23027p1/include/asm-sparc64/statfs.h	Thu Apr 24 05:01:28 1997
+++ linux-23027p1m1/include/asm-sparc64/statfs.h	Mon Nov  8 22:58:52 1999
@@ -36,4 +36,17 @@
 	long f_spare[6];
 };
 
+struct statvfs64 {
+	long f_type;
+	long f_bsize;
+	__u64 f_blocks;
+	__u64 f_bfree;
+	__u64 f_bavail;
+	__u64 f_files;
+	__u64 f_ffree;
+	__kernel_fsid_t f_fsid;
+	long f_namelen;
+	long f_spare[6];
+};
+
 #endif
diff -ur linux-23027p1/include/linux/ext2_fs.h linux-23027p1m1/include/linux/ext2_fs.h
--- linux-23027p1/include/linux/ext2_fs.h	Mon Nov  8 14:11:09 1999
+++ linux-23027p1m1/include/linux/ext2_fs.h	Mon Nov  8 22:58:52 1999
@@ -598,7 +598,7 @@
 extern int ext2_remount (struct super_block *, int *, char *);
 extern struct super_block * ext2_read_super (struct super_block *,void *,int);
 extern int init_ext2_fs(void);
-extern int ext2_statfs (struct super_block *, struct statfs *, int);
+extern int ext2_statvfs (struct super_block *, struct statvfs64 *);
 
 /* truncate.c */
 extern void ext2_truncate (struct inode *);
diff -ur linux-23027p1/include/linux/fat_cvf.h linux-23027p1m1/include/linux/fat_cvf.h
--- linux-23027p1/include/linux/fat_cvf.h	Mon Aug  9 21:43:49 1999
+++ linux-23027p1m1/include/linux/fat_cvf.h	Mon Nov  8 22:58:52 1999
@@ -25,7 +25,7 @@
                         int nbreq,
                         struct buffer_head *bh[32]);
   int (*fat_access) (struct super_block *sb,int nr,int new_value);
-  int (*cvf_statfs) (struct super_block *sb,struct statfs *buf, int bufsiz);
+  int (*cvf_statvfs) (struct super_block *sb,struct statvfs64 *buf);
   int (*cvf_bmap) (struct inode *inode,int block);
   ssize_t (*cvf_file_read) ( struct file *, char *, size_t, loff_t *);
   ssize_t (*cvf_file_write) ( struct file *, const char *, size_t, loff_t *);
diff -ur linux-23027p1/include/linux/coda_psdev.h linux-23027p1m1/include/linux/coda_psdev.h
--- linux-23027p1/include/linux/coda_psdev.h	Wed Jul  7 05:08:33 1999
+++ linux-23027p1m1/include/linux/coda_psdev.h	Mon Nov  8 22:58:52 1999
@@ -80,7 +80,7 @@
 		 unsigned int cmd, struct PioctlData *data);
 int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
 int venus_fsync(struct super_block *sb, struct ViceFid *fid);
-int venus_statfs(struct super_block *sb, struct statfs *sfs);
+int venus_statvfs(struct super_block *sb, struct statvfs64 *sfs);
 
 
 /* messages between coda filesystem in kernel and Venus */
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
@@ -665,7 +697,7 @@
 	int (*notify_change) (struct dentry *, struct iattr *);
 	void (*put_super) (struct super_block *);
 	void (*write_super) (struct super_block *);
-	int (*statfs) (struct super_block *, struct statfs *, int);
+	int (*statvfs) (struct super_block *, struct statvfs64 *);
 	int (*remount_fs) (struct super_block *, int *, char *);
 	void (*clear_inode) (struct inode *);
 	void (*umount_begin) (struct super_block *);
diff -ur linux-23027p1/include/linux/msdos_fs.h linux-23027p1m1/include/linux/msdos_fs.h
--- linux-23027p1/include/linux/msdos_fs.h	Mon Nov  8 14:14:22 1999
+++ linux-23027p1m1/include/linux/msdos_fs.h	Mon Nov  8 22:58:52 1999
@@ -247,7 +247,7 @@
 extern struct inode *fat_build_inode(struct super_block*,struct msdos_dir_entry*,int,int*);
 extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent, struct inode_operations *dir_ops);
 extern void msdos_put_super(struct super_block *sb);
-extern int fat_statfs(struct super_block *sb,struct statfs *buf, int);
+extern int fat_statvfs(struct super_block *sb,struct statvfs64 *buf);
 extern void fat_write_inode(struct inode *inode);
 
 /* dir.c */
diff -ur linux-23027p1/include/linux/nfsd/nfsd.h linux-23027p1m1/include/linux/nfsd/nfsd.h
--- linux-23027p1/include/linux/nfsd/nfsd.h	Mon Nov  8 14:13:05 1999
+++ linux-23027p1m1/include/linux/nfsd/nfsd.h	Mon Nov  8 22:58:52 1999
@@ -105,8 +105,8 @@
 int		nfsd_readdir(struct svc_rqst *, struct svc_fh *,
 				loff_t, encode_dent_fn,
 				u32 *buffer, int *countp);
-int		nfsd_statfs(struct svc_rqst *, struct svc_fh *,
-				struct statfs *);
+int		nfsd_statvfs(struct svc_rqst *, struct svc_fh *,
+				struct statvfs64 *);
 int		nfsd_notify_change(struct inode *, struct iattr *);
 int		nfsd_permission(struct svc_export *, struct dentry *, int);
 
diff -ur linux-23027p1/include/linux/nfsd/xdr.h linux-23027p1m1/include/linux/nfsd/xdr.h
--- linux-23027p1/include/linux/nfsd/xdr.h	Mon Nov  8 14:13:05 1999
+++ linux-23027p1m1/include/linux/nfsd/xdr.h	Mon Nov  8 22:58:52 1999
@@ -101,7 +101,7 @@
 };
 
 struct nfsd_statfsres {
-	struct statfs		stats;
+	struct statvfs64	stats;
 };
 
 /*
diff -ur linux-23027p1/include/linux/proc_fs.h linux-23027p1m1/include/linux/proc_fs.h
--- linux-23027p1/include/linux/proc_fs.h	Mon Nov  8 22:57:35 1999
+++ linux-23027p1m1/include/linux/proc_fs.h	Mon Nov  8 22:58:52 1999
@@ -295,7 +295,7 @@
 extern struct super_block *proc_read_super(struct super_block *,void *,int);
 extern int init_proc_fs(void);
 extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *);
-extern int proc_statfs(struct super_block *, struct statfs *, int);
+extern int proc_statvfs(struct super_block *, struct statvfs64 *);
 extern void proc_read_inode(struct inode *);
 extern void proc_write_inode(struct inode *);
 
diff -ur linux-23027p1/kernel/acct.c linux-23027p1m1/kernel/acct.c
--- linux-23027p1/kernel/acct.c	Mon Aug 23 21:15:53 1999
+++ linux-23027p1m1/kernel/acct.c	Mon Nov  8 22:58:52 1999
@@ -88,8 +88,7 @@
  */
 static int check_free_space(struct file *file)
 {
-	mm_segment_t fs;
-	struct statfs sbuf;
+	struct statvfs64 sbuf;
 	struct super_block *sb;
 	int res = acct_active;
 	int act;
@@ -98,18 +97,15 @@
 		return res;
 
 	sb = file->f_dentry->d_inode->i_sb;
-	if (!sb->s_op || !sb->s_op->statfs)
+	if (!sb->s_op || !sb->s_op->statvfs)
 		return res;
 
-	fs = get_fs();
-	set_fs(KERNEL_DS);
 	/* May block */
-	sb->s_op->statfs(sb, &sbuf, sizeof(struct statfs));
-	set_fs(fs);
+	sb->s_op->statvfs(sb, &sbuf);
 
-	if (sbuf.f_bavail <= SUSPEND * sbuf.f_blocks / 100)
+	if (sbuf.f_bavail <= (u_long)(SUSPEND * sbuf.f_blocks) / 100)
 		act = -1;
-	else if (sbuf.f_bavail >= RESUME * sbuf.f_blocks / 100)
+	else if (sbuf.f_bavail >= (u_long)(RESUME * sbuf.f_blocks) / 100)
 		act = 1;
 	else
 		act = 0;
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
@@ -168,7 +168,7 @@
 			struct nfs_fh *fhandle, struct nfs_fattr *fattr);
 extern int nfs_proc_rmdir(struct nfs_server *server, struct nfs_fh *dir,
 			const char *name);
-extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
+extern int nfs_proc_statvfs(struct nfs_server *server, struct nfs_fh *fhandle,
 			struct nfs_fsinfo *res);
 
 
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
@@ -139,7 +139,7 @@
 int smb_proc_getattr(struct dentry *, struct smb_fattr *);
 int smb_proc_setattr(struct dentry *, struct smb_fattr *);
 int smb_proc_settime(struct dentry *, struct smb_fattr *);
-int smb_proc_dskattr(struct super_block *, struct statfs *);
+int smb_proc_dskattr(struct super_block *, struct statvfs64 *);
 int smb_proc_reconnect(struct smb_sb_info *);
 int smb_proc_connect(struct smb_sb_info *);
 int smb_proc_disconnect(struct smb_sb_info *);
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
@@ -217,7 +217,7 @@
 }
 
 int
-nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
+nfs_proc_statvfs(struct nfs_server *server, struct nfs_fh *fhandle,
 			struct nfs_fsinfo *info)
 {
 	int	status;
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
@@ -2234,7 +2234,7 @@
 }
 
 int
-smb_proc_dskattr(struct super_block *sb, struct statfs *attr)
+smb_proc_dskattr(struct super_block *sb, struct statvfs64 *attr)
 {
 	struct smb_sb_info *server = &(sb->u.smbfs_sb);
 	int error;
