Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common bsd_to_linux_statfs():



details:   https://anonhg.NetBSD.org/src/rev/c721145bec2a
branches:  trunk
changeset: 569926:c721145bec2a
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Sep 13 20:09:44 2004 +0000

description:
bsd_to_linux_statfs():
- filesystem size is expressed in number of fragments, not blocks;
  this fixes computed filesystem sizes for Linux df(1) and other Linux
  binaries using statfs(2) for filesystems, which use different value
  for frament and block, such as FFS
- use FS f_namemax instead of always using MAXNAMLEN

diffstat:

 sys/compat/linux/common/linux_misc.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r c7a9cb03c2f5 -r c721145bec2a sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c      Mon Sep 13 20:02:20 2004 +0000
+++ b/sys/compat/linux/common/linux_misc.c      Mon Sep 13 20:09:44 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc.c,v 1.128 2004/08/29 14:08:06 jdolecek Exp $        */
+/*     $NetBSD: linux_misc.c,v 1.129 2004/09/13 20:09:44 jdolecek Exp $        */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.128 2004/08/29 14:08:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.129 2004/09/13 20:09:44 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -320,7 +320,7 @@
                lsp->l_ftype = fstypes[i].linux;
        }
 
-       lsp->l_fbsize = bsp->f_bsize;
+       lsp->l_fbsize = bsp->f_frsize;
        lsp->l_fblocks = bsp->f_blocks;
        lsp->l_fbfree = bsp->f_bfree;
        lsp->l_fbavail = bsp->f_bavail;
@@ -329,7 +329,7 @@
        /* Linux sets the fsid to 0..., we don't */
        lsp->l_ffsid.val[0] = bsp->f_fsidx.__fsid_val[0];
        lsp->l_ffsid.val[1] = bsp->f_fsidx.__fsid_val[1];
-       lsp->l_fnamelen = MAXNAMLEN;    /* XXX */
+       lsp->l_fnamelen = bsp->f_namemax;
        (void)memset(lsp->l_fspare, 0, sizeof(lsp->l_fspare));
 }
 



Home | Main Index | Thread Index | Old Index