set mp->mnt_stat.f_namemax on filesystem mount, for use by statvfs

This commit is contained in:
jdolecek 2004-09-13 19:19:44 +00:00
parent df80bed99c
commit 2993272a0c
4 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdesc_vfsops.c,v 1.51 2004/05/25 14:54:57 hannken Exp $ */ /* $NetBSD: fdesc_vfsops.c,v 1.52 2004/09/13 19:19:44 jdolecek Exp $ */
/* /*
* Copyright (c) 1992, 1993, 1995 * Copyright (c) 1992, 1993, 1995
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.51 2004/05/25 14:54:57 hannken Exp $"); __KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.52 2004/09/13 19:19:44 jdolecek Exp $");
#if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h" #include "opt_compat_netbsd.h"
@ -107,6 +107,7 @@ fdesc_mount(mp, path, data, ndp, p)
rvp->v_type = VDIR; rvp->v_type = VDIR;
rvp->v_flag |= VROOT; rvp->v_flag |= VROOT;
fmp->f_root = rvp; fmp->f_root = rvp;
mp->mnt_stat.f_namemax = MAXNAMLEN;
mp->mnt_flag |= MNT_LOCAL; mp->mnt_flag |= MNT_LOCAL;
mp->mnt_data = fmp; mp->mnt_data = fmp;
vfs_getnewfsid(mp); vfs_getnewfsid(mp);
@ -239,7 +240,6 @@ fdesc_statvfs(mp, sbp, p)
sbp->f_ffree = freefd; /* See comments above */ sbp->f_ffree = freefd; /* See comments above */
sbp->f_favail = freefd; /* See comments above */ sbp->f_favail = freefd; /* See comments above */
sbp->f_fresvd = 0; sbp->f_fresvd = 0;
sbp->f_namemax = MAXNAMLEN;
copy_statvfs_info(sbp, mp); copy_statvfs_info(sbp, mp);
return (0); return (0);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: kernfs_vfsops.c,v 1.64 2004/05/29 14:28:41 tron Exp $ */ /* $NetBSD: kernfs_vfsops.c,v 1.65 2004/09/13 19:19:45 jdolecek Exp $ */
/* /*
* Copyright (c) 1992, 1993, 1995 * Copyright (c) 1992, 1993, 1995
@ -39,7 +39,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.64 2004/05/29 14:28:41 tron Exp $"); __KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.65 2004/09/13 19:19:45 jdolecek Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h" #include "opt_compat_netbsd.h"
@ -158,8 +158,9 @@ kernfs_mount(mp, path, data, ndp, p)
memset(fmp, 0, sizeof(*fmp)); memset(fmp, 0, sizeof(*fmp));
TAILQ_INIT(&fmp->nodelist); TAILQ_INIT(&fmp->nodelist);
mp->mnt_data = fmp; mp->mnt_stat.f_namemax = MAXNAMLEN;
mp->mnt_flag |= MNT_LOCAL; mp->mnt_flag |= MNT_LOCAL;
mp->mnt_data = fmp;
vfs_getnewfsid(mp); vfs_getnewfsid(mp);
if ((error = set_statvfs_info(path, UIO_USERSPACE, "kernfs", if ((error = set_statvfs_info(path, UIO_USERSPACE, "kernfs",
@ -245,7 +246,6 @@ kernfs_statvfs(mp, sbp, p)
sbp->f_ffree = 128; /* XXX lie */ sbp->f_ffree = 128; /* XXX lie */
sbp->f_favail = 128; /* XXX lie */ sbp->f_favail = 128; /* XXX lie */
sbp->f_fresvd = 0; sbp->f_fresvd = 0;
sbp->f_namemax = MAXNAMLEN;
copy_statvfs_info(sbp, mp); copy_statvfs_info(sbp, mp);
return (0); return (0);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: portal_vfsops.c,v 1.46 2004/05/25 14:54:57 hannken Exp $ */ /* $NetBSD: portal_vfsops.c,v 1.47 2004/09/13 19:19:45 jdolecek Exp $ */
/* /*
* Copyright (c) 1992, 1993, 1995 * Copyright (c) 1992, 1993, 1995
@ -40,7 +40,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: portal_vfsops.c,v 1.46 2004/05/25 14:54:57 hannken Exp $"); __KERNEL_RCSID(0, "$NetBSD: portal_vfsops.c,v 1.47 2004/09/13 19:19:45 jdolecek Exp $");
#if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h" #include "opt_compat_netbsd.h"
@ -156,6 +156,7 @@ portal_mount(mp, path, data, ndp, p)
fp->f_count++; fp->f_count++;
simple_unlock(&fp->f_slock); simple_unlock(&fp->f_slock);
mp->mnt_stat.f_namemax = MAXNAMLEN;
mp->mnt_flag |= MNT_LOCAL; mp->mnt_flag |= MNT_LOCAL;
mp->mnt_data = fmp; mp->mnt_data = fmp;
vfs_getnewfsid(mp); vfs_getnewfsid(mp);
@ -277,7 +278,6 @@ portal_statvfs(mp, sbp, p)
sbp->f_ffree = 0; /* See comments above */ sbp->f_ffree = 0; /* See comments above */
sbp->f_favail = 0; /* See comments above */ sbp->f_favail = 0; /* See comments above */
sbp->f_fresvd = 0; sbp->f_fresvd = 0;
sbp->f_namemax = MAXNAMLEN;
copy_statvfs_info(sbp, mp); copy_statvfs_info(sbp, mp);
return (0); return (0);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: procfs_vfsops.c,v 1.57 2004/05/25 14:54:57 hannken Exp $ */ /* $NetBSD: procfs_vfsops.c,v 1.58 2004/09/13 19:19:45 jdolecek Exp $ */
/* /*
* Copyright (c) 1993 * Copyright (c) 1993
@ -76,7 +76,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.57 2004/05/25 14:54:57 hannken Exp $"); __KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.58 2004/09/13 19:19:45 jdolecek Exp $");
#if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h" #include "opt_compat_netbsd.h"
@ -162,10 +162,11 @@ procfs_mount(mp, path, data, ndp, p)
} else } else
args.flags = 0; args.flags = 0;
mp->mnt_flag |= MNT_LOCAL;
pmnt = (struct procfsmount *) malloc(sizeof(struct procfsmount), pmnt = (struct procfsmount *) malloc(sizeof(struct procfsmount),
M_UFSMNT, M_WAITOK); /* XXX need new malloc type */ M_UFSMNT, M_WAITOK); /* XXX need new malloc type */
mp->mnt_stat.f_namemax = MAXNAMLEN;
mp->mnt_flag |= MNT_LOCAL;
mp->mnt_data = pmnt; mp->mnt_data = pmnt;
vfs_getnewfsid(mp); vfs_getnewfsid(mp);
@ -244,7 +245,6 @@ procfs_statvfs(mp, sbp, p)
sbp->f_ffree = maxproc - nprocs; /* approx */ sbp->f_ffree = maxproc - nprocs; /* approx */
sbp->f_favail = maxproc - nprocs; /* approx */ sbp->f_favail = maxproc - nprocs; /* approx */
sbp->f_fresvd = 0; sbp->f_fresvd = 0;
sbp->f_namemax = MAXNAMLEN;
copy_statvfs_info(sbp, mp); copy_statvfs_info(sbp, mp);
return (0); return (0);
} }