summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorbouyer <bouyer@NetBSD.org>2011-03-06 17:08:10 +0000
committerbouyer <bouyer@NetBSD.org>2011-03-06 17:08:10 +0000
commit0367ea04357cc3132acde34301e004c31404e00a (patch)
treefbee7a75c9221f005c8e599dca212da52915cbe2 /sys
parente6c5a781a6101ca215918815f4f048df623ddf85 (diff)
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs metadata. Usage is checked by fsck_ffs (no more quotacheck) and is covered by the WAPBL journal. Enabled with kernel option QUOTA2 (added where QUOTA was enabled in kernel config files), turned on with tunefs(8) on a per-filesystem basis. mount_mfs(8) can also turn quotas on. See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html for details.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/acorn26/conf/FOURMEG5
-rw-r--r--sys/arch/acorn26/conf/GENERIC5
-rw-r--r--sys/arch/acorn26/conf/INSTALL5
-rw-r--r--sys/arch/acorn32/conf/EB7500ATX7
-rw-r--r--sys/arch/acorn32/conf/GENERIC7
-rw-r--r--sys/arch/acorn32/conf/INSTALL7
-rw-r--r--sys/arch/acorn32/conf/LOWMEM_WSCONS5
-rw-r--r--sys/arch/acorn32/conf/NC5
-rw-r--r--sys/arch/alpha/conf/GENERIC7
-rw-r--r--sys/arch/amd64/conf/GENERIC7
-rw-r--r--sys/arch/amd64/conf/XEN3_DOM05
-rw-r--r--sys/arch/amd64/conf/XEN3_DOMU5
-rw-r--r--sys/arch/amiga/conf/DRACO7
-rw-r--r--sys/arch/amiga/conf/GENERIC7
-rw-r--r--sys/arch/amiga/conf/GENERIC.in7
-rw-r--r--sys/arch/amigappc/conf/GENERIC7
-rw-r--r--sys/arch/amigappc/conf/NULL7
-rw-r--r--sys/arch/arc/conf/ARCTIC5
-rw-r--r--sys/arch/arc/conf/GENERIC7
-rw-r--r--sys/arch/arc/conf/M4035
-rw-r--r--sys/arch/arc/conf/MIMORI5
-rw-r--r--sys/arch/arc/conf/PICA5
-rw-r--r--sys/arch/arc/conf/RAMDISK3
-rw-r--r--sys/arch/arc/conf/RPC447
-rw-r--r--sys/arch/atari/conf/GENERIC.in5
-rw-r--r--sys/arch/bebox/conf/GENERIC7
-rw-r--r--sys/arch/cats/conf/GENERIC5
-rw-r--r--sys/arch/cats/conf/INSTALL5
-rw-r--r--sys/arch/cesfic/conf/GENERIC5
-rw-r--r--sys/arch/cobalt/conf/GENERIC7
-rw-r--r--sys/arch/cobalt/conf/INSTALL7
-rw-r--r--sys/arch/dreamcast/conf/GENERIC5
-rw-r--r--sys/arch/emips/conf/GENERIC7
-rw-r--r--sys/arch/evbarm/conf/ADI_BRH5
-rw-r--r--sys/arch/evbarm/conf/ARMADILLO2105
-rw-r--r--sys/arch/evbarm/conf/ARMADILLO95
-rw-r--r--sys/arch/evbarm/conf/BEAGLEBOARD5
-rw-r--r--sys/arch/evbarm/conf/CP31005
-rw-r--r--sys/arch/evbarm/conf/GEMINI3
-rw-r--r--sys/arch/evbarm/conf/GEMINI_MASTER3
-rw-r--r--sys/arch/evbarm/conf/GEMINI_SLAVE3
-rw-r--r--sys/arch/evbarm/conf/GUMSTIX5
-rw-r--r--sys/arch/evbarm/conf/HDL_G5
-rw-r--r--sys/arch/evbarm/conf/IGEPV25
-rw-r--r--sys/arch/evbarm/conf/IMX31LITE5
-rw-r--r--sys/arch/evbarm/conf/INTEGRATOR5
-rw-r--r--sys/arch/evbarm/conf/IQ312445
-rw-r--r--sys/arch/evbarm/conf/IQ803105
-rw-r--r--sys/arch/evbarm/conf/IQ803215
-rw-r--r--sys/arch/evbarm/conf/IXDP4255
-rw-r--r--sys/arch/evbarm/conf/IXM12005
-rw-r--r--sys/arch/evbarm/conf/LUBBOCK3
-rw-r--r--sys/arch/evbarm/conf/MARVELL_NAS5
-rw-r--r--sys/arch/evbarm/conf/MPCSA_GENERIC7
-rw-r--r--sys/arch/evbarm/conf/NAPPI5
-rw-r--r--sys/arch/evbarm/conf/NETWALKER5
-rw-r--r--sys/arch/evbarm/conf/NSLU25
-rw-r--r--sys/arch/evbarm/conf/OSK59123
-rw-r--r--sys/arch/evbarm/conf/OVERO5
-rw-r--r--sys/arch/evbarm/conf/SHEEVAPLUG5
-rw-r--r--sys/arch/evbarm/conf/SMDK24105
-rw-r--r--sys/arch/evbarm/conf/SMDK28005
-rw-r--r--sys/arch/evbarm/conf/TEAMASA_NPWR5
-rw-r--r--sys/arch/evbarm/conf/TEAMASA_NPWR_FC5
-rw-r--r--sys/arch/evbarm/conf/TISDP24205
-rw-r--r--sys/arch/evbarm/conf/TISDP24305
-rw-r--r--sys/arch/evbarm/conf/TS72005
-rw-r--r--sys/arch/evbarm/conf/TWINTAIL5
-rw-r--r--sys/arch/evbarm/conf/VIPER5
-rw-r--r--sys/arch/evbarm/conf/ZAO4255
-rw-r--r--sys/arch/evbmips/conf/ADM51207
-rw-r--r--sys/arch/evbmips/conf/ADM5120-NB7
-rw-r--r--sys/arch/evbmips/conf/ADM5120-USB7
-rw-r--r--sys/arch/evbmips/conf/ALCHEMY7
-rw-r--r--sys/arch/evbmips/conf/AP307
-rw-r--r--sys/arch/evbmips/conf/GDIUM7
-rw-r--r--sys/arch/evbmips/conf/MALTA7
-rw-r--r--sys/arch/evbmips/conf/MERAKI7
-rw-r--r--sys/arch/evbmips/conf/RB1537
-rw-r--r--sys/arch/evbmips/conf/WGT624V37
-rw-r--r--sys/arch/evbppc/conf/EV642605
-rw-r--r--sys/arch/evbppc/conf/EXPLORA4515
-rw-r--r--sys/arch/evbppc/conf/MPC8536DS7
-rw-r--r--sys/arch/evbppc/conf/MPC8548CDS7
-rw-r--r--sys/arch/evbppc/conf/OPENBLOCKS2005
-rw-r--r--sys/arch/evbppc/conf/OPENBLOCKS2667
-rw-r--r--sys/arch/evbppc/conf/OPENBLOCKS6007
-rw-r--r--sys/arch/evbppc/conf/PMPPC5
-rw-r--r--sys/arch/evbppc/conf/RB8007
-rw-r--r--sys/arch/evbppc/conf/VIRTEX_DFC5
-rw-r--r--sys/arch/evbppc/conf/VIRTEX_GSRD15
-rw-r--r--sys/arch/evbppc/conf/VIRTEX_GSRD25
-rw-r--r--sys/arch/evbppc/conf/WALNUT5
-rw-r--r--sys/arch/ews4800mips/conf/GENERIC7
-rw-r--r--sys/arch/ews4800mips/conf/RAMDISK3
-rw-r--r--sys/arch/hp300/conf/GENERIC7
-rw-r--r--sys/arch/hp300/conf/INSTALL5
-rw-r--r--sys/arch/hp300/dev/hyperreg.h3
-rw-r--r--sys/arch/hp700/conf/GENERIC7
-rw-r--r--sys/arch/hpcarm/conf/IPAQ5
-rw-r--r--sys/arch/hpcarm/conf/JORNADA7207
-rw-r--r--sys/arch/hpcarm/conf/JORNADA8207
-rw-r--r--sys/arch/hpcarm/conf/WZERO37
-rw-r--r--sys/arch/hpcmips/conf/GENERIC7
-rw-r--r--sys/arch/hpcmips/conf/LROUTER5
-rw-r--r--sys/arch/hpcmips/conf/MPC3037
-rw-r--r--sys/arch/hpcmips/conf/TX39125
-rw-r--r--sys/arch/hpcmips/conf/TX39225
-rw-r--r--sys/arch/hpcmips/conf/VR41XX7
-rw-r--r--sys/arch/i386/conf/ALL7
-rw-r--r--sys/arch/i386/conf/GENERIC7
-rw-r--r--sys/arch/i386/conf/GENERIC_TINY5
-rw-r--r--sys/arch/i386/conf/INSTALL_FLOPPY5
-rw-r--r--sys/arch/i386/conf/INSTALL_TINY5
-rw-r--r--sys/arch/i386/conf/MONOLITHIC5
-rw-r--r--sys/arch/i386/conf/NET45017
-rw-r--r--sys/arch/i386/conf/XEN3_DOM05
-rw-r--r--sys/arch/i386/conf/XEN3_DOMU5
-rw-r--r--sys/arch/iyonix/conf/GENERIC7
-rw-r--r--sys/arch/landisk/conf/GENERIC7
-rw-r--r--sys/arch/luna68k/conf/GENERIC7
-rw-r--r--sys/arch/mac68k/conf/GENERIC7
-rw-r--r--sys/arch/mac68k/conf/SMALLRAM3
-rw-r--r--sys/arch/macppc/conf/GENERIC7
-rw-r--r--sys/arch/macppc/conf/MAMBO5
-rw-r--r--sys/arch/macppc/conf/POWERMAC_G53
-rw-r--r--sys/arch/mipsco/conf/GENERIC5
-rw-r--r--sys/arch/mipsco/conf/RC32305
-rw-r--r--sys/arch/mmeye/conf/GENERIC7
-rw-r--r--sys/arch/mmeye/conf/MMTA5
-rw-r--r--sys/arch/mmeye/conf/MMTAICE5
-rw-r--r--sys/arch/mmeye/conf/MMTAROMNEW5
-rw-r--r--sys/arch/mvmeppc/conf/GENERIC7
-rw-r--r--sys/arch/netwinder/conf/GENERIC5
-rw-r--r--sys/arch/news68k/conf/GENERIC7
-rw-r--r--sys/arch/news68k/conf/GENERIC_TINY7
-rw-r--r--sys/arch/news68k/conf/INSTALL5
-rw-r--r--sys/arch/news68k/conf/LIBERO5
-rw-r--r--sys/arch/news68k/conf/NEWS12005
-rw-r--r--sys/arch/newsmips/conf/GENERIC7
-rw-r--r--sys/arch/next68k/conf/GENERIC7
-rw-r--r--sys/arch/next68k/conf/SLAB5
-rw-r--r--sys/arch/ofppc/conf/GENERIC7
-rw-r--r--sys/arch/ofppc/conf/GENERIC.MP7
-rw-r--r--sys/arch/pmax/conf/GENERIC7
-rw-r--r--sys/arch/pmax/conf/GENERIC647
-rw-r--r--sys/arch/prep/conf/GENERIC7
-rw-r--r--sys/arch/rs6000/conf/GENERIC7
-rw-r--r--sys/arch/sandpoint/conf/GENERIC7
-rw-r--r--sys/arch/sbmips/conf/GENERIC7
-rw-r--r--sys/arch/sgimips/conf/GENERIC32_IP127
-rw-r--r--sys/arch/sgimips/conf/GENERIC32_IP2x7
-rw-r--r--sys/arch/sgimips/conf/GENERIC32_IP3x7
-rw-r--r--sys/arch/shark/conf/GENERIC7
-rw-r--r--sys/arch/shark/conf/INSTALL5
-rw-r--r--sys/arch/shark/conf/OFWGENCFG5
-rw-r--r--sys/arch/sparc/conf/BILL-THE-CAT5
-rw-r--r--sys/arch/sparc/conf/INSTALL5
-rw-r--r--sys/arch/sparc/conf/KRUPS7
-rw-r--r--sys/arch/sparc/conf/MRCOFFEE7
-rw-r--r--sys/arch/sparc/conf/TADPOLE3GX5
-rw-r--r--sys/arch/sparc64/conf/GENERIC7
-rw-r--r--sys/arch/sparc64/conf/NONPLUS647
-rw-r--r--sys/arch/sun2/conf/DISKLESS7
-rw-r--r--sys/arch/sun2/conf/FOURMEG7
-rw-r--r--sys/arch/sun2/conf/GENERIC7
-rw-r--r--sys/arch/sun2/conf/INSTALL7
-rw-r--r--sys/arch/sun2/conf/RAMDISK5
-rw-r--r--sys/arch/sun2/conf/VME7
-rw-r--r--sys/arch/sun3/conf/DISKLESS5
-rw-r--r--sys/arch/sun3/conf/DISKLESS3X5
-rw-r--r--sys/arch/sun3/conf/GENERIC7
-rw-r--r--sys/arch/sun3/conf/GENERIC3X7
-rw-r--r--sys/arch/sun3/conf/INSTALL5
-rw-r--r--sys/arch/sun3/conf/INSTALL3X5
-rw-r--r--sys/arch/vax/conf/GENERIC7
-rw-r--r--sys/arch/vax/conf/INSTALL5
-rw-r--r--sys/arch/vax/conf/VAX7805
-rw-r--r--sys/arch/x68k/conf/GENERIC7
-rw-r--r--sys/arch/x68k/conf/INSTALL7
-rw-r--r--sys/arch/zaurus/conf/GENERIC5
-rw-r--r--sys/compat/common/compat_mod.c5
-rw-r--r--sys/compat/common/vfs_syscalls_50.c219
-rw-r--r--sys/compat/freebsd/freebsd_syscall.h4
-rw-r--r--sys/compat/freebsd/freebsd_syscallargs.h10
-rw-r--r--sys/compat/freebsd/freebsd_syscalls.c78
-rw-r--r--sys/compat/freebsd/freebsd_sysent.c10
-rw-r--r--sys/compat/freebsd/syscalls.master6
-rw-r--r--sys/compat/netbsd32/netbsd32.h8
-rw-r--r--sys/compat/netbsd32/netbsd32_compat_50.c22
-rw-r--r--sys/compat/netbsd32/netbsd32_conv.h30
-rw-r--r--sys/compat/netbsd32/netbsd32_ioctl.h7
-rw-r--r--sys/compat/netbsd32/netbsd32_netbsd.c42
-rw-r--r--sys/compat/netbsd32/netbsd32_syscall.h13
-rw-r--r--sys/compat/netbsd32/netbsd32_syscallargs.h20
-rw-r--r--sys/compat/netbsd32/netbsd32_syscalls.c68
-rw-r--r--sys/compat/netbsd32/netbsd32_sysent.c14
-rw-r--r--sys/compat/netbsd32/syscalls.master6
-rw-r--r--sys/conf/files4
-rw-r--r--sys/fs/unionfs/unionfs_vfsops.c4
-rw-r--r--sys/kern/init_sysent.c14
-rw-r--r--sys/kern/syscalls.c10
-rw-r--r--sys/kern/syscalls.master6
-rw-r--r--sys/kern/vfs_subr.c8
-rw-r--r--sys/kern/vfs_syscalls.c27
-rw-r--r--sys/kern/vnode_if.c6
-rw-r--r--sys/miscfs/genfs/layer_extern.h4
-rw-r--r--sys/miscfs/genfs/layer_vfsops.c8
-rw-r--r--sys/modules/ffs/Makefile7
-rw-r--r--sys/rump/fs/lib/libffs/Makefile10
-rw-r--r--sys/rump/include/rump/rump_syscalls.h10
-rw-r--r--sys/rump/include/rump/rumpvnode_if.h4
-rw-r--r--sys/rump/librump/rumpkern/rump_syscalls.c38
-rw-r--r--sys/rump/librump/rumpvfs/Makefile.rumpvfs8
-rw-r--r--sys/rump/librump/rumpvfs/rumpvnode_if.c6
-rw-r--r--sys/sys/Makefile4
-rw-r--r--sys/sys/mount.h9
-rw-r--r--sys/sys/quota.h38
-rw-r--r--sys/sys/stat.h3
-rw-r--r--sys/sys/syscall.h13
-rw-r--r--sys/sys/syscallargs.h18
-rw-r--r--sys/sys/vnode_if.h4
-rw-r--r--sys/ufs/ffs/ffs_alloc.c108
-rw-r--r--sys/ufs/ffs/ffs_balloc.c8
-rw-r--r--sys/ufs/ffs/ffs_bswap.c9
-rw-r--r--sys/ufs/ffs/ffs_extern.h7
-rw-r--r--sys/ufs/ffs/ffs_inode.c6
-rw-r--r--sys/ufs/ffs/ffs_quota2.c120
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c62
-rw-r--r--sys/ufs/ffs/ffs_subr.c103
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c69
-rw-r--r--sys/ufs/ffs/fs.h11
-rw-r--r--sys/ufs/files.ufs10
-rw-r--r--sys/ufs/lfs/lfs_vfsops.c21
-rw-r--r--sys/ufs/ufs/Makefile6
-rw-r--r--sys/ufs/ufs/quota.h59
-rw-r--r--sys/ufs/ufs/quota1.h100
-rw-r--r--sys/ufs/ufs/quota1_subr.c91
-rw-r--r--sys/ufs/ufs/quota2.h115
-rw-r--r--sys/ufs/ufs/quota2_prop.c275
-rw-r--r--sys/ufs/ufs/quota2_prop.h47
-rw-r--r--sys/ufs/ufs/quota2_subr.c128
-rw-r--r--sys/ufs/ufs/ufs_bmap.c17
-rw-r--r--sys/ufs/ufs/ufs_extern.h17
-rw-r--r--sys/ufs/ufs/ufs_inode.c12
-rw-r--r--sys/ufs/ufs/ufs_quota.c1228
-rw-r--r--sys/ufs/ufs/ufs_quota.h130
-rw-r--r--sys/ufs/ufs/ufs_quota1.c856
-rw-r--r--sys/ufs/ufs/ufs_quota2.c953
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c6
-rw-r--r--sys/ufs/ufs/ufs_vfsops.c56
-rw-r--r--sys/ufs/ufs/ufs_vnops.c33
-rw-r--r--sys/ufs/ufs/ufsmount.h24
253 files changed, 4993 insertions, 1566 deletions
diff --git a/sys/arch/acorn26/conf/FOURMEG b/sys/arch/acorn26/conf/FOURMEG
index ec0a8579ecf..2f6af26ba88 100644
--- a/sys/arch/acorn26/conf/FOURMEG
+++ b/sys/arch/acorn26/conf/FOURMEG
@@ -1,4 +1,4 @@
-# $NetBSD: FOURMEG,v 1.37 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: FOURMEG,v 1.38 2011/03/06 17:08:18 bouyer Exp $
# FOURMEG arm26 configuration -- something small
@@ -48,7 +48,8 @@ file-system FDESC # /dev/fd
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER # Sun NFS-compatible file system server
options FFS_EI # FFS endianness-independence support
options NFS_V2_ONLY # Make a smaller NFS
diff --git a/sys/arch/acorn26/conf/GENERIC b/sys/arch/acorn26/conf/GENERIC
index ade7e4ea538..15dd701ce3d 100644
--- a/sys/arch/acorn26/conf/GENERIC
+++ b/sys/arch/acorn26/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.63 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: GENERIC,v 1.64 2011/03/06 17:08:18 bouyer Exp $
#
# GENERIC machine description file
#
@@ -65,7 +65,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options NFSSERVER # Sun NFS-compatible file system server
options FFS_EI # FFS endianness-independence support
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/acorn26/conf/INSTALL b/sys/arch/acorn26/conf/INSTALL
index fe7fd7cc08a..d95bd139140 100644
--- a/sys/arch/acorn26/conf/INSTALL
+++ b/sys/arch/acorn26/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.31 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: INSTALL,v 1.32 2011/03/06 17:08:18 bouyer Exp $
# INSTALL configuration, used to generate installation media
@@ -46,7 +46,8 @@ file-system KERNFS # /kern
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER # Sun NFS-compatible file system server
options FFS_EI # FFS endianness-independence support
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/acorn32/conf/EB7500ATX b/sys/arch/acorn32/conf/EB7500ATX
index 947af475b9e..405f52411f9 100644
--- a/sys/arch/acorn32/conf/EB7500ATX
+++ b/sys/arch/acorn32/conf/EB7500ATX
@@ -1,4 +1,4 @@
-# $NetBSD: EB7500ATX,v 1.41 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: EB7500ATX,v 1.42 2011/03/06 17:08:18 bouyer Exp $
#
# EB7500ATX --- NetBSD/acorn32 complete configuration
#
@@ -22,7 +22,7 @@ include "arch/acorn32/conf/std.acorn32"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "EB7500ATX-$Revision: 1.41 $"
+#ident "EB7500ATX-$Revision: 1.42 $"
# estimated number of users
maxusers 32
@@ -62,7 +62,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER
diff --git a/sys/arch/acorn32/conf/GENERIC b/sys/arch/acorn32/conf/GENERIC
index 90b926c6742..8d58ddf6adb 100644
--- a/sys/arch/acorn32/conf/GENERIC
+++ b/sys/arch/acorn32/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.97 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: GENERIC,v 1.98 2011/03/06 17:08:18 bouyer Exp $
#
# GENERIC --- NetBSD/acorn32 complete configuration
#
@@ -22,7 +22,7 @@ include "arch/acorn32/conf/std.acorn32"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.97 $"
+#ident "GENERIC-$Revision: 1.98 $"
# estimated number of users
maxusers 32
@@ -69,7 +69,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/acorn32/conf/INSTALL b/sys/arch/acorn32/conf/INSTALL
index a1c8fe31e15..ac6b1e67e4b 100644
--- a/sys/arch/acorn32/conf/INSTALL
+++ b/sys/arch/acorn32/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.58 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: INSTALL,v 1.59 2011/03/06 17:08:18 bouyer Exp $
#
# INSTALL -- NetBSD/acorn32 install configuration
#
@@ -22,7 +22,7 @@ include "arch/acorn32/conf/std.acorn32"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "INSTALL-$Revision: 1.58 $"
+#ident "INSTALL-$Revision: 1.59 $"
# estimated number of users
maxusers 32
@@ -66,7 +66,8 @@ file-system KERNFS # /kern
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options NFSSERVER
diff --git a/sys/arch/acorn32/conf/LOWMEM_WSCONS b/sys/arch/acorn32/conf/LOWMEM_WSCONS
index 28eaba4bea7..8bed959fcb0 100644
--- a/sys/arch/acorn32/conf/LOWMEM_WSCONS
+++ b/sys/arch/acorn32/conf/LOWMEM_WSCONS
@@ -1,4 +1,4 @@
-# $NetBSD: LOWMEM_WSCONS,v 1.55 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: LOWMEM_WSCONS,v 1.56 2011/03/06 17:08:18 bouyer Exp $
#
# LOWMEM_WSCONS -- RiscPC config with wscons for SMALL machines
#
@@ -53,7 +53,8 @@ file-system KERNFS # /kern
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/acorn32/conf/NC b/sys/arch/acorn32/conf/NC
index 47b9a1c7f2b..c4e5d05d730 100644
--- a/sys/arch/acorn32/conf/NC
+++ b/sys/arch/acorn32/conf/NC
@@ -1,4 +1,4 @@
-# $NetBSD: NC,v 1.53 2010/11/23 11:13:52 hannken Exp $
+# $NetBSD: NC,v 1.54 2011/03/06 17:08:18 bouyer Exp $
#
# NC - with wscons
#
@@ -48,7 +48,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER
# Networking options
diff --git a/sys/arch/alpha/conf/GENERIC b/sys/arch/alpha/conf/GENERIC
index 24ceac948ac..02ab5a6699b 100644
--- a/sys/arch/alpha/conf/GENERIC
+++ b/sys/arch/alpha/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.338 2010/11/23 11:13:53 hannken Exp $
+# $NetBSD: GENERIC,v 1.339 2011/03/06 17:08:18 bouyer Exp $
#
# This machine description file is used to generate the default NetBSD
# kernel.
@@ -19,7 +19,7 @@ include "arch/alpha/conf/std.alpha"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-ident "GENERIC-$Revision: 1.338 $"
+ident "GENERIC-$Revision: 1.339 $"
maxusers 32
@@ -91,7 +91,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC
index fe05ce1a197..a4646b217b2 100644
--- a/sys/arch/amd64/conf/GENERIC
+++ b/sys/arch/amd64/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.316 2011/03/04 04:48:40 jruoho Exp $
+# $NetBSD: GENERIC,v 1.317 2011/03/06 17:08:19 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.316 $"
+#ident "GENERIC-$Revision: 1.317 $"
maxusers 64 # estimated number of users
@@ -160,7 +160,8 @@ file-system TMPFS # Efficient memory file-system
#file-system NILFS # experimental - NTT's NiLFS(2)
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
diff --git a/sys/arch/amd64/conf/XEN3_DOM0 b/sys/arch/amd64/conf/XEN3_DOM0
index 1520c71695f..b1e8609d5f5 100644
--- a/sys/arch/amd64/conf/XEN3_DOM0
+++ b/sys/arch/amd64/conf/XEN3_DOM0
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.64 2011/02/24 10:56:00 jruoho Exp $
+# $NetBSD: XEN3_DOM0,v 1.65 2011/03/06 17:08:19 bouyer Exp $
include "arch/amd64/conf/std.xen"
@@ -105,7 +105,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # Efficient memory file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/amd64/conf/XEN3_DOMU b/sys/arch/amd64/conf/XEN3_DOMU
index 6dccdc1f735..bdadbcc1da6 100644
--- a/sys/arch/amd64/conf/XEN3_DOMU
+++ b/sys/arch/amd64/conf/XEN3_DOMU
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.26 2010/11/23 11:13:54 hannken Exp $
+# $NetBSD: XEN3_DOMU,v 1.27 2011/03/06 17:08:19 bouyer Exp $
include "arch/amd64/conf/std.xen"
@@ -92,7 +92,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # Efficient memory file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/amiga/conf/DRACO b/sys/arch/amiga/conf/DRACO
index 2445de51047..ab043667196 100644
--- a/sys/arch/amiga/conf/DRACO
+++ b/sys/arch/amiga/conf/DRACO
@@ -1,4 +1,4 @@
-# $NetBSD: DRACO,v 1.136 2011/01/14 10:03:44 phx Exp $
+# $NetBSD: DRACO,v 1.137 2011/03/06 17:08:19 bouyer Exp $
#
# This file was automatically created.
# Changes will be lost when make is run in this directory.
@@ -28,7 +28,7 @@ include "arch/amiga/conf/std.amiga"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.136 $"
+#ident "GENERIC-$Revision: 1.137 $"
maxusers 8
@@ -115,7 +115,8 @@ file-system TMPFS # Efficient memory file-system
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
-options QUOTA # User and group quotas in FFS
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
options NFSSERVER # Network File System server side code
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/amiga/conf/GENERIC b/sys/arch/amiga/conf/GENERIC
index a0058eb9d96..22a8057f78e 100644
--- a/sys/arch/amiga/conf/GENERIC
+++ b/sys/arch/amiga/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.265 2011/01/14 10:03:44 phx Exp $
+# $NetBSD: GENERIC,v 1.266 2011/03/06 17:08:19 bouyer Exp $
#
# This file was automatically created.
# Changes will be lost when make is run in this directory.
@@ -28,7 +28,7 @@ include "arch/amiga/conf/std.amiga"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.265 $"
+#ident "GENERIC-$Revision: 1.266 $"
maxusers 8
@@ -127,7 +127,8 @@ file-system TMPFS # Efficient memory file-system
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
-options QUOTA # User and group quotas in FFS
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
options NFSSERVER # Network File System server side code
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/amiga/conf/GENERIC.in b/sys/arch/amiga/conf/GENERIC.in
index d6c23128fc3..626bac60865 100644
--- a/sys/arch/amiga/conf/GENERIC.in
+++ b/sys/arch/amiga/conf/GENERIC.in
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.77 2011/01/14 10:01:12 phx Exp $
+# $NetBSD: GENERIC.in,v 1.78 2011/03/06 17:08:19 bouyer Exp $
#
# GENERIC machine description file
#
@@ -56,7 +56,7 @@ include "arch/amiga/conf/std.amiga"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.77 $"
+#ident "GENERIC-$Revision: 1.78 $"
m4_ifdef(`INSTALL_CONFIGURATION', `m4_dnl
makeoptions COPTS="-Os"
@@ -171,7 +171,8 @@ file-system TMPFS # Efficient memory file-system
options WAPBL # File system journaling support - Experimental
m4_ifdef(`INSTALL_CONFIGURATION', `', `m4_dnl
-options QUOTA # User and group quotas in FFS
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
options NFSSERVER # Network File System server side code
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/amigappc/conf/GENERIC b/sys/arch/amigappc/conf/GENERIC
index 4b48994bbb4..0346253b632 100644
--- a/sys/arch/amigappc/conf/GENERIC
+++ b/sys/arch/amigappc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.6 2011/01/14 12:54:39 phx Exp $
+# $NetBSD: GENERIC,v 1.7 2011/03/06 17:08:20 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/amigappc/conf/std.amigappc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.6 $"
+#ident "GENERIC-$Revision: 1.7 $"
maxusers 8
@@ -123,7 +123,8 @@ file-system TMPFS # Efficient memory file-system
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
-options QUOTA # User and group quotas in FFS
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
options NFSSERVER # Network File System server side code
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/amigappc/conf/NULL b/sys/arch/amigappc/conf/NULL
index d3e108933da..c05842e4831 100644
--- a/sys/arch/amigappc/conf/NULL
+++ b/sys/arch/amigappc/conf/NULL
@@ -1,4 +1,4 @@
-# $NetBSD: NULL,v 1.29 2011/01/14 12:54:39 phx Exp $
+# $NetBSD: NULL,v 1.30 2011/03/06 17:08:20 bouyer Exp $
#
# NULL machine description file
#
@@ -7,7 +7,7 @@ include "arch/amigappc/conf/std.amigappc"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.29 $"
+#ident "GENERIC-$Revision: 1.30 $"
maxusers 8
@@ -107,7 +107,8 @@ file-system TMPFS # Efficient memory file-system
#options FFS_EI # FFS Endian Independant support
#options WAPBL # File system journaling support - Experimental
-#options QUOTA # User and group quotas in FFS
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
#options NFSSERVER # Network File System server side code
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/arc/conf/ARCTIC b/sys/arch/arc/conf/ARCTIC
index 9eb70be86ae..b9089c2b067 100644
--- a/sys/arch/arc/conf/ARCTIC
+++ b/sys/arch/arc/conf/ARCTIC
@@ -1,4 +1,4 @@
-# $NetBSD: ARCTIC,v 1.55 2010/11/23 11:13:54 hannken Exp $
+# $NetBSD: ARCTIC,v 1.56 2011/03/06 17:08:20 bouyer Exp $
# $OpenBSD: ARCTIC,v 1.12 1999/08/29 12:14:03 niklas Exp $
#
# configuration file for DeskStation
@@ -84,7 +84,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options NFSSERVER # Network File System server
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
diff --git a/sys/arch/arc/conf/GENERIC b/sys/arch/arc/conf/GENERIC
index 5dcc8130966..4ba9497a628 100644
--- a/sys/arch/arc/conf/GENERIC
+++ b/sys/arch/arc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.166 2011/03/06 14:58:43 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.167 2011/03/06 17:08:20 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/arc/conf/std.arc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.166 $"
+#ident "GENERIC-$Revision: 1.167 $"
maxusers 32 # estimated number of users
@@ -119,7 +119,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/arc/conf/M403 b/sys/arch/arc/conf/M403
index 5409b682bfa..218a77b8ed4 100644
--- a/sys/arch/arc/conf/M403
+++ b/sys/arch/arc/conf/M403
@@ -1,4 +1,4 @@
-# $NetBSD: M403,v 1.51 2010/11/23 11:13:54 hannken Exp $
+# $NetBSD: M403,v 1.52 2011/03/06 17:08:20 bouyer Exp $
#
# configuration file for MIPS Magnum 4000 system
#
@@ -77,7 +77,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options NFSSERVER # Network File System server
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/arc/conf/MIMORI b/sys/arch/arc/conf/MIMORI
index c1545a4179e..2a113c29cb0 100644
--- a/sys/arch/arc/conf/MIMORI
+++ b/sys/arch/arc/conf/MIMORI
@@ -1,4 +1,4 @@
-# $NetBSD: MIMORI,v 1.56 2010/11/23 11:13:54 hannken Exp $
+# $NetBSD: MIMORI,v 1.57 2011/03/06 17:08:20 bouyer Exp $
# NetBSD: GENERIC,v 1.31 2000/06/09 05:33:02 soda Exp
#
# MIMORI -- My NEC RISCstation 2250 (ur)
@@ -79,7 +79,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options NFSSERVER # Network File System server
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
diff --git a/sys/arch/arc/conf/PICA b/sys/arch/arc/conf/PICA
index 40e5f1ed2e7..6593fe12d8c 100644
--- a/sys/arch/arc/conf/PICA
+++ b/sys/arch/arc/conf/PICA
@@ -1,4 +1,4 @@
-# $NetBSD: PICA,v 1.68 2010/11/23 11:13:54 hannken Exp $
+# $NetBSD: PICA,v 1.69 2011/03/06 17:08:20 bouyer Exp $
#
# configuration file for ACER PICA system
#
@@ -78,7 +78,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options NFSSERVER # Network File System server
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/arc/conf/RAMDISK b/sys/arch/arc/conf/RAMDISK
index 8437e522720..d7cae6d30dc 100644
--- a/sys/arch/arc/conf/RAMDISK
+++ b/sys/arch/arc/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.78 2009/12/07 08:50:01 he Exp $
+# $NetBSD: RAMDISK,v 1.79 2011/03/06 17:08:20 bouyer Exp $
#
# memory disk based configuration file for MIPS R4x00 ARC Systems
#
@@ -44,6 +44,7 @@ no file-system TMPFS
no file-system PTYFS
no options QUOTA
+no options QUOTA2
no options NFSSERVER
no options PPP_FILTER
no options NETATALK
diff --git a/sys/arch/arc/conf/RPC44 b/sys/arch/arc/conf/RPC44
index 32abfd08952..5bea485bb3a 100644
--- a/sys/arch/arc/conf/RPC44
+++ b/sys/arch/arc/conf/RPC44
@@ -1,4 +1,4 @@
-# $NetBSD: RPC44,v 1.38 2011/03/06 14:58:43 tsutsui Exp $
+# $NetBSD: RPC44,v 1.39 2011/03/06 17:08:20 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/arc/conf/std.arc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.38 $"
+#ident "GENERIC-$Revision: 1.39 $"
maxusers 32 # estimated number of users
@@ -105,7 +105,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options NFSSERVER # Network File System server
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/atari/conf/GENERIC.in b/sys/arch/atari/conf/GENERIC.in
index 52d086f985a..284d8726e97 100644
--- a/sys/arch/atari/conf/GENERIC.in
+++ b/sys/arch/atari/conf/GENERIC.in
@@ -1,5 +1,5 @@
#
-# $NetBSD: GENERIC.in,v 1.92 2010/12/12 09:56:15 tsutsui Exp $
+# $NetBSD: GENERIC.in,v 1.93 2011/03/06 17:08:20 bouyer Exp $
#
# Generic atari
#
@@ -134,7 +134,8 @@ file-system TMPFS # Efficient memory file-system
# File system options
options WAPBL # File system journaling support - Experimental
#if !defined(SMALL030_KERNEL)
-#options QUOTA # Disk quotas for local disks
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
options NFSSERVER # Network File System server side code
diff --git a/sys/arch/bebox/conf/GENERIC b/sys/arch/bebox/conf/GENERIC
index e4ee7c9182b..287af9e21a1 100644
--- a/sys/arch/bebox/conf/GENERIC
+++ b/sys/arch/bebox/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.125 2010/11/23 11:13:55 hannken Exp $
+# $NetBSD: GENERIC,v 1.126 2011/03/06 17:08:20 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/bebox/conf/std.bebox"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.125 $"
+#ident "GENERIC-$Revision: 1.126 $"
maxusers 32
@@ -97,7 +97,8 @@ file-system TMPFS # Efficient memory file-system
#file-system HFS # experimental - Apple HFS+ (read-only)
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/cats/conf/GENERIC b/sys/arch/cats/conf/GENERIC
index e8431be8314..e91e116e640 100644
--- a/sys/arch/cats/conf/GENERIC
+++ b/sys/arch/cats/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.133 2010/11/23 11:13:55 hannken Exp $
+# $NetBSD: GENERIC,v 1.134 2011/03/06 17:08:21 bouyer Exp $
#
# GENERIC machine description file
#
@@ -76,7 +76,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/cats/conf/INSTALL b/sys/arch/cats/conf/INSTALL
index f56e7b8ce23..03b848817d8 100644
--- a/sys/arch/cats/conf/INSTALL
+++ b/sys/arch/cats/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.77 2010/11/23 11:13:55 hannken Exp $
+# $NetBSD: INSTALL,v 1.78 2011/03/06 17:08:21 bouyer Exp $
#
# CATSINST -- CHALTECH CATS Install kernel
#
@@ -49,7 +49,8 @@ file-system KERNFS # /kern
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/cesfic/conf/GENERIC b/sys/arch/cesfic/conf/GENERIC
index 2f098c5e29c..6f7a251244e 100644
--- a/sys/arch/cesfic/conf/GENERIC
+++ b/sys/arch/cesfic/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.53 2010/02/08 19:02:27 joerg Exp $
+# $NetBSD: GENERIC,v 1.54 2011/03/06 17:08:21 bouyer Exp $
#
# GENERIC machine description file
#
@@ -78,7 +78,8 @@ file-system PTYFS # /dev/pts/N support
# Filesystem options
options FIFO # POSIX fifo support (in all filesystems)
-#options QUOTA # User and group quotas in FFS
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER # Network filesystem server
# Networking options
diff --git a/sys/arch/cobalt/conf/GENERIC b/sys/arch/cobalt/conf/GENERIC
index aec85951119..c83ba3b3360 100644
--- a/sys/arch/cobalt/conf/GENERIC
+++ b/sys/arch/cobalt/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.128 2011/02/20 07:54:10 matt Exp $
+# $NetBSD: GENERIC,v 1.129 2011/03/06 17:08:21 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/cobalt/conf/std.cobalt"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.128 $"
+#ident "GENERIC-$Revision: 1.129 $"
maxusers 32
@@ -93,7 +93,8 @@ file-system TMPFS # Efficient memory file-system
# File system options
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/cobalt/conf/INSTALL b/sys/arch/cobalt/conf/INSTALL
index dc749ea0e12..e4437bef4e7 100644
--- a/sys/arch/cobalt/conf/INSTALL
+++ b/sys/arch/cobalt/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.42 2010/11/23 11:13:55 hannken Exp $
+# $NetBSD: INSTALL,v 1.43 2011/03/06 17:08:21 bouyer Exp $
#
# INSTALL -- installation and rescue kernel.
#
@@ -10,7 +10,7 @@ include "arch/cobalt/conf/std.cobalt"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "INSTALL-$Revision: 1.42 $"
+#ident "INSTALL-$Revision: 1.43 $"
makeoptions COPTS="-Os -mmemcpy"
makeoptions CPUFLAGS="-march=vr5000 -mabi=32"
@@ -83,7 +83,8 @@ file-system MFS # memory-based filesystem
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/dreamcast/conf/GENERIC b/sys/arch/dreamcast/conf/GENERIC
index 531b47de3db..233a9a9d2ec 100644
--- a/sys/arch/dreamcast/conf/GENERIC
+++ b/sys/arch/dreamcast/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.100 2011/01/03 06:07:42 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.101 2011/03/06 17:08:22 bouyer Exp $
#
# GENERIC machine description file
#
@@ -90,7 +90,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent supoprt
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/emips/conf/GENERIC b/sys/arch/emips/conf/GENERIC
index 6c7058b8d15..103ecafbc0f 100644
--- a/sys/arch/emips/conf/GENERIC
+++ b/sys/arch/emips/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1 2011/01/26 01:18:49 pooka Exp $
+# $NetBSD: GENERIC,v 1.2 2011/03/06 17:08:22 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/emips/conf/std.emips"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.1 $"
+#ident "GENERIC-$Revision: 1.2 $"
maxusers 64
@@ -90,7 +90,8 @@ file-system TMPFS # Efficient memory file-system
file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # Sun NFS-compatible filesystem (server)
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
#options FFS_NO_SNAPSHOT # No FFS snapshot support
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/evbarm/conf/ADI_BRH b/sys/arch/evbarm/conf/ADI_BRH
index 1858cf3b88a..9ae30026291 100644
--- a/sys/arch/evbarm/conf/ADI_BRH
+++ b/sys/arch/evbarm/conf/ADI_BRH
@@ -1,4 +1,4 @@
-# $NetBSD: ADI_BRH,v 1.52 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: ADI_BRH,v 1.53 2011/03/06 17:08:22 bouyer Exp $
#
# ADI_BRH -- ADI Engineering "Big Red Head" i80200 Evaluation Board
#
@@ -45,7 +45,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/ARMADILLO210 b/sys/arch/evbarm/conf/ARMADILLO210
index 446f89a428d..4b5e9f2c439 100644
--- a/sys/arch/evbarm/conf/ARMADILLO210
+++ b/sys/arch/evbarm/conf/ARMADILLO210
@@ -1,4 +1,4 @@
-# $NetBSD: ARMADILLO210,v 1.16 2010/11/23 11:13:56 hannken Exp $
+# $NetBSD: ARMADILLO210,v 1.17 2011/03/06 17:08:22 bouyer Exp $
#
# ARMADILLO210 -- Atmark Techno, Armadillo-210
#
@@ -38,7 +38,8 @@ file-system NFS # Network file system
#file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/evbarm/conf/ARMADILLO9 b/sys/arch/evbarm/conf/ARMADILLO9
index bb7c91d0c06..45009a62d21 100644
--- a/sys/arch/evbarm/conf/ARMADILLO9
+++ b/sys/arch/evbarm/conf/ARMADILLO9
@@ -1,4 +1,4 @@
-# $NetBSD: ARMADILLO9,v 1.28 2010/11/23 11:13:56 hannken Exp $
+# $NetBSD: ARMADILLO9,v 1.29 2011/03/06 17:08:22 bouyer Exp $
#
# ARMADILLO9 -- Atmark Techno, Armadillo-9
#
@@ -38,7 +38,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/evbarm/conf/BEAGLEBOARD b/sys/arch/evbarm/conf/BEAGLEBOARD
index a4ff4fb8c8e..55175e0eaf6 100644
--- a/sys/arch/evbarm/conf/BEAGLEBOARD
+++ b/sys/arch/evbarm/conf/BEAGLEBOARD
@@ -1,5 +1,5 @@
#
-# $NetBSD: BEAGLEBOARD,v 1.17 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: BEAGLEBOARD,v 1.18 2011/03/06 17:08:22 bouyer Exp $
#
# BEAGLEBOARD -- TI OMAP 3530 Eval Board Kernel
#
@@ -43,7 +43,8 @@ file-system TMPFS # memory file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/CP3100 b/sys/arch/evbarm/conf/CP3100
index 0f11675bfac..4b4a0dc7f97 100644
--- a/sys/arch/evbarm/conf/CP3100
+++ b/sys/arch/evbarm/conf/CP3100
@@ -1,4 +1,4 @@
-# $NetBSD: CP3100,v 1.20 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: CP3100,v 1.21 2011/03/06 17:08:22 bouyer Exp $
#
# CP3100 -- Certance CP3100 Kernel
#
@@ -45,7 +45,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/GEMINI b/sys/arch/evbarm/conf/GEMINI
index 3400b2c1d8c..a0c288ec2fc 100644
--- a/sys/arch/evbarm/conf/GEMINI
+++ b/sys/arch/evbarm/conf/GEMINI
@@ -40,7 +40,8 @@ file-system MSDOSFS # MS-DOS file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
#options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/GEMINI_MASTER b/sys/arch/evbarm/conf/GEMINI_MASTER
index f78cdccff44..11df4f27347 100644
--- a/sys/arch/evbarm/conf/GEMINI_MASTER
+++ b/sys/arch/evbarm/conf/GEMINI_MASTER
@@ -41,7 +41,8 @@ file-system MSDOSFS # MS-DOS file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
#options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/GEMINI_SLAVE b/sys/arch/evbarm/conf/GEMINI_SLAVE
index abac2301c33..52ff48eda39 100644
--- a/sys/arch/evbarm/conf/GEMINI_SLAVE
+++ b/sys/arch/evbarm/conf/GEMINI_SLAVE
@@ -40,7 +40,8 @@ file-system MSDOSFS # MS-DOS file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
#options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/GUMSTIX b/sys/arch/evbarm/conf/GUMSTIX
index a789865af5c..07114aab36e 100644
--- a/sys/arch/evbarm/conf/GUMSTIX
+++ b/sys/arch/evbarm/conf/GUMSTIX
@@ -1,4 +1,4 @@
-# $NetBSD: GUMSTIX,v 1.55 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: GUMSTIX,v 1.56 2011/03/06 17:08:22 bouyer Exp $
#
# GUMSTIX -- Gumstix. Inc. gumstix platforms kernel
#
@@ -60,7 +60,8 @@ file-system TMPFS # Efficient memory file-system
#file-system HFS # experimental - Apple HFS+ (read-only)
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
diff --git a/sys/arch/evbarm/conf/HDL_G b/sys/arch/evbarm/conf/HDL_G
index 6bb88efc400..2d890bf47d9 100644
--- a/sys/arch/evbarm/conf/HDL_G
+++ b/sys/arch/evbarm/conf/HDL_G
@@ -1,4 +1,4 @@
-# $NetBSD: HDL_G,v 1.21 2011/03/06 02:18:36 jakllsch Exp $
+# $NetBSD: HDL_G,v 1.22 2011/03/06 17:08:22 bouyer Exp $
#
# HDL_G -- I-O DATA HDL-G Kernel
#
@@ -48,7 +48,8 @@ file-system UMAPFS # NULLFS + uid and gid remapping
file-system UNION # union file system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/IGEPV2 b/sys/arch/evbarm/conf/IGEPV2
index c015407d384..8280a508039 100644
--- a/sys/arch/evbarm/conf/IGEPV2
+++ b/sys/arch/evbarm/conf/IGEPV2
@@ -1,5 +1,5 @@
#
-# $NetBSD: IGEPV2,v 1.4 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: IGEPV2,v 1.5 2011/03/06 17:08:22 bouyer Exp $
#
# IGEPv2 -- TI OMAP 3530 Eval Board Kernel
#
@@ -44,7 +44,8 @@ file-system TMPFS # memory file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
#options SOFTDEP
diff --git a/sys/arch/evbarm/conf/IMX31LITE b/sys/arch/evbarm/conf/IMX31LITE
index 1160cbc5fcd..a727dc6ba9c 100644
--- a/sys/arch/evbarm/conf/IMX31LITE
+++ b/sys/arch/evbarm/conf/IMX31LITE
@@ -1,4 +1,4 @@
-# $NetBSD: IMX31LITE,v 1.12 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: IMX31LITE,v 1.13 2011/03/06 17:08:22 bouyer Exp $
#
# IMX31LITE -- Freescale IMX31LITE Evaluation Board Kernel
#
@@ -44,7 +44,8 @@ file-system TMPFS # memory file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/INTEGRATOR b/sys/arch/evbarm/conf/INTEGRATOR
index 334ae670c17..111eccecc3b 100644
--- a/sys/arch/evbarm/conf/INTEGRATOR
+++ b/sys/arch/evbarm/conf/INTEGRATOR
@@ -1,4 +1,4 @@
-# $NetBSD: INTEGRATOR,v 1.60 2011/03/06 02:18:36 jakllsch Exp $
+# $NetBSD: INTEGRATOR,v 1.61 2011/03/06 17:08:22 bouyer Exp $
#
# GENERIC -- ARM Integrator board Generic kernel
#
@@ -45,7 +45,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/IQ31244 b/sys/arch/evbarm/conf/IQ31244
index c6a77850d6a..781d20dd30e 100644
--- a/sys/arch/evbarm/conf/IQ31244
+++ b/sys/arch/evbarm/conf/IQ31244
@@ -1,4 +1,4 @@
-# $NetBSD: IQ31244,v 1.51 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: IQ31244,v 1.52 2011/03/06 17:08:22 bouyer Exp $
#
# IQ31244 -- Intel IQ31244 Evaluation Board Kernel
#
@@ -45,7 +45,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/IQ80310 b/sys/arch/evbarm/conf/IQ80310
index ef9d2be1cb3..bf6307ed8ab 100644
--- a/sys/arch/evbarm/conf/IQ80310
+++ b/sys/arch/evbarm/conf/IQ80310
@@ -1,4 +1,4 @@
-# $NetBSD: IQ80310,v 1.70 2011/03/06 02:18:36 jakllsch Exp $
+# $NetBSD: IQ80310,v 1.71 2011/03/06 17:08:22 bouyer Exp $
#
# IQ80310 -- Intel IQ80310 Evaluation Board Kernel
#
@@ -45,7 +45,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/IQ80321 b/sys/arch/evbarm/conf/IQ80321
index 7e0f430f336..e4954ed5706 100644
--- a/sys/arch/evbarm/conf/IQ80321
+++ b/sys/arch/evbarm/conf/IQ80321
@@ -1,4 +1,4 @@
-# $NetBSD: IQ80321,v 1.66 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: IQ80321,v 1.67 2011/03/06 17:08:22 bouyer Exp $
#
# IQ80321 -- Intel IQ80321 Evaluation Board Kernel
#
@@ -45,7 +45,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/IXDP425 b/sys/arch/evbarm/conf/IXDP425
index c2282296dd8..792f23218d0 100644
--- a/sys/arch/evbarm/conf/IXDP425
+++ b/sys/arch/evbarm/conf/IXDP425
@@ -1,4 +1,4 @@
-# $NetBSD: IXDP425,v 1.31 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: IXDP425,v 1.32 2011/03/06 17:08:22 bouyer Exp $
#
# IXDP425 -- Intel IXDP425/IXCDP1100 Development Platform
#
@@ -49,7 +49,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/IXM1200 b/sys/arch/evbarm/conf/IXM1200
index 95790a863f3..55225e5f37c 100644
--- a/sys/arch/evbarm/conf/IXM1200
+++ b/sys/arch/evbarm/conf/IXM1200
@@ -1,4 +1,4 @@
-# $NetBSD: IXM1200,v 1.43 2011/03/06 02:22:27 jakllsch Exp $
+# $NetBSD: IXM1200,v 1.44 2011/03/06 17:08:22 bouyer Exp $
#
# IXM1200 -- Intel IXM1200 Evaluation Board Kernel
#
@@ -44,7 +44,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/LUBBOCK b/sys/arch/evbarm/conf/LUBBOCK
index 92bca845f4e..4aa2fe09df1 100644
--- a/sys/arch/evbarm/conf/LUBBOCK
+++ b/sys/arch/evbarm/conf/LUBBOCK
@@ -43,7 +43,8 @@ file-system MSDOSFS # MS-DOS file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/MARVELL_NAS b/sys/arch/evbarm/conf/MARVELL_NAS
index c3402c01a9d..69e88edee1e 100644
--- a/sys/arch/evbarm/conf/MARVELL_NAS
+++ b/sys/arch/evbarm/conf/MARVELL_NAS
@@ -1,4 +1,4 @@
-# $NetBSD: MARVELL_NAS,v 1.2 2010/11/23 11:13:56 hannken Exp $
+# $NetBSD: MARVELL_NAS,v 1.3 2011/03/06 17:08:22 bouyer Exp $
#
# This configuration supports for generically Marvell NAS.
@@ -52,7 +52,8 @@ file-system UDF # experimental - OSTA UDF CD/DVD file-system
file-system HFS # experimental - Apple HFS+ (read-only)
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
diff --git a/sys/arch/evbarm/conf/MPCSA_GENERIC b/sys/arch/evbarm/conf/MPCSA_GENERIC
index 8c4fc122db8..bf058fd9102 100644
--- a/sys/arch/evbarm/conf/MPCSA_GENERIC
+++ b/sys/arch/evbarm/conf/MPCSA_GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: MPCSA_GENERIC,v 1.18 2011/02/06 23:25:16 jmcneill Exp $
+# $NetBSD: MPCSA_GENERIC,v 1.19 2011/03/06 17:08:22 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/evbarm/conf/std.mpcsa"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.18 $"
+#ident "GENERIC-$Revision: 1.19 $"
maxusers 32 # estimated number of users
@@ -149,7 +149,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
diff --git a/sys/arch/evbarm/conf/NAPPI b/sys/arch/evbarm/conf/NAPPI
index 6be2139a126..1cda41decee 100644
--- a/sys/arch/evbarm/conf/NAPPI
+++ b/sys/arch/evbarm/conf/NAPPI
@@ -1,4 +1,4 @@
-# $NetBSD: NAPPI,v 1.39 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: NAPPI,v 1.40 2011/03/06 17:08:22 bouyer Exp $
#
# NAPPI -- Netwise APlication Platform Board Kernel
#
@@ -44,7 +44,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/NETWALKER b/sys/arch/evbarm/conf/NETWALKER
index 57a80270ba2..45ad1147b56 100644
--- a/sys/arch/evbarm/conf/NETWALKER
+++ b/sys/arch/evbarm/conf/NETWALKER
@@ -1,4 +1,4 @@
-# $NetBSD: NETWALKER,v 1.3 2010/11/30 13:07:29 bsh Exp $
+# $NetBSD: NETWALKER,v 1.4 2011/03/06 17:08:22 bouyer Exp $
#
# NETWALKER -- Sharp
#
@@ -46,7 +46,8 @@ file-system TMPFS # memory file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/NSLU2 b/sys/arch/evbarm/conf/NSLU2
index 8f95166ebb4..6fc79858ecd 100644
--- a/sys/arch/evbarm/conf/NSLU2
+++ b/sys/arch/evbarm/conf/NSLU2
@@ -1,4 +1,4 @@
-# $NetBSD: NSLU2,v 1.17 2010/11/23 11:13:56 hannken Exp $
+# $NetBSD: NSLU2,v 1.18 2011/03/06 17:08:22 bouyer Exp $
#
# Linksys NSLU2 "Slug" NAS Device
#
@@ -50,7 +50,8 @@ file-system NFS # Network file system
#file-system UNION # union file system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
diff --git a/sys/arch/evbarm/conf/OSK5912 b/sys/arch/evbarm/conf/OSK5912
index 80626e246b8..0b5fac5c246 100644
--- a/sys/arch/evbarm/conf/OSK5912
+++ b/sys/arch/evbarm/conf/OSK5912
@@ -38,7 +38,8 @@ file-system MSDOSFS # MS-DOS file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/OVERO b/sys/arch/evbarm/conf/OVERO
index 5bf3bf9b7d7..a685f435cf1 100644
--- a/sys/arch/evbarm/conf/OVERO
+++ b/sys/arch/evbarm/conf/OVERO
@@ -1,5 +1,5 @@
#
-# $NetBSD: OVERO,v 1.7 2010/11/23 11:13:56 hannken Exp $
+# $NetBSD: OVERO,v 1.8 2011/03/06 17:08:22 bouyer Exp $
#
# OVERO -- Gumstix. Inc. Overo platforms kernel
#
@@ -58,7 +58,8 @@ file-system PTYFS # /dev/pts/N support
#file-system HFS # experimental - Apple HFS+ (read-only)
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/evbarm/conf/SHEEVAPLUG b/sys/arch/evbarm/conf/SHEEVAPLUG
index 64e2db02486..0def142422c 100644
--- a/sys/arch/evbarm/conf/SHEEVAPLUG
+++ b/sys/arch/evbarm/conf/SHEEVAPLUG
@@ -1,4 +1,4 @@
-# $NetBSD: SHEEVAPLUG,v 1.4 2011/03/06 02:22:27 jakllsch Exp $
+# $NetBSD: SHEEVAPLUG,v 1.5 2011/03/06 17:08:22 bouyer Exp $
#
# This configuration supports for generically Marvell SheevaPlug
#
@@ -56,7 +56,8 @@ file-system TMPFS # Efficient memory file-system
#file-system HFS # experimental - Apple HFS+ (read-only)
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
diff --git a/sys/arch/evbarm/conf/SMDK2410 b/sys/arch/evbarm/conf/SMDK2410
index 504f18b3e74..1572836d7a7 100644
--- a/sys/arch/evbarm/conf/SMDK2410
+++ b/sys/arch/evbarm/conf/SMDK2410
@@ -1,4 +1,4 @@
-# $NetBSD: SMDK2410,v 1.42 2010/11/23 11:13:56 hannken Exp $
+# $NetBSD: SMDK2410,v 1.43 2011/03/06 17:08:22 bouyer Exp $
#
# SMDK2410 -- Samsung's S3C2410 evaluation board.
#
@@ -56,7 +56,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/SMDK2800 b/sys/arch/evbarm/conf/SMDK2800
index e3fd5997b48..e52f3ccfb6f 100644
--- a/sys/arch/evbarm/conf/SMDK2800
+++ b/sys/arch/evbarm/conf/SMDK2800
@@ -1,4 +1,4 @@
-# $NetBSD: SMDK2800,v 1.42 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: SMDK2800,v 1.43 2011/03/06 17:08:23 bouyer Exp $
#
# SMDK2800 -- Samsung's S3C2800 evaluation board.
#
@@ -52,7 +52,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/TEAMASA_NPWR b/sys/arch/evbarm/conf/TEAMASA_NPWR
index c1ad40dca55..e55fa82373a 100644
--- a/sys/arch/evbarm/conf/TEAMASA_NPWR
+++ b/sys/arch/evbarm/conf/TEAMASA_NPWR
@@ -1,4 +1,4 @@
-# $NetBSD: TEAMASA_NPWR,v 1.67 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: TEAMASA_NPWR,v 1.68 2011/03/06 17:08:23 bouyer Exp $
#
# TEAMASA_NPWR -- Team ASA, Inc. Npwr -- XScale/IOP310-based
# server appliance.
@@ -48,7 +48,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/TEAMASA_NPWR_FC b/sys/arch/evbarm/conf/TEAMASA_NPWR_FC
index 775a3fe06e9..ca1811d97c4 100644
--- a/sys/arch/evbarm/conf/TEAMASA_NPWR_FC
+++ b/sys/arch/evbarm/conf/TEAMASA_NPWR_FC
@@ -1,4 +1,4 @@
-# $NetBSD: TEAMASA_NPWR_FC,v 1.31 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: TEAMASA_NPWR_FC,v 1.32 2011/03/06 17:08:23 bouyer Exp $
#
# TeamASA NPWR-FC, i80321-based SBC
#
@@ -46,7 +46,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/TISDP2420 b/sys/arch/evbarm/conf/TISDP2420
index 649171eafc2..bd70aa61310 100644
--- a/sys/arch/evbarm/conf/TISDP2420
+++ b/sys/arch/evbarm/conf/TISDP2420
@@ -1,5 +1,5 @@
#
-# $NetBSD: TISDP2420,v 1.15 2011/03/06 02:22:27 jakllsch Exp $
+# $NetBSD: TISDP2420,v 1.16 2011/03/06 17:08:23 bouyer Exp $
#
# TISDP2420 -- TI OMAP 2420 Eval Board Kernel
#
@@ -43,7 +43,8 @@ file-system TMPFS # memory file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/TISDP2430 b/sys/arch/evbarm/conf/TISDP2430
index 46fd299f32a..0df820ddf67 100644
--- a/sys/arch/evbarm/conf/TISDP2430
+++ b/sys/arch/evbarm/conf/TISDP2430
@@ -1,5 +1,5 @@
#
-# $NetBSD: TISDP2430,v 1.15 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: TISDP2430,v 1.16 2011/03/06 17:08:23 bouyer Exp $
#
# TISDP2430 -- TI OMAP 2430 Eval Board Kernel
#
@@ -42,7 +42,8 @@ file-system TMPFS # memory file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/TS7200 b/sys/arch/evbarm/conf/TS7200
index 1ff59ab04c7..4f5a7fa6364 100644
--- a/sys/arch/evbarm/conf/TS7200
+++ b/sys/arch/evbarm/conf/TS7200
@@ -1,4 +1,4 @@
-# $NetBSD: TS7200,v 1.43 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: TS7200,v 1.44 2011/03/06 17:08:23 bouyer Exp $
#
# TS7200 - Kernel for Technologic Systems TS7200 ARM hardware
#
@@ -51,7 +51,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/TWINTAIL b/sys/arch/evbarm/conf/TWINTAIL
index cb8f13c4e0c..91f800cab4f 100644
--- a/sys/arch/evbarm/conf/TWINTAIL
+++ b/sys/arch/evbarm/conf/TWINTAIL
@@ -1,4 +1,4 @@
-# $NetBSD: TWINTAIL,v 1.40 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: TWINTAIL,v 1.41 2011/03/06 17:08:23 bouyer Exp $
#
# TWINTAIL -- Genetec corp. G4255EB-X002 Evaluation Board Kernel
#
@@ -50,7 +50,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbarm/conf/VIPER b/sys/arch/evbarm/conf/VIPER
index 0264d3d45d4..30901fe038a 100644
--- a/sys/arch/evbarm/conf/VIPER
+++ b/sys/arch/evbarm/conf/VIPER
@@ -1,4 +1,4 @@
-# $NetBSD: VIPER,v 1.20 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: VIPER,v 1.21 2011/03/06 17:08:23 bouyer Exp $
#
# Arcom Viper
#
@@ -43,7 +43,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
diff --git a/sys/arch/evbarm/conf/ZAO425 b/sys/arch/evbarm/conf/ZAO425
index 16b894a8cb4..d102336c1ca 100644
--- a/sys/arch/evbarm/conf/ZAO425
+++ b/sys/arch/evbarm/conf/ZAO425
@@ -1,4 +1,4 @@
-# $NetBSD: ZAO425,v 1.39 2011/03/06 05:08:03 jakllsch Exp $
+# $NetBSD: ZAO425,v 1.40 2011/03/06 17:08:23 bouyer Exp $
#
# ZAO425 -- Intel IXP425
#
@@ -49,7 +49,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/evbmips/conf/ADM5120 b/sys/arch/evbmips/conf/ADM5120
index f9fbcfa1514..9aa624fb147 100644
--- a/sys/arch/evbmips/conf/ADM5120
+++ b/sys/arch/evbmips/conf/ADM5120
@@ -1,11 +1,11 @@
-# $NetBSD: ADM5120,v 1.6 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: ADM5120,v 1.7 2011/03/06 17:08:23 bouyer Exp $
#
# Kernel config for the Alchemy Semiconductor (AMD) PB1000, PB1500,
# DBAu1000 and DBAu1500 evaluation boards.
include "arch/evbmips/conf/std.adm5120"
-#ident "GENERIC-$Revision: 1.6 $"
+#ident "GENERIC-$Revision: 1.7 $"
maxusers 32
@@ -74,7 +74,8 @@ file-system NFS # Sun NFS-compatible filesystem client
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
# immutable) behave as system flags.
diff --git a/sys/arch/evbmips/conf/ADM5120-NB b/sys/arch/evbmips/conf/ADM5120-NB
index f7cf1883c42..3ad65e89111 100644
--- a/sys/arch/evbmips/conf/ADM5120-NB
+++ b/sys/arch/evbmips/conf/ADM5120-NB
@@ -1,11 +1,11 @@
-# $NetBSD: ADM5120-NB,v 1.6 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: ADM5120-NB,v 1.7 2011/03/06 17:08:23 bouyer Exp $
#
# Kernel config for the Alchemy Semiconductor (AMD) PB1000, PB1500,
# DBAu1000 and DBAu1500 evaluation boards.
include "arch/evbmips/conf/std.adm5120"
-#ident "GENERIC-$Revision: 1.6 $"
+#ident "GENERIC-$Revision: 1.7 $"
maxusers 32
@@ -74,7 +74,8 @@ file-system NFS # Sun NFS-compatible filesystem client
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
# immutable) behave as system flags.
diff --git a/sys/arch/evbmips/conf/ADM5120-USB b/sys/arch/evbmips/conf/ADM5120-USB
index 47e4f1dac6e..5d6851e5ef0 100644
--- a/sys/arch/evbmips/conf/ADM5120-USB
+++ b/sys/arch/evbmips/conf/ADM5120-USB
@@ -1,11 +1,11 @@
-# $NetBSD: ADM5120-USB,v 1.6 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: ADM5120-USB,v 1.7 2011/03/06 17:08:23 bouyer Exp $
#
# Kernel config for the Alchemy Semiconductor (AMD) PB1000, PB1500,
# DBAu1000 and DBAu1500 evaluation boards.
include "arch/evbmips/conf/std.adm5120"
-#ident "GENERIC-$Revision: 1.6 $"
+#ident "GENERIC-$Revision: 1.7 $"
maxusers 32
@@ -70,7 +70,8 @@ file-system NFS # Sun NFS-compatible filesystem client
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
# immutable) behave as system flags.
diff --git a/sys/arch/evbmips/conf/ALCHEMY b/sys/arch/evbmips/conf/ALCHEMY
index 8513de09d30..0305a287ae2 100644
--- a/sys/arch/evbmips/conf/ALCHEMY
+++ b/sys/arch/evbmips/conf/ALCHEMY
@@ -1,11 +1,11 @@
-# $NetBSD: ALCHEMY,v 1.31 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: ALCHEMY,v 1.32 2011/03/06 17:08:23 bouyer Exp $
#
# Kernel config for the Alchemy Semiconductor (AMD) PB1000, PB1500,
# DBAu1000 and DBAu1500 evaluation boards.
include "arch/evbmips/conf/std.alchemy"
-#ident "ALCHEMY-$Revision: 1.31 $"
+#ident "ALCHEMY-$Revision: 1.32 $"
maxusers 32
@@ -86,7 +86,8 @@ file-system FDESC # user file descriptor filesystem
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/evbmips/conf/AP30 b/sys/arch/evbmips/conf/AP30
index e7a217d76be..29485c070bd 100644
--- a/sys/arch/evbmips/conf/AP30
+++ b/sys/arch/evbmips/conf/AP30
@@ -1,10 +1,10 @@
-# $NetBSD: AP30,v 1.17 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: AP30,v 1.18 2011/03/06 17:08:23 bouyer Exp $
include "arch/evbmips/conf/std.atheros"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "AP30-$Revision: 1.17 $"
+#ident "AP30-$Revision: 1.18 $"
maxusers 32
@@ -84,7 +84,8 @@ file-system NFS # Sun NFS-compatible filesystem client
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/evbmips/conf/GDIUM b/sys/arch/evbmips/conf/GDIUM
index 907f93661ae..01b97462974 100644
--- a/sys/arch/evbmips/conf/GDIUM
+++ b/sys/arch/evbmips/conf/GDIUM
@@ -1,4 +1,4 @@
-# $NetBSD: GDIUM,v 1.11 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: GDIUM,v 1.12 2011/03/06 17:08:23 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/evbmips/conf/std.gdium"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GDIUM-$Revision: 1.11 $"
+#ident "GDIUM-$Revision: 1.12 $"
maxusers 16
@@ -85,7 +85,8 @@ file-system PTYFS # /dev/pts/N support
options NFSSERVER # Sun NFS-compatible filesystem (server)
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_NO_SNAPSHOT # No FFS snapshot support
# Networking options
diff --git a/sys/arch/evbmips/conf/MALTA b/sys/arch/evbmips/conf/MALTA
index ead1b863586..101990c384c 100644
--- a/sys/arch/evbmips/conf/MALTA
+++ b/sys/arch/evbmips/conf/MALTA
@@ -1,10 +1,10 @@
-# $NetBSD: MALTA,v 1.58 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: MALTA,v 1.59 2011/03/06 17:08:23 bouyer Exp $
include "arch/evbmips/conf/std.malta"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "MALTA-$Revision: 1.58 $"
+#ident "MALTA-$Revision: 1.59 $"
maxusers 32
@@ -78,7 +78,8 @@ file-system TMPFS # Efficient memory file system
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/evbmips/conf/MERAKI b/sys/arch/evbmips/conf/MERAKI
index 07a746cb41a..e3843095755 100644
--- a/sys/arch/evbmips/conf/MERAKI
+++ b/sys/arch/evbmips/conf/MERAKI
@@ -1,10 +1,10 @@
-# $NetBSD: MERAKI,v 1.13 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: MERAKI,v 1.14 2011/03/06 17:08:23 bouyer Exp $
include "arch/evbmips/conf/std.meraki"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "MERAKI-$Revision: 1.13 $"
+#ident "MERAKI-$Revision: 1.14 $"
maxusers 32
@@ -83,7 +83,8 @@ file-system NFS # Sun NFS-compatible filesystem client
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/evbmips/conf/RB153 b/sys/arch/evbmips/conf/RB153
index fb5a13b86c5..d365f9eabde 100644
--- a/sys/arch/evbmips/conf/RB153
+++ b/sys/arch/evbmips/conf/RB153
@@ -1,10 +1,10 @@
-# $NetBSD: RB153,v 1.5 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: RB153,v 1.6 2011/03/06 17:08:23 bouyer Exp $
#
# Example kernel config for the RouterBOARD 153.
include "arch/evbmips/conf/std.adm5120"
-#ident "RB153-$Revision: 1.5 $"
+#ident "RB153-$Revision: 1.6 $"
maxusers 32
@@ -59,7 +59,8 @@ file-system NULLFS # NULL layered filesystem
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
# immutable) behave as system flags.
diff --git a/sys/arch/evbmips/conf/WGT624V3 b/sys/arch/evbmips/conf/WGT624V3
index ffa2c30edb3..1c9d9a3f6e0 100644
--- a/sys/arch/evbmips/conf/WGT624V3
+++ b/sys/arch/evbmips/conf/WGT624V3
@@ -1,10 +1,10 @@
-# $NetBSD: WGT624V3,v 1.10 2011/02/20 07:48:33 matt Exp $
+# $NetBSD: WGT624V3,v 1.11 2011/03/06 17:08:23 bouyer Exp $
include "arch/evbmips/conf/std.atheros"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "WGT624V3-$Revision: 1.10 $"
+#ident "WGT624V3-$Revision: 1.11 $"
maxusers 32
@@ -85,7 +85,8 @@ file-system NFS # Sun NFS-compatible filesystem client
# File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/evbppc/conf/EV64260 b/sys/arch/evbppc/conf/EV64260
index 5c0c1e75fd1..c1e6ecd4900 100644
--- a/sys/arch/evbppc/conf/EV64260
+++ b/sys/arch/evbppc/conf/EV64260
@@ -1,4 +1,4 @@
-# $NetBSD: EV64260,v 1.45 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: EV64260,v 1.46 2011/03/06 17:08:23 bouyer Exp $
#
# MVP -- Motorola's Multiprocessing Verification Platform
#
@@ -98,7 +98,8 @@ file-system MSDOSFS # MS-DOS file system
#file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/EXPLORA451 b/sys/arch/evbppc/conf/EXPLORA451
index d5182481a77..ae4119e22cb 100644
--- a/sys/arch/evbppc/conf/EXPLORA451
+++ b/sys/arch/evbppc/conf/EXPLORA451
@@ -1,4 +1,4 @@
-# $NetBSD: EXPLORA451,v 1.41 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: EXPLORA451,v 1.42 2011/03/06 17:08:23 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -94,7 +94,8 @@ file-system SMBFS # experimental - CIFS; also needs nsmb (below)
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/MPC8536DS b/sys/arch/evbppc/conf/MPC8536DS
index a6899a14556..4afa7be179d 100644
--- a/sys/arch/evbppc/conf/MPC8536DS
+++ b/sys/arch/evbppc/conf/MPC8536DS
@@ -1,4 +1,4 @@
-# $NetBSD: MPC8536DS,v 1.2 2011/01/18 01:10:24 matt Exp $
+# $NetBSD: MPC8536DS,v 1.3 2011/03/06 17:08:23 bouyer Exp $
#
# MPC8536DS -- everything that's currently supported
#
@@ -7,7 +7,7 @@ include "arch/evbppc/conf/std.mpc85xx"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-ident "MPC8536DS-$Revision: 1.2 $"
+ident "MPC8536DS-$Revision: 1.3 $"
maxusers 32
@@ -89,7 +89,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/MPC8548CDS b/sys/arch/evbppc/conf/MPC8548CDS
index ec1be3ea5d1..3c40bf91b60 100644
--- a/sys/arch/evbppc/conf/MPC8548CDS
+++ b/sys/arch/evbppc/conf/MPC8548CDS
@@ -1,4 +1,4 @@
-# $NetBSD: MPC8548CDS,v 1.2 2011/01/18 01:10:24 matt Exp $
+# $NetBSD: MPC8548CDS,v 1.3 2011/03/06 17:08:23 bouyer Exp $
#
# MPC8548CDS -- everything that's currently supported
#
@@ -7,7 +7,7 @@ include "arch/evbppc/conf/std.mpc85xx"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-ident "MPC8548CDS-$Revision: 1.2 $"
+ident "MPC8548CDS-$Revision: 1.3 $"
maxusers 32
@@ -86,7 +86,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/OPENBLOCKS200 b/sys/arch/evbppc/conf/OPENBLOCKS200
index 8d17e3293a7..2eaa2dccc0c 100644
--- a/sys/arch/evbppc/conf/OPENBLOCKS200
+++ b/sys/arch/evbppc/conf/OPENBLOCKS200
@@ -1,4 +1,4 @@
-# $NetBSD: OPENBLOCKS200,v 1.28 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: OPENBLOCKS200,v 1.29 2011/03/06 17:08:23 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -80,7 +80,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/OPENBLOCKS266 b/sys/arch/evbppc/conf/OPENBLOCKS266
index 1ab656cb908..c0148c407aa 100644
--- a/sys/arch/evbppc/conf/OPENBLOCKS266
+++ b/sys/arch/evbppc/conf/OPENBLOCKS266
@@ -1,4 +1,4 @@
-# $NetBSD: OPENBLOCKS266,v 1.51 2011/01/04 09:13:19 matt Exp $
+# $NetBSD: OPENBLOCKS266,v 1.52 2011/03/06 17:08:23 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -7,7 +7,7 @@ include "arch/evbppc/conf/std.obs266"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "OPENBLOCKS266-$Revision: 1.51 $"
+#ident "OPENBLOCKS266-$Revision: 1.52 $"
maxusers 32
@@ -98,7 +98,8 @@ file-system TMPFS # Efficient memory file-system
# File system options
#
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/OPENBLOCKS600 b/sys/arch/evbppc/conf/OPENBLOCKS600
index 56cf900ddb0..1cd5b861a21 100644
--- a/sys/arch/evbppc/conf/OPENBLOCKS600
+++ b/sys/arch/evbppc/conf/OPENBLOCKS600
@@ -1,4 +1,4 @@
-# $NetBSD: OPENBLOCKS600,v 1.3 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: OPENBLOCKS600,v 1.4 2011/03/06 17:08:23 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -7,7 +7,7 @@ include "arch/evbppc/conf/std.obs600"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "OPENBLOCKS600-$Revision: 1.3 $"
+#ident "OPENBLOCKS600-$Revision: 1.4 $"
maxusers 32
@@ -98,7 +98,8 @@ file-system TMPFS # Efficient memory file-system
# File system options
#
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/PMPPC b/sys/arch/evbppc/conf/PMPPC
index c127913ee76..d4ea77986a3 100644
--- a/sys/arch/evbppc/conf/PMPPC
+++ b/sys/arch/evbppc/conf/PMPPC
@@ -1,4 +1,4 @@
-# $NetBSD: PMPPC,v 1.19 2011/03/02 08:25:08 ahoka Exp $
+# $NetBSD: PMPPC,v 1.20 2011/03/06 17:08:23 bouyer Exp $
#
# PMPPC
#
@@ -77,7 +77,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/RB800 b/sys/arch/evbppc/conf/RB800
index c16f97d0871..a13a2ab7efa 100644
--- a/sys/arch/evbppc/conf/RB800
+++ b/sys/arch/evbppc/conf/RB800
@@ -1,4 +1,4 @@
-# $NetBSD: RB800,v 1.2 2011/01/18 01:10:25 matt Exp $
+# $NetBSD: RB800,v 1.3 2011/03/06 17:08:23 bouyer Exp $
#
# RB800 -- everything that's currently supported
#
@@ -7,7 +7,7 @@ include "arch/evbppc/conf/std.mpc85xx"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-ident "RB800-$Revision: 1.2 $"
+ident "RB800-$Revision: 1.3 $"
maxusers 32
@@ -88,7 +88,8 @@ file-system PROCFS # /proc
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/VIRTEX_DFC b/sys/arch/evbppc/conf/VIRTEX_DFC
index d6d4405e973..bf8e2aa8d3d 100644
--- a/sys/arch/evbppc/conf/VIRTEX_DFC
+++ b/sys/arch/evbppc/conf/VIRTEX_DFC
@@ -1,4 +1,4 @@
-# $NetBSD: VIRTEX_DFC,v 1.12 2011/02/06 23:25:17 jmcneill Exp $
+# $NetBSD: VIRTEX_DFC,v 1.13 2011/03/06 17:08:23 bouyer Exp $
#
# VIRTEX_DFC
#
@@ -93,7 +93,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # virtual memory file system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/VIRTEX_GSRD1 b/sys/arch/evbppc/conf/VIRTEX_GSRD1
index feabb4c4a9a..6092a912b52 100644
--- a/sys/arch/evbppc/conf/VIRTEX_GSRD1
+++ b/sys/arch/evbppc/conf/VIRTEX_GSRD1
@@ -1,4 +1,4 @@
-# $NetBSD: VIRTEX_GSRD1,v 1.10 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: VIRTEX_GSRD1,v 1.11 2011/03/06 17:08:23 bouyer Exp $
#
# VIRTEX_GSRD1
#
@@ -87,7 +87,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # virtual memory file system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/VIRTEX_GSRD2 b/sys/arch/evbppc/conf/VIRTEX_GSRD2
index dfa5ae6716d..e191f559a76 100644
--- a/sys/arch/evbppc/conf/VIRTEX_GSRD2
+++ b/sys/arch/evbppc/conf/VIRTEX_GSRD2
@@ -1,4 +1,4 @@
-# $NetBSD: VIRTEX_GSRD2,v 1.11 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: VIRTEX_GSRD2,v 1.12 2011/03/06 17:08:23 bouyer Exp $
#
# VIRTEX_GSRD2
#
@@ -95,7 +95,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # virtual memory file system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options NFSSERVER # Network File System server
diff --git a/sys/arch/evbppc/conf/WALNUT b/sys/arch/evbppc/conf/WALNUT
index 8abf7289225..80f66157753 100644
--- a/sys/arch/evbppc/conf/WALNUT
+++ b/sys/arch/evbppc/conf/WALNUT
@@ -1,4 +1,4 @@
-# $NetBSD: WALNUT,v 1.49 2010/11/23 11:13:57 hannken Exp $
+# $NetBSD: WALNUT,v 1.50 2011/03/06 17:08:23 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -80,7 +80,8 @@ file-system UNION # union file system
file-system PTYFS # /dev/pts/N support
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/ews4800mips/conf/GENERIC b/sys/arch/ews4800mips/conf/GENERIC
index 8868d0a4fc7..ff43c3c67f5 100644
--- a/sys/arch/ews4800mips/conf/GENERIC
+++ b/sys/arch/ews4800mips/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.33 2010/11/23 11:13:58 hannken Exp $
+# $NetBSD: GENERIC,v 1.34 2011/03/06 17:08:24 bouyer Exp $
#
# GENERIC machine description file
# This machine description file is used to generate the default NetBSD
@@ -25,7 +25,7 @@ include "arch/ews4800mips/conf/std.ews4800mips"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.33 $"
+#ident "GENERIC-$Revision: 1.34 $"
maxusers 16
@@ -115,7 +115,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Indpendent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/ews4800mips/conf/RAMDISK b/sys/arch/ews4800mips/conf/RAMDISK
index 4d7154e7c0d..eca8dafdd1b 100644
--- a/sys/arch/ews4800mips/conf/RAMDISK
+++ b/sys/arch/ews4800mips/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.13 2011/02/08 11:09:14 tsutsui Exp $
+# $NetBSD: RAMDISK,v 1.14 2011/03/06 17:08:24 bouyer Exp $
#
# kernel config file with memory disk for installation
#
@@ -46,6 +46,7 @@ no file-system UNION
no file-system PTYFS
no options QUOTA
+no options QUOTA2
no options NFSSERVER
no options NETATALK
no options PPP_FILTER
diff --git a/sys/arch/hp300/conf/GENERIC b/sys/arch/hp300/conf/GENERIC
index 8a8bca7eda1..c747eab3068 100644
--- a/sys/arch/hp300/conf/GENERIC
+++ b/sys/arch/hp300/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.164 2011/02/12 15:49:01 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.165 2011/03/06 17:08:24 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/hp300/conf/std.hp300"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.164 $"
+#ident "GENERIC-$Revision: 1.165 $"
maxusers 32 # estimated number of users
@@ -119,7 +119,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# Filesystem options
-options QUOTA # User and group quotas in FFS
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/hp300/conf/INSTALL b/sys/arch/hp300/conf/INSTALL
index 94e47ef89c8..6d11e53908b 100644
--- a/sys/arch/hp300/conf/INSTALL
+++ b/sys/arch/hp300/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.44 2011/02/12 05:15:39 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.45 2011/03/06 17:08:24 bouyer Exp $
#
# INSTALL machine description file
#
@@ -80,7 +80,8 @@ file-system MFS # Memory-based filesystem
#file-system PTYFS # /dev/pts/N support
# Filesystem options
-#options QUOTA # User and group quotas in FFS
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options NFSSERVER # Network filesystem server
diff --git a/sys/arch/hp300/dev/hyperreg.h b/sys/arch/hp300/dev/hyperreg.h
index 21b8c0f588a..e5327555d77 100644
--- a/sys/arch/hp300/dev/hyperreg.h
+++ b/sys/arch/hp300/dev/hyperreg.h
@@ -1,5 +1,4 @@
-/* $OpenBSD: hyperreg.h,v 1.3 2005/01/24 21:36:39 miod Exp $ */
-/* $NetBSD: hyperreg.h,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */
+/* $NetBSD: hyperreg.h,v 1.3 2011/03/06 17:08:24 bouyer Exp $ */
/*
* Copyright (c) 1991 University of Utah.
diff --git a/sys/arch/hp700/conf/GENERIC b/sys/arch/hp700/conf/GENERIC
index 10101b4eb39..1554d741ef4 100644
--- a/sys/arch/hp700/conf/GENERIC
+++ b/sys/arch/hp700/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.106 2011/02/15 10:32:56 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.107 2011/03/06 17:08:24 bouyer Exp $
#
# GENERIC machine description file
#
@@ -23,7 +23,7 @@ include "arch/hp700/conf/std.hp700"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel
-#ident "GENERIC-$Revision: 1.106 $"
+#ident "GENERIC-$Revision: 1.107 $"
maxusers 32 # estimated number of users
@@ -110,7 +110,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/hpcarm/conf/IPAQ b/sys/arch/hpcarm/conf/IPAQ
index 2f498f55d4f..33cd970e47d 100644
--- a/sys/arch/hpcarm/conf/IPAQ
+++ b/sys/arch/hpcarm/conf/IPAQ
@@ -1,4 +1,4 @@
-# $NetBSD: IPAQ,v 1.63 2011/01/04 02:19:32 tsutsui Exp $
+# $NetBSD: IPAQ,v 1.64 2011/03/06 17:08:25 bouyer Exp $
#
# iPAQ H3600 -- Windows-CE based PDA
#
@@ -47,7 +47,8 @@ file-system NULLFS # loopback file system
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/hpcarm/conf/JORNADA720 b/sys/arch/hpcarm/conf/JORNADA720
index 625075f2cce..f3e2298ccd8 100644
--- a/sys/arch/hpcarm/conf/JORNADA720
+++ b/sys/arch/hpcarm/conf/JORNADA720
@@ -1,4 +1,4 @@
-# $NetBSD: JORNADA720,v 1.81 2011/01/04 02:19:32 tsutsui Exp $
+# $NetBSD: JORNADA720,v 1.82 2011/03/06 17:08:25 bouyer Exp $
#
# JORNADA -- Windows-CE based jornada 720
#
@@ -7,7 +7,7 @@ include "arch/hpcarm/conf/std.sa11x0"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.81 $"
+#ident "GENERIC-$Revision: 1.82 $"
# estimated number of users
maxusers 32
@@ -51,7 +51,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/hpcarm/conf/JORNADA820 b/sys/arch/hpcarm/conf/JORNADA820
index 4f16a758354..f327265c6d8 100644
--- a/sys/arch/hpcarm/conf/JORNADA820
+++ b/sys/arch/hpcarm/conf/JORNADA820
@@ -1,4 +1,4 @@
-# $NetBSD: JORNADA820,v 1.21 2011/01/04 02:19:32 tsutsui Exp $
+# $NetBSD: JORNADA820,v 1.22 2011/03/06 17:08:25 bouyer Exp $
#
# JORNADA -- Windows-CE based jornada 820
#
@@ -7,7 +7,7 @@ include "arch/hpcarm/conf/std.sa11x0"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.21 $"
+#ident "GENERIC-$Revision: 1.22 $"
# estimated number of users
maxusers 32
@@ -49,7 +49,8 @@ file-system KERNFS # /kern
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/hpcarm/conf/WZERO3 b/sys/arch/hpcarm/conf/WZERO3
index fe6c3eb96a8..ee5c7d5d9d9 100644
--- a/sys/arch/hpcarm/conf/WZERO3
+++ b/sys/arch/hpcarm/conf/WZERO3
@@ -1,4 +1,4 @@
-# $NetBSD: WZERO3,v 1.18 2011/01/04 02:19:32 tsutsui Exp $
+# $NetBSD: WZERO3,v 1.19 2011/03/06 17:08:25 bouyer Exp $
#
# WZERO3 -- Sharp Windows Mobile 5 based PDA
#
@@ -7,7 +7,7 @@ include "arch/hpcarm/conf/std.pxa2x0"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.18 $"
+#ident "GENERIC-$Revision: 1.19 $"
# estimated number of users
maxusers 32
@@ -50,7 +50,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/hpcmips/conf/GENERIC b/sys/arch/hpcmips/conf/GENERIC
index fea001e8042..0c7009a0e24 100644
--- a/sys/arch/hpcmips/conf/GENERIC
+++ b/sys/arch/hpcmips/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.212 2010/11/23 11:13:59 hannken Exp $
+# $NetBSD: GENERIC,v 1.213 2011/03/06 17:08:25 bouyer Exp $
#
# GENERIC machine description file
#
@@ -24,7 +24,7 @@ include "arch/hpcmips/conf/std.hpcmips.tx39"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.212 $"
+#ident "GENERIC-$Revision: 1.213 $"
maxusers 16
@@ -93,7 +93,8 @@ file-system TMPFS # Efficient memory file-system
options NFSSERVER # Sun NFS-compatible filesystem (server)
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_NO_SNAPSHOT # No FFS snapshot support
# Networking options
diff --git a/sys/arch/hpcmips/conf/LROUTER b/sys/arch/hpcmips/conf/LROUTER
index a3d21bf4c38..86a2162ea4d 100644
--- a/sys/arch/hpcmips/conf/LROUTER
+++ b/sys/arch/hpcmips/conf/LROUTER
@@ -1,5 +1,5 @@
#
-# $NetBSD: LROUTER,v 1.43 2010/11/23 11:13:59 hannken Exp $
+# $NetBSD: LROUTER,v 1.44 2011/03/06 17:08:25 bouyer Exp $
# From: NetBSD: MPC303,v 1.4 2001/11/21 11:28:09 uch Exp
#
# Kernel configuration file for LASER5 L-Router
@@ -75,7 +75,8 @@ file-system PTYFS # /dev/pts/N support
options NFSSERVER # Sun NFS-compatible filesystem (server)
options WAPBL # File system journaling support - Experimental
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_NO_SNAPSHOT # No FFS snapshot support
# Networking options
diff --git a/sys/arch/hpcmips/conf/MPC303 b/sys/arch/hpcmips/conf/MPC303
index f45f9787078..d90d266e510 100644
--- a/sys/arch/hpcmips/conf/MPC303
+++ b/sys/arch/hpcmips/conf/MPC303
@@ -1,5 +1,5 @@
#
-# $NetBSD: MPC303,v 1.56 2010/11/23 11:13:59 hannken Exp $
+# $NetBSD: MPC303,v 1.57 2011/03/06 17:08:25 bouyer Exp $
# From: NetBSD: GENERIC,v 1.91 2001/05/06 14:25:16 takemura Exp
#
# Kernel configuration file for Victor MP-C303; enami's test machine.
@@ -9,7 +9,7 @@ include "arch/hpcmips/conf/std.hpcmips"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.56 $"
+#ident "GENERIC-$Revision: 1.57 $"
maxusers 16
@@ -73,7 +73,8 @@ file-system PTYFS # /dev/pts/N support
#options NFSSERVER # Sun NFS-compatible filesystem (server)
options WAPBL # File system journaling support - Experimental
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options FFS_NO_SNAPSHOT # No FFS snapshot support
# Networking options
diff --git a/sys/arch/hpcmips/conf/TX3912 b/sys/arch/hpcmips/conf/TX3912
index 3361ad461df..3c48e4683ce 100644
--- a/sys/arch/hpcmips/conf/TX3912
+++ b/sys/arch/hpcmips/conf/TX3912
@@ -2,7 +2,7 @@
# Distribution kernel (TOSHIBA TX3912 based model) kernel config file
#
-# $NetBSD: TX3912,v 1.75 2010/11/23 11:13:59 hannken Exp $
+# $NetBSD: TX3912,v 1.76 2011/03/06 17:08:25 bouyer Exp $
#
include "arch/hpcmips/conf/std.hpcmips"
@@ -96,7 +96,8 @@ options INET6 # IPV6
options NFSSERVER # Sun NFS-compatible filesystem (server)
options WAPBL # File system journaling support - Experimental
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options FFS_NO_SNAPSHOT # No FFS snapshot support
options NFS_BOOT_DHCP
diff --git a/sys/arch/hpcmips/conf/TX3922 b/sys/arch/hpcmips/conf/TX3922
index cd63276780e..3aa53505b45 100644
--- a/sys/arch/hpcmips/conf/TX3922
+++ b/sys/arch/hpcmips/conf/TX3922
@@ -1,7 +1,7 @@
#
# Distribution kernel (TOSHIBA TX3922 based model) kernel config file
#
-# $NetBSD: TX3922,v 1.89 2010/11/23 11:13:59 hannken Exp $
+# $NetBSD: TX3922,v 1.90 2011/03/06 17:08:25 bouyer Exp $
#
include "arch/hpcmips/conf/std.hpcmips"
@@ -85,7 +85,8 @@ options INET6 # IPV6
options NFSSERVER # Sun NFS-compatible filesystem (server)
options WAPBL # File system journaling support - Experimental
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options FFS_NO_SNAPSHOT # No FFS snapshot support
options NFS_BOOT_DHCP
diff --git a/sys/arch/hpcmips/conf/VR41XX b/sys/arch/hpcmips/conf/VR41XX
index 3fc9b6a3a3d..cae009de6bc 100644
--- a/sys/arch/hpcmips/conf/VR41XX
+++ b/sys/arch/hpcmips/conf/VR41XX
@@ -1,4 +1,4 @@
-# $NetBSD: VR41XX,v 1.51 2010/11/23 11:13:59 hannken Exp $
+# $NetBSD: VR41XX,v 1.52 2011/03/06 17:08:25 bouyer Exp $
#
# GENERIC machine description file
#
@@ -20,7 +20,7 @@
include "arch/hpcmips/conf/std.hpcmips"
include "arch/hpcmips/conf/std.hpcmips.vr41"
-#ident "GENERIC-$Revision: 1.51 $"
+#ident "GENERIC-$Revision: 1.52 $"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
@@ -86,7 +86,8 @@ file-system PTYFS # /dev/pts/N support
#options NFSSERVER # Sun NFS-compatible filesystem (server)
options WAPBL # File system journaling support - Experimental
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options FFS_NO_SNAPSHOT # No FFS snapshot support
# Networking options
diff --git a/sys/arch/i386/conf/ALL b/sys/arch/i386/conf/ALL
index b51ab813fb1..6aad52c829e 100644
--- a/sys/arch/i386/conf/ALL
+++ b/sys/arch/i386/conf/ALL
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.300 2011/03/04 04:48:40 jruoho Exp $
+# $NetBSD: ALL,v 1.301 2011/03/06 17:08:25 bouyer Exp $
# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
#
# ALL machine description file
@@ -17,7 +17,7 @@ include "arch/i386/conf/std.i386"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "ALL-$Revision: 1.300 $"
+#ident "ALL-$Revision: 1.301 $"
maxusers 64 # estimated number of users
@@ -194,7 +194,8 @@ file-system ADOSFS # AmigaDOS file system
file-system NILFS # experimental - NTT's NiLFS(2)
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC
index 47857475716..acf9d332b55 100644
--- a/sys/arch/i386/conf/GENERIC
+++ b/sys/arch/i386/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1025 2011/03/04 04:48:40 jruoho Exp $
+# $NetBSD: GENERIC,v 1.1026 2011/03/06 17:08:25 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/i386/conf/std.i386"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.1025 $"
+#ident "GENERIC-$Revision: 1.1026 $"
maxusers 64 # estimated number of users
@@ -191,7 +191,8 @@ file-system NFS # Network File System client
#file-system NILFS # experimental - NTT's NiLFS(2)
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/i386/conf/GENERIC_TINY b/sys/arch/i386/conf/GENERIC_TINY
index 176d309d285..f0b4508ed55 100644
--- a/sys/arch/i386/conf/GENERIC_TINY
+++ b/sys/arch/i386/conf/GENERIC_TINY
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC_TINY,v 1.126 2010/11/23 11:14:00 hannken Exp $
+# $NetBSD: GENERIC_TINY,v 1.127 2011/03/06 17:08:25 bouyer Exp $
#
# GENERIC_TINY -- suitable default for 4M machines
# No EISA, PCI, or SCSI.
@@ -100,7 +100,8 @@ file-system KERNFS # /kern
#file-system TMPFS # Efficient memory file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER # Network File System server
options FFS_NO_SNAPSHOT # No FF snapshot support
diff --git a/sys/arch/i386/conf/INSTALL_FLOPPY b/sys/arch/i386/conf/INSTALL_FLOPPY
index 487b8935251..ac54876a407 100644
--- a/sys/arch/i386/conf/INSTALL_FLOPPY
+++ b/sys/arch/i386/conf/INSTALL_FLOPPY
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL_FLOPPY,v 1.11 2010/11/27 20:18:46 christos Exp $
+# $NetBSD: INSTALL_FLOPPY,v 1.12 2011/03/06 17:08:26 bouyer Exp $
#
# INSTALL - Installation kernel.
#
@@ -119,7 +119,8 @@ file-system MSDOSFS # MS-DOS file system
file-system TMPFS # Efficient memory file-system
# Filesystem options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER # Network File System server
options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/i386/conf/INSTALL_TINY b/sys/arch/i386/conf/INSTALL_TINY
index 656a932ecea..6420c5b78e2 100644
--- a/sys/arch/i386/conf/INSTALL_TINY
+++ b/sys/arch/i386/conf/INSTALL_TINY
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL_TINY,v 1.131 2010/11/23 11:14:00 hannken Exp $
+# $NetBSD: INSTALL_TINY,v 1.132 2011/03/06 17:08:26 bouyer Exp $
#
# This kernel should be derived from INSTALL (which is derived
# from GENERIC) with some features commented out.
@@ -107,7 +107,8 @@ file-system MSDOSFS # MS-DOS file system
#file-system TMPFS # Efficient memory file-system
# Filesystem options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER # Network File System server
options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/i386/conf/MONOLITHIC b/sys/arch/i386/conf/MONOLITHIC
index 8595f8de98f..31f83e92067 100644
--- a/sys/arch/i386/conf/MONOLITHIC
+++ b/sys/arch/i386/conf/MONOLITHIC
@@ -1,4 +1,4 @@
-# $NetBSD: MONOLITHIC,v 1.14 2011/02/13 04:42:54 jym Exp $
+# $NetBSD: MONOLITHIC,v 1.15 2011/03/06 17:08:26 bouyer Exp $
#
# Non MODULAR, used mostly as a reference as to what we modularized.
#
@@ -43,7 +43,8 @@ file-system PTYFS # /dev/ptm support
file-system TMPFS # Efficient memory file-system
file-system PUFFS # Userspace file systems (e.g. ntfs-3g & sshfs)
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options NFSSERVER
diff --git a/sys/arch/i386/conf/NET4501 b/sys/arch/i386/conf/NET4501
index f36b8b9607c..28be2c58546 100644
--- a/sys/arch/i386/conf/NET4501
+++ b/sys/arch/i386/conf/NET4501
@@ -1,4 +1,4 @@
-# $NetBSD: NET4501,v 1.72 2010/04/16 13:48:32 pooka Exp $
+# $NetBSD: NET4501,v 1.73 2011/03/06 17:08:26 bouyer Exp $
#
# NET4501 -- kernel configuration for a Soekris Engineering net4501
# single-board computer.
@@ -10,7 +10,7 @@ include "arch/i386/conf/std.i386"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "NET4501-$Revision: 1.72 $"
+#ident "NET4501-$Revision: 1.73 $"
maxusers 32 # estimated number of users
@@ -123,7 +123,8 @@ file-system PTYFS # /dev/pts/N support
#file-system TMPFS # Efficient memory file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
#options FFS_NO_SNAPSHOT # No FFS snapshot support
#options NFSSERVER # Network File System server
diff --git a/sys/arch/i386/conf/XEN3_DOM0 b/sys/arch/i386/conf/XEN3_DOM0
index 31a63c288fa..f4e4bc22787 100644
--- a/sys/arch/i386/conf/XEN3_DOM0
+++ b/sys/arch/i386/conf/XEN3_DOM0
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.46 2011/02/24 10:56:01 jruoho Exp $
+# $NetBSD: XEN3_DOM0,v 1.47 2011/03/06 17:08:26 bouyer Exp $
#
# XEN3_0: Xen 3.0 domain0 kernel
@@ -131,7 +131,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # Efficient memory file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/i386/conf/XEN3_DOMU b/sys/arch/i386/conf/XEN3_DOMU
index 0eb96e48451..3b9c10280a5 100644
--- a/sys/arch/i386/conf/XEN3_DOMU
+++ b/sys/arch/i386/conf/XEN3_DOMU
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.28 2011/02/17 22:00:36 jym Exp $
+# $NetBSD: XEN3_DOMU,v 1.29 2011/03/06 17:08:26 bouyer Exp $
include "arch/xen/conf/std.xen"
@@ -111,7 +111,8 @@ file-system TMPFS # Efficient memory file-system
file-system NILFS # experimental - NTT's NiLFS(2)
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/iyonix/conf/GENERIC b/sys/arch/iyonix/conf/GENERIC
index a0b76e33b49..2743cbb815f 100644
--- a/sys/arch/iyonix/conf/GENERIC
+++ b/sys/arch/iyonix/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.61 2010/11/23 11:14:01 hannken Exp $
+# $NetBSD: GENERIC,v 1.62 2011/03/06 17:08:26 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/iyonix/conf/std.iyonix"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.61 $"
+#ident "GENERIC-$Revision: 1.62 $"
maxusers 32 # estimated number of users
@@ -138,7 +138,8 @@ file-system MSDOSFS # MS-DOS file system
file-system FILECORE # Acorn filecore file system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
diff --git a/sys/arch/landisk/conf/GENERIC b/sys/arch/landisk/conf/GENERIC
index 1ccd3926781..e84f29c1727 100644
--- a/sys/arch/landisk/conf/GENERIC
+++ b/sys/arch/landisk/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.27 2011/01/03 06:07:43 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.28 2011/03/06 17:08:26 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/landisk/conf/std.landisk"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.27 $"
+#ident "GENERIC-$Revision: 1.28 $"
maxusers 16 # estimated number of users
@@ -118,7 +118,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/luna68k/conf/GENERIC b/sys/arch/luna68k/conf/GENERIC
index 6776a146604..0ad295489fc 100644
--- a/sys/arch/luna68k/conf/GENERIC
+++ b/sys/arch/luna68k/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.91 2010/11/23 11:14:01 hannken Exp $
+# $NetBSD: GENERIC,v 1.92 2011/03/06 17:08:26 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/luna68k/conf/std.luna68k"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.91 $"
+#ident "GENERIC-$Revision: 1.92 $"
maxusers 8
@@ -93,7 +93,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
#options NFSSERVER # nfs server support
-#options QUOTA # ffs quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # ffs endian independent support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/mac68k/conf/GENERIC b/sys/arch/mac68k/conf/GENERIC
index 61b0d7602d2..e08eb5fc0ab 100644
--- a/sys/arch/mac68k/conf/GENERIC
+++ b/sys/arch/mac68k/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.199 2010/11/24 13:54:49 hauke Exp $
+# $NetBSD: GENERIC,v 1.200 2011/03/06 17:08:27 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/mac68k/conf/std.mac68k"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.199 $"
+#ident "GENERIC-$Revision: 1.200 $"
maxusers 16 # estimated number of users
@@ -121,7 +121,8 @@ file-system TMPFS # Efficient memory file-system
#file-system HFS # experimental - Apple HFS+ (read-only)
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/mac68k/conf/SMALLRAM b/sys/arch/mac68k/conf/SMALLRAM
index 7ce9a8269b7..63d3b5bde03 100644
--- a/sys/arch/mac68k/conf/SMALLRAM
+++ b/sys/arch/mac68k/conf/SMALLRAM
@@ -1,4 +1,4 @@
-# $NetBSD: SMALLRAM,v 1.37 2010/11/24 13:48:20 hauke Exp $
+# $NetBSD: SMALLRAM,v 1.38 2011/03/06 17:08:27 bouyer Exp $
#
# This is an example of how to configure a small, efficient kernel for
# a system with limited RAM. Even so it's capable of doing quite a
@@ -65,6 +65,7 @@ no file-system PTYFS
no file-system TMPFS
no options QUOTA
+no options QUOTA2
no options WAPBL
no options NFSSERVER
diff --git a/sys/arch/macppc/conf/GENERIC b/sys/arch/macppc/conf/GENERIC
index c08b43c8909..11b2aecb2e3 100644
--- a/sys/arch/macppc/conf/GENERIC
+++ b/sys/arch/macppc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.288 2011/01/03 06:07:43 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.289 2011/03/06 17:08:27 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/macppc/conf/std.macppc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.288 $"
+#ident "GENERIC-$Revision: 1.289 $"
maxusers 32
@@ -110,7 +110,8 @@ file-system TMPFS # Efficient memory file-system
#file-system HFS # experimental - Apple HFS+ (read-only)
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/macppc/conf/MAMBO b/sys/arch/macppc/conf/MAMBO
index 27f007be1df..85a1ea98ecf 100644
--- a/sys/arch/macppc/conf/MAMBO
+++ b/sys/arch/macppc/conf/MAMBO
@@ -6,7 +6,7 @@ include "arch/macppc/conf/std.macppc.g5"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.11 $"
+#ident "GENERIC-$Revision: 1.12 $"
maxusers 32
@@ -81,7 +81,8 @@ file-system UNION # union file system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
#options FFS_NO_SNAPSHOT # ffs snapshots
diff --git a/sys/arch/macppc/conf/POWERMAC_G5 b/sys/arch/macppc/conf/POWERMAC_G5
index 3fc5878d4f6..506ba1bc6e1 100644
--- a/sys/arch/macppc/conf/POWERMAC_G5
+++ b/sys/arch/macppc/conf/POWERMAC_G5
@@ -66,7 +66,8 @@ file-system PROCFS # /proc
file-system NFS # Network File System client
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
#options NFSSERVER # Network File System server
diff --git a/sys/arch/mipsco/conf/GENERIC b/sys/arch/mipsco/conf/GENERIC
index 28cb7ae93be..c4b9706be44 100644
--- a/sys/arch/mipsco/conf/GENERIC
+++ b/sys/arch/mipsco/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.75 2010/04/29 22:40:52 chs Exp $
+# $NetBSD: GENERIC,v 1.76 2011/03/06 17:08:27 bouyer Exp $
#
# GENERIC machine description file
#
@@ -91,7 +91,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
#
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/mipsco/conf/RC3230 b/sys/arch/mipsco/conf/RC3230
index 7a2e8a6aef8..6e2831c42e1 100644
--- a/sys/arch/mipsco/conf/RC3230
+++ b/sys/arch/mipsco/conf/RC3230
@@ -1,5 +1,5 @@
#
-# $NetBSD: RC3230,v 1.38 2010/04/16 13:48:33 pooka Exp $
+# $NetBSD: RC3230,v 1.39 2011/03/06 17:08:27 bouyer Exp $
#
include "arch/mipsco/conf/std.mipsco"
@@ -65,7 +65,8 @@ file-system CD9660 # ISO 9660 + Rock Ridge file system
file-system PTYFS # /dev/pts/N support
#
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/mmeye/conf/GENERIC b/sys/arch/mmeye/conf/GENERIC
index 10353993019..9164188ce21 100644
--- a/sys/arch/mmeye/conf/GENERIC
+++ b/sys/arch/mmeye/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.104 2011/02/19 10:46:27 kiyohara Exp $
+# $NetBSD: GENERIC,v 1.105 2011/03/06 17:08:27 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/mmeye/conf/std.mmeye"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.104 $"
+#ident "GENERIC-$Revision: 1.105 $"
maxusers 16 # estimated number of users
@@ -103,7 +103,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/mmeye/conf/MMTA b/sys/arch/mmeye/conf/MMTA
index b09f5b39ce3..64168f3bf39 100644
--- a/sys/arch/mmeye/conf/MMTA
+++ b/sys/arch/mmeye/conf/MMTA
@@ -1,4 +1,4 @@
-# $NetBSD: MMTA,v 1.44 2011/02/19 10:46:27 kiyohara Exp $
+# $NetBSD: MMTA,v 1.45 2011/03/06 17:08:27 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -77,7 +77,8 @@ file-system UMAPFS # NULLFS + uid and gid remapping
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options NFSSERVER # Network File System server
#options FIFO # FIFOs; RECOMMENDED
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/mmeye/conf/MMTAICE b/sys/arch/mmeye/conf/MMTAICE
index b7e70b211cd..58a0cba2732 100644
--- a/sys/arch/mmeye/conf/MMTAICE
+++ b/sys/arch/mmeye/conf/MMTAICE
@@ -1,4 +1,4 @@
-# $NetBSD: MMTAICE,v 1.46 2011/02/19 10:46:27 kiyohara Exp $
+# $NetBSD: MMTAICE,v 1.47 2011/03/06 17:08:28 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -108,7 +108,8 @@ file-system UMAPFS # NULLFS + uid and gid remapping
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options NFSSERVER # Network File System server
#options FIFO # FIFOs; RECOMMENDED
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/mmeye/conf/MMTAROMNEW b/sys/arch/mmeye/conf/MMTAROMNEW
index ce2c90ffe8d..8eeba9c1477 100644
--- a/sys/arch/mmeye/conf/MMTAROMNEW
+++ b/sys/arch/mmeye/conf/MMTAROMNEW
@@ -1,4 +1,4 @@
-# $NetBSD: MMTAROMNEW,v 1.45 2011/02/19 10:46:27 kiyohara Exp $
+# $NetBSD: MMTAROMNEW,v 1.46 2011/03/06 17:08:28 bouyer Exp $
#
# GENERIC -- everything that's currently supported
#
@@ -87,7 +87,8 @@ file-system UMAPFS # NULLFS + uid and gid remapping
file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER # Network File System server
options FFS_NO_SNAPSHOT # No FFS snapshot support
#options FIFO # FIFOs; RECOMMENDED
diff --git a/sys/arch/mvmeppc/conf/GENERIC b/sys/arch/mvmeppc/conf/GENERIC
index 72cf7f5a431..ee4a4549148 100644
--- a/sys/arch/mvmeppc/conf/GENERIC
+++ b/sys/arch/mvmeppc/conf/GENERIC
@@ -1,11 +1,11 @@
-# $NetBSD: GENERIC,v 1.11 2011/01/31 06:33:05 matt Exp $
+# $NetBSD: GENERIC,v 1.12 2011/03/06 17:08:28 bouyer Exp $
#
include "arch/mvmeppc/conf/std.mvmeppc"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-ident "GENERIC-$Revision: 1.11 $"
+ident "GENERIC-$Revision: 1.12 $"
maxusers 8
@@ -57,7 +57,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # Efficient memory file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options FFS_NO_SNAPSHOT # No FFS snapshot support
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/netwinder/conf/GENERIC b/sys/arch/netwinder/conf/GENERIC
index f342b3a5eec..6abe6c94340 100644
--- a/sys/arch/netwinder/conf/GENERIC
+++ b/sys/arch/netwinder/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.102 2010/11/23 11:14:03 hannken Exp $
+# $NetBSD: GENERIC,v 1.103 2011/03/06 17:08:28 bouyer Exp $
#
# GENERIC machine description file
#
@@ -72,7 +72,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options FFS_NO_SNAPSHOT # No FFS snapshot support
options NFSSERVER
diff --git a/sys/arch/news68k/conf/GENERIC b/sys/arch/news68k/conf/GENERIC
index 53ed582a415..4fa6f036e8a 100644
--- a/sys/arch/news68k/conf/GENERIC
+++ b/sys/arch/news68k/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.105 2011/03/06 14:54:46 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.106 2011/03/06 17:08:28 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/news68k/conf/std.news68k"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.105 $"
+#ident "GENERIC-$Revision: 1.106 $"
maxusers 8
@@ -102,7 +102,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # nfs server support
-options QUOTA # ffs quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # ffs endian independent support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/news68k/conf/GENERIC_TINY b/sys/arch/news68k/conf/GENERIC_TINY
index bb6f9c085de..c9d7895031e 100644
--- a/sys/arch/news68k/conf/GENERIC_TINY
+++ b/sys/arch/news68k/conf/GENERIC_TINY
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC_TINY,v 1.67 2010/11/23 11:14:03 hannken Exp $
+# $NetBSD: GENERIC_TINY,v 1.68 2011/03/06 17:08:28 bouyer Exp $
# news68k GENERIC config file for low memory machines;
#
@@ -6,7 +6,7 @@ include "arch/news68k/conf/std.news68k"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC_TINY-$Revision: 1.67 $"
+#ident "GENERIC_TINY-$Revision: 1.68 $"
maxusers 4
@@ -80,7 +80,8 @@ file-system FDESC # /dev/fd/*
file-system PTYFS # /dev/pts/N support
options NFSSERVER # nfs server support
-#options QUOTA # ffs quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # ffs endian independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/news68k/conf/INSTALL b/sys/arch/news68k/conf/INSTALL
index 0f9f94360d6..3ed0b7398db 100644
--- a/sys/arch/news68k/conf/INSTALL
+++ b/sys/arch/news68k/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.51 2010/11/23 11:14:03 hannken Exp $
+# $NetBSD: INSTALL,v 1.52 2011/03/06 17:08:28 bouyer Exp $
# config for bootable floppy kernel
#
@@ -66,7 +66,8 @@ file-system MSDOSFS # MS-DOS FAT file system
# Filesystem options
#options NFSSERVER # nfs server support
-#options QUOTA # ffs quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # ffs endian independent support
options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/news68k/conf/LIBERO b/sys/arch/news68k/conf/LIBERO
index 54b39be3b04..40cc826de64 100644
--- a/sys/arch/news68k/conf/LIBERO
+++ b/sys/arch/news68k/conf/LIBERO
@@ -1,4 +1,4 @@
-# $NetBSD: LIBERO,v 1.53 2010/11/23 11:14:03 hannken Exp $
+# $NetBSD: LIBERO,v 1.54 2011/03/06 17:08:28 bouyer Exp $
# NEWS1750 config file;
#
@@ -70,7 +70,8 @@ file-system NULLFS # loopback file system
file-system PTYFS # /dev/pts/N support
options NFSSERVER # nfs server support
-#options QUOTA # ffs quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # ffs endian independent support
options FFS_NO_SNAPSHOT # FFS snapshot support
diff --git a/sys/arch/news68k/conf/NEWS1200 b/sys/arch/news68k/conf/NEWS1200
index 8602a27ac15..b3d65d73270 100644
--- a/sys/arch/news68k/conf/NEWS1200
+++ b/sys/arch/news68k/conf/NEWS1200
@@ -1,4 +1,4 @@
-# $NetBSD: NEWS1200,v 1.49 2010/11/23 11:14:03 hannken Exp $
+# $NetBSD: NEWS1200,v 1.50 2011/03/06 17:08:28 bouyer Exp $
# news1200 config file
#
@@ -71,7 +71,8 @@ file-system NULLFS # loopback file system
file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # ffs quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # ffs endian independent support
options WAPBL # File system journaling support - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/newsmips/conf/GENERIC b/sys/arch/newsmips/conf/GENERIC
index c9c81513423..90f754fb526 100644
--- a/sys/arch/newsmips/conf/GENERIC
+++ b/sys/arch/newsmips/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.111 2010/04/29 22:40:52 chs Exp $
+# $NetBSD: GENERIC,v 1.112 2011/03/06 17:08:29 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/newsmips/conf/std.newsmips"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.111 $"
+#ident "GENERIC-$Revision: 1.112 $"
maxusers 16
@@ -92,7 +92,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/next68k/conf/GENERIC b/sys/arch/next68k/conf/GENERIC
index 8b7f7903f95..d900e0f0116 100644
--- a/sys/arch/next68k/conf/GENERIC
+++ b/sys/arch/next68k/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.122 2010/11/23 11:14:03 hannken Exp $
+# $NetBSD: GENERIC,v 1.123 2011/03/06 17:08:29 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/next68k/conf/std.next68k"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.122 $"
+#ident "GENERIC-$Revision: 1.123 $"
# Needs to be set per system. i.e change these as you see fit
maxusers 16
@@ -116,7 +116,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/next68k/conf/SLAB b/sys/arch/next68k/conf/SLAB
index 2310b00098e..650a4e3921a 100644
--- a/sys/arch/next68k/conf/SLAB
+++ b/sys/arch/next68k/conf/SLAB
@@ -1,4 +1,4 @@
-# $NetBSD: SLAB,v 1.42 2010/11/23 11:14:03 hannken Exp $
+# $NetBSD: SLAB,v 1.43 2011/03/06 17:08:29 bouyer Exp $
#
# deberg's development machine
#
@@ -86,7 +86,8 @@ file-system NULLFS # loopback file system
file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
# immutable) behave as system flags.
diff --git a/sys/arch/ofppc/conf/GENERIC b/sys/arch/ofppc/conf/GENERIC
index d7d8a3b106b..1ee305e9301 100644
--- a/sys/arch/ofppc/conf/GENERIC
+++ b/sys/arch/ofppc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.135 2011/01/02 11:25:31 mrg Exp $
+# $NetBSD: GENERIC,v 1.136 2011/03/06 17:08:29 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/ofppc/conf/std.ofppc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.135 $"
+#ident "GENERIC-$Revision: 1.136 $"
maxusers 32
@@ -110,7 +110,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/ofppc/conf/GENERIC.MP b/sys/arch/ofppc/conf/GENERIC.MP
index 1871eaf615f..58834e2925b 100644
--- a/sys/arch/ofppc/conf/GENERIC.MP
+++ b/sys/arch/ofppc/conf/GENERIC.MP
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.MP,v 1.14 2010/12/31 21:50:27 phx Exp $
+# $NetBSD: GENERIC.MP,v 1.15 2011/03/06 17:08:29 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/ofppc/conf/std.ofppc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.14 $"
+#ident "GENERIC-$Revision: 1.15 $"
maxusers 32
@@ -108,7 +108,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/pmax/conf/GENERIC b/sys/arch/pmax/conf/GENERIC
index 5e3fc72b206..f7fb07c80d4 100644
--- a/sys/arch/pmax/conf/GENERIC
+++ b/sys/arch/pmax/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.167 2011/02/20 07:50:24 matt Exp $
+# $NetBSD: GENERIC,v 1.168 2011/03/06 17:08:29 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/pmax/conf/std.pmax"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.167 $"
+#ident "GENERIC-$Revision: 1.168 $"
maxusers 64
@@ -97,7 +97,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # Sun NFS-compatible filesystem (server)
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/pmax/conf/GENERIC64 b/sys/arch/pmax/conf/GENERIC64
index a53d50112e9..0c9dd22680b 100644
--- a/sys/arch/pmax/conf/GENERIC64
+++ b/sys/arch/pmax/conf/GENERIC64
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC64,v 1.5 2011/02/20 07:50:24 matt Exp $
+# $NetBSD: GENERIC64,v 1.6 2011/03/06 17:08:29 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/pmax/conf/std.pmax64"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.5 $"
+#ident "GENERIC-$Revision: 1.6 $"
maxusers 64
@@ -88,7 +88,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # Sun NFS-compatible filesystem (server)
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options SOFTDEP # FFS soft updates support.
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/prep/conf/GENERIC b/sys/arch/prep/conf/GENERIC
index f88a8b7ffcf..cf34471f9dd 100644
--- a/sys/arch/prep/conf/GENERIC
+++ b/sys/arch/prep/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.157 2010/11/23 11:14:04 hannken Exp $
+# $NetBSD: GENERIC,v 1.158 2011/03/06 17:08:30 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/prep/conf/std.prep"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.157 $"
+#ident "GENERIC-$Revision: 1.158 $"
maxusers 32
@@ -97,7 +97,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/rs6000/conf/GENERIC b/sys/arch/rs6000/conf/GENERIC
index 7b2fdec6eba..b368a15a0be 100644
--- a/sys/arch/rs6000/conf/GENERIC
+++ b/sys/arch/rs6000/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.15 2010/11/23 11:14:04 hannken Exp $
+# $NetBSD: GENERIC,v 1.16 2011/03/06 17:08:30 bouyer Exp $
#
# GENERIC machine description file
#
@@ -24,7 +24,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#makeoptions COPTS="-O2 -mno-powerpc -mno-power" # wheeee
-#ident "GENERIC-$Revision: 1.15 $"
+#ident "GENERIC-$Revision: 1.16 $"
maxusers 32
@@ -103,7 +103,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/sandpoint/conf/GENERIC b/sys/arch/sandpoint/conf/GENERIC
index c440c9a9143..991d711dc07 100644
--- a/sys/arch/sandpoint/conf/GENERIC
+++ b/sys/arch/sandpoint/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.54 2011/02/13 20:37:26 phx Exp $
+# $NetBSD: GENERIC,v 1.55 2011/03/06 17:08:30 bouyer Exp $
#
# machine description file for GENERIC NAS
#
@@ -22,7 +22,7 @@ include "arch/sandpoint/conf/std.sandpoint"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.54 $"
+#ident "GENERIC-$Revision: 1.55 $"
maxusers 32
@@ -94,7 +94,8 @@ file-system PTYFS # /dev/ptm support
file-system TMPFS # Efficient memory file-system
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
options NFSSERVER # Network File System server
diff --git a/sys/arch/sbmips/conf/GENERIC b/sys/arch/sbmips/conf/GENERIC
index 130bfe5cd93..a2d4a331a61 100644
--- a/sys/arch/sbmips/conf/GENERIC
+++ b/sys/arch/sbmips/conf/GENERIC
@@ -1,10 +1,10 @@
-# $NetBSD: GENERIC,v 1.81 2011/02/20 07:47:38 matt Exp $
+# $NetBSD: GENERIC,v 1.82 2011/03/06 17:08:30 bouyer Exp $
include "arch/sbmips/conf/std.sbmips"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.81 $"
+#ident "GENERIC-$Revision: 1.82 $"
#options LOCKDEBUG # XXX XXX XXX XXX
#options DEBUG # extra kernel debugging support
@@ -74,7 +74,8 @@ file-system TMPFS # Efficient memory file-system
# File system options
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_NO_SNAPSHOT # No FFS snapshot support
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
diff --git a/sys/arch/sgimips/conf/GENERIC32_IP12 b/sys/arch/sgimips/conf/GENERIC32_IP12
index 97df180eb58..080a99274c3 100644
--- a/sys/arch/sgimips/conf/GENERIC32_IP12
+++ b/sys/arch/sgimips/conf/GENERIC32_IP12
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC32_IP12,v 1.9 2011/03/05 23:38:40 joerg Exp $
+# $NetBSD: GENERIC32_IP12,v 1.10 2011/03/06 17:08:30 bouyer Exp $
#
# GENERIC32_IP12 machine description file
#
@@ -32,7 +32,7 @@ makeoptions TEXTADDR=0x80002000 # entry point
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC32-IP2x-$Revision: 1.9 $"
+#ident "GENERIC32-IP2x-$Revision: 1.10 $"
maxusers 32
@@ -114,7 +114,8 @@ file-system TMPFS # Efficient memory file-system
file-system EFS # Silicon Graphics Extent File System
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/sgimips/conf/GENERIC32_IP2x b/sys/arch/sgimips/conf/GENERIC32_IP2x
index 29479815826..a9ff3893635 100644
--- a/sys/arch/sgimips/conf/GENERIC32_IP2x
+++ b/sys/arch/sgimips/conf/GENERIC32_IP2x
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC32_IP2x,v 1.85 2011/03/05 23:38:40 joerg Exp $
+# $NetBSD: GENERIC32_IP2x,v 1.86 2011/03/06 17:08:30 bouyer Exp $
#
# GENERIC32_IP2x machine description file
#
@@ -29,7 +29,7 @@ makeoptions TEXTADDR=0x88069000 # entry point
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC32-IP2x-$Revision: 1.85 $"
+#ident "GENERIC32-IP2x-$Revision: 1.86 $"
maxusers 32
@@ -115,7 +115,8 @@ file-system TMPFS # Efficient memory file-system
file-system EFS # Silicon Graphics Extent File System
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/sgimips/conf/GENERIC32_IP3x b/sys/arch/sgimips/conf/GENERIC32_IP3x
index ce1a1095353..33142e75d3c 100644
--- a/sys/arch/sgimips/conf/GENERIC32_IP3x
+++ b/sys/arch/sgimips/conf/GENERIC32_IP3x
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC32_IP3x,v 1.87 2011/03/05 23:38:40 joerg Exp $
+# $NetBSD: GENERIC32_IP3x,v 1.88 2011/03/06 17:08:31 bouyer Exp $
#
# GENERIC32_IP3x machine description file
#
@@ -28,7 +28,7 @@ makeoptions TEXTADDR="0x80069000" # entry point
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC32_IP3x-$Revision: 1.87 $"
+#ident "GENERIC32_IP3x-$Revision: 1.88 $"
maxusers 32
@@ -108,7 +108,8 @@ file-system TMPFS # Efficient memory file-system
file-system EFS # Silicon Graphics Extent File System
# File system options
-options QUOTA # UFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/shark/conf/GENERIC b/sys/arch/shark/conf/GENERIC
index fbe611ace4c..9c5e502b5e1 100644
--- a/sys/arch/shark/conf/GENERIC
+++ b/sys/arch/shark/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.92 2011/01/03 06:07:44 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.93 2011/03/06 17:08:31 bouyer Exp $
#
# Generic Shark configuration.
#
@@ -7,7 +7,7 @@ include "arch/shark/conf/std.shark"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.92 $"
+#ident "GENERIC-$Revision: 1.93 $"
# estimated number of users
maxusers 32
@@ -61,7 +61,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/shark/conf/INSTALL b/sys/arch/shark/conf/INSTALL
index 480f5e8313b..ace19456c26 100644
--- a/sys/arch/shark/conf/INSTALL
+++ b/sys/arch/shark/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.45 2010/11/23 11:14:05 hannken Exp $
+# $NetBSD: INSTALL,v 1.46 2011/03/06 17:08:31 bouyer Exp $
#
# Shark installation kernel
#
@@ -56,7 +56,8 @@ file-system KERNFS # /kern
#file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/shark/conf/OFWGENCFG b/sys/arch/shark/conf/OFWGENCFG
index ab3ff84584a..958ce59035d 100644
--- a/sys/arch/shark/conf/OFWGENCFG
+++ b/sys/arch/shark/conf/OFWGENCFG
@@ -1,4 +1,4 @@
-# $NetBSD: OFWGENCFG,v 1.36 2010/11/23 11:14:05 hannken Exp $
+# $NetBSD: OFWGENCFG,v 1.37 2011/03/06 17:08:31 bouyer Exp $
#
# OFWGENCFG: 'generic' configuration for Open Firmware boards.
#
@@ -53,7 +53,8 @@ file-system KERNFS # /kern
#file-system PTYFS # /dev/pts/N support
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options NFSSERVER
options NFS_BOOT_DHCP # NFS booting via DHCP
options NFS_BOOT_RWSIZE=1024 # OFW driver can't cope with more
diff --git a/sys/arch/sparc/conf/BILL-THE-CAT b/sys/arch/sparc/conf/BILL-THE-CAT
index 4f928a48063..a50fddc40b9 100644
--- a/sys/arch/sparc/conf/BILL-THE-CAT
+++ b/sys/arch/sparc/conf/BILL-THE-CAT
@@ -1,4 +1,4 @@
-# $NetBSD: BILL-THE-CAT,v 1.49 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: BILL-THE-CAT,v 1.50 2011/03/06 17:08:31 bouyer Exp $
# From: NetBSD: GENERIC,v 1.84 1999/06/06 13:00:03 mrg Exp
include "arch/sparc/conf/std.sparc"
@@ -155,7 +155,8 @@ file-system PTYFS # /dev/pts/N support
## File system options.
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sparc/conf/INSTALL b/sys/arch/sparc/conf/INSTALL
index a28f15ed2b3..06d4ebc86fc 100644
--- a/sys/arch/sparc/conf/INSTALL
+++ b/sys/arch/sparc/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.77 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: INSTALL,v 1.78 2011/03/06 17:08:31 bouyer Exp $
#
# from: NetBSD: GENERIC,v 1.84 1999/06/06 13:00:03 mrg Exp
#
@@ -181,7 +181,8 @@ file-system CD9660 # ISO 9660 + Rock Ridge file system
## File system options
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
#options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sparc/conf/KRUPS b/sys/arch/sparc/conf/KRUPS
index a74163769c3..d2d00c3a52d 100644
--- a/sys/arch/sparc/conf/KRUPS
+++ b/sys/arch/sparc/conf/KRUPS
@@ -1,4 +1,4 @@
-# $NetBSD: KRUPS,v 1.54 2011/01/17 13:43:02 jdc Exp $
+# $NetBSD: KRUPS,v 1.55 2011/03/06 17:08:31 bouyer Exp $
# From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
#
# Krups (JavaStation-NC) machine description file
@@ -8,7 +8,7 @@ include "arch/sparc/conf/std.sparc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "KRUPS-$Revision: 1.54 $"
+#ident "KRUPS-$Revision: 1.55 $"
maxusers 32
@@ -209,7 +209,8 @@ file-system PTYFS # /dev/pts/N support
## File system options.
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sparc/conf/MRCOFFEE b/sys/arch/sparc/conf/MRCOFFEE
index 4625846122d..4f9b611722a 100644
--- a/sys/arch/sparc/conf/MRCOFFEE
+++ b/sys/arch/sparc/conf/MRCOFFEE
@@ -1,4 +1,4 @@
-# $NetBSD: MRCOFFEE,v 1.32 2011/01/17 13:43:02 jdc Exp $
+# $NetBSD: MRCOFFEE,v 1.33 2011/03/06 17:08:31 bouyer Exp $
# From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
#
# Mr.Coffee (JavaStation 1) machine description file
@@ -12,7 +12,7 @@ include "arch/sparc/conf/std.sparc"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "MRCOFFEE-$Revision: 1.32 $"
+#ident "MRCOFFEE-$Revision: 1.33 $"
maxusers 32
@@ -190,7 +190,8 @@ file-system PTYFS # /dev/pts/N support
## File system options.
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sparc/conf/TADPOLE3GX b/sys/arch/sparc/conf/TADPOLE3GX
index 5e959adb78f..edc0df1b554 100644
--- a/sys/arch/sparc/conf/TADPOLE3GX
+++ b/sys/arch/sparc/conf/TADPOLE3GX
@@ -1,4 +1,4 @@
-# $NetBSD: TADPOLE3GX,v 1.52 2011/01/17 13:43:02 jdc Exp $
+# $NetBSD: TADPOLE3GX,v 1.53 2011/03/06 17:08:31 bouyer Exp $
include "arch/sparc/conf/std.sparc"
@@ -167,7 +167,8 @@ file-system PTYFS # /dev/pts/N support
## File system options.
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sparc64/conf/GENERIC b/sys/arch/sparc64/conf/GENERIC
index e7cd0fc629a..5f8f5af5715 100644
--- a/sys/arch/sparc64/conf/GENERIC
+++ b/sys/arch/sparc64/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.133 2010/12/16 09:35:31 martin Exp $
+# $NetBSD: GENERIC,v 1.134 2011/03/06 17:08:31 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/sparc64/conf/std.sparc64"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.133 $"
+#ident "GENERIC-$Revision: 1.134 $"
maxusers 64
@@ -184,7 +184,8 @@ file-system TMPFS # Efficient memory file-system
## File system options.
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sparc64/conf/NONPLUS64 b/sys/arch/sparc64/conf/NONPLUS64
index fe463575f43..dbaf5c6e6d9 100644
--- a/sys/arch/sparc64/conf/NONPLUS64
+++ b/sys/arch/sparc64/conf/NONPLUS64
@@ -1,8 +1,8 @@
-# $NetBSD: NONPLUS64,v 1.32 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: NONPLUS64,v 1.33 2011/03/06 17:08:31 bouyer Exp $
include "arch/sparc64/conf/std.sparc64"
-#ident "NONPLUS64-$Revision: 1.32 $"
+#ident "NONPLUS64-$Revision: 1.33 $"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
@@ -150,7 +150,8 @@ file-system PTYFS # /dev/pts/N support
## File system options.
options NFSSERVER # Sun NFS-compatible filesystem server
-options QUOTA # FFS quotas
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
#options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sun2/conf/DISKLESS b/sys/arch/sun2/conf/DISKLESS
index 0ac5a9a198e..729c070ed1f 100644
--- a/sys/arch/sun2/conf/DISKLESS
+++ b/sys/arch/sun2/conf/DISKLESS
@@ -1,4 +1,4 @@
-# $NetBSD: DISKLESS,v 1.42 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: DISKLESS,v 1.43 2011/03/06 17:08:32 bouyer Exp $
# DISKLESS Sun2 (2/120, 2/170, 2/50, ...)
# Supports root on: ie0, ec0
@@ -7,7 +7,7 @@ include "arch/sun2/conf/std.sun2"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "DISKLESS-$Revision: 1.42 $"
+#ident "DISKLESS-$Revision: 1.43 $"
makeoptions COPTS="-Os" # optimize for size
@@ -69,7 +69,8 @@ file-system MFS # memory-based filesystem
file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFS_V2_ONLY # Exclude NFS3 code to save space
diff --git a/sys/arch/sun2/conf/FOURMEG b/sys/arch/sun2/conf/FOURMEG
index 4fd097d416f..b945258adc1 100644
--- a/sys/arch/sun2/conf/FOURMEG
+++ b/sys/arch/sun2/conf/FOURMEG
@@ -1,4 +1,4 @@
-# $NetBSD: FOURMEG,v 1.46 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: FOURMEG,v 1.47 2011/03/06 17:08:32 bouyer Exp $
# FOURMEG Sun2 (2/120, 2/170, 2/50, ...)
# Supports root on: ie0, sd*, ...
@@ -7,7 +7,7 @@ include "arch/sun2/conf/std.sun2"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "FOURMEG-$Revision: 1.46 $"
+#ident "FOURMEG-$Revision: 1.47 $"
makeoptions COPTS="-Os" # optimize for size
@@ -69,7 +69,8 @@ file-system CD9660 # ISO 9660 + Rock Ridge file system
#file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sun2/conf/GENERIC b/sys/arch/sun2/conf/GENERIC
index 22dc753b065..6388f3b7564 100644
--- a/sys/arch/sun2/conf/GENERIC
+++ b/sys/arch/sun2/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.76 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: GENERIC,v 1.77 2011/03/06 17:08:32 bouyer Exp $
#
# GENERIC machine description file
#
@@ -25,7 +25,7 @@ include "arch/sun2/conf/std.sun2"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.76 $"
+#ident "GENERIC-$Revision: 1.77 $"
makeoptions COPTS="-Os" # optimize for size
@@ -96,7 +96,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/sun2/conf/INSTALL b/sys/arch/sun2/conf/INSTALL
index 0795725f428..478686efe3b 100644
--- a/sys/arch/sun2/conf/INSTALL
+++ b/sys/arch/sun2/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.39 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: INSTALL,v 1.40 2011/03/06 17:08:32 bouyer Exp $
# INSTALL Sun2 (2/120, 2/170, 2/50, ...)
@@ -6,7 +6,7 @@ include "arch/sun2/conf/std.sun2"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "INSTALL-$Revision: 1.39 $"
+#ident "INSTALL-$Revision: 1.40 $"
makeoptions COPTS="-Os" # optimize for size
@@ -64,7 +64,8 @@ file-system KERNFS # /kern
#file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sun2/conf/RAMDISK b/sys/arch/sun2/conf/RAMDISK
index 24a6365d6ca..3665c9ae02a 100644
--- a/sys/arch/sun2/conf/RAMDISK
+++ b/sys/arch/sun2/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.46 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: RAMDISK,v 1.47 2011/03/06 17:08:32 bouyer Exp $
# RAMDISK: Root/swap on ramdisk
# This kernel is used to:
@@ -69,7 +69,8 @@ file-system CD9660 # ISO 9660 + Rock Ridge file system
#file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sun2/conf/VME b/sys/arch/sun2/conf/VME
index 4384cb9dc55..e9e927d6130 100644
--- a/sys/arch/sun2/conf/VME
+++ b/sys/arch/sun2/conf/VME
@@ -1,4 +1,4 @@
-# $NetBSD: VME,v 1.37 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: VME,v 1.38 2011/03/06 17:08:32 bouyer Exp $
# VME Sun2 (2/50, 2/130, 2/160...)
# Supports root on: ie0, sd*, ...
@@ -7,7 +7,7 @@ include "arch/sun2/conf/std.sun2"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "VME-$Revision: 1.37 $"
+#ident "VME-$Revision: 1.38 $"
# Machines to be supported by this kernel
#options FPU_EMULATE
@@ -71,7 +71,8 @@ file-system MFS # memory-based filesystem
file-system PTYFS # /dev/pts/N support
options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sun3/conf/DISKLESS b/sys/arch/sun3/conf/DISKLESS
index 02db95946ed..6d437409d81 100644
--- a/sys/arch/sun3/conf/DISKLESS
+++ b/sys/arch/sun3/conf/DISKLESS
@@ -1,4 +1,4 @@
-# $NetBSD: DISKLESS,v 1.61 2009/03/06 20:31:53 joerg Exp $
+# $NetBSD: DISKLESS,v 1.62 2011/03/06 17:08:32 bouyer Exp $
# DISKLESS - Root and swap on NFS
# Desktop machines only (3/50, 3/60, 3/110)
@@ -73,7 +73,8 @@ file-system NFS # Sun NFS client support
#file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
# Networking options
diff --git a/sys/arch/sun3/conf/DISKLESS3X b/sys/arch/sun3/conf/DISKLESS3X
index b238025ef71..1b769c8dd7d 100644
--- a/sys/arch/sun3/conf/DISKLESS3X
+++ b/sys/arch/sun3/conf/DISKLESS3X
@@ -1,4 +1,4 @@
-# $NetBSD: DISKLESS3X,v 1.48 2009/03/06 20:31:53 joerg Exp $
+# $NetBSD: DISKLESS3X,v 1.49 2011/03/06 17:08:32 bouyer Exp $
# DISKLESS - Root and swap on NFS
# Desktop machines only (3/80)
@@ -74,7 +74,8 @@ file-system NFS # Sun NFS client support
#file-system PTYFS # /dev/pts/N support
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
# Networking options
diff --git a/sys/arch/sun3/conf/GENERIC b/sys/arch/sun3/conf/GENERIC
index 19b74f9375c..9ef39158e3e 100644
--- a/sys/arch/sun3/conf/GENERIC
+++ b/sys/arch/sun3/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.154 2011/01/03 06:07:44 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.155 2011/03/06 17:08:32 bouyer Exp $
#
# GENERIC machine description file
#
@@ -25,7 +25,7 @@ include "arch/sun3/conf/std.sun3"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.154 $"
+#ident "GENERIC-$Revision: 1.155 $"
makeoptions COPTS="-Os" # bootloader has size limit (~2MB)
@@ -108,7 +108,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/sun3/conf/GENERIC3X b/sys/arch/sun3/conf/GENERIC3X
index 04a3c091b21..e684da9edc9 100644
--- a/sys/arch/sun3/conf/GENERIC3X
+++ b/sys/arch/sun3/conf/GENERIC3X
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC3X,v 1.110 2011/01/03 06:07:44 tsutsui Exp $
+# $NetBSD: GENERIC3X,v 1.111 2011/03/06 17:08:32 bouyer Exp $
# GENERIC Sun3X (3/80, 3/470)
# Supports root on: ie0, le0, sd*, ...
@@ -7,7 +7,7 @@ include "arch/sun3/conf/std.sun3x"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC3X-$Revision: 1.110 $"
+#ident "GENERIC3X-$Revision: 1.111 $"
makeoptions COPTS="-Os" # bootloader has size limit (~2MB)
@@ -91,7 +91,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/sun3/conf/INSTALL b/sys/arch/sun3/conf/INSTALL
index ed814384d29..d66a2facd96 100644
--- a/sys/arch/sun3/conf/INSTALL
+++ b/sys/arch/sun3/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.47 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: INSTALL,v 1.48 2011/03/06 17:08:32 bouyer Exp $
#
# INSTALL - Installation kernel for the Sun3
#
@@ -78,7 +78,8 @@ file-system KERNFS # /kern
# Filesystem options
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/sun3/conf/INSTALL3X b/sys/arch/sun3/conf/INSTALL3X
index 0583b34434a..77f7671c390 100644
--- a/sys/arch/sun3/conf/INSTALL3X
+++ b/sys/arch/sun3/conf/INSTALL3X
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL3X,v 1.46 2010/11/23 11:14:06 hannken Exp $
+# $NetBSD: INSTALL3X,v 1.47 2011/03/06 17:08:32 bouyer Exp $
#
# INSTALL3X - Installation kernel for the Sun3X
#
@@ -78,7 +78,8 @@ file-system KERNFS # /kern
# Filesystem options
#options NFSSERVER # nfs server support
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFS_V2_ONLY # Exclude NFS3 code to save space
options FFS_NO_SNAPSHOT # No FFS snapshot support
diff --git a/sys/arch/vax/conf/GENERIC b/sys/arch/vax/conf/GENERIC
index 1f4a6b1dd6f..60b28919f45 100644
--- a/sys/arch/vax/conf/GENERIC
+++ b/sys/arch/vax/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.175 2010/08/08 18:19:26 chs Exp $
+# $NetBSD: GENERIC,v 1.176 2011/03/06 17:08:32 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/vax/conf/std.vax"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.175 $"
+#ident "GENERIC-$Revision: 1.176 $"
# Here are all different supported CPU types listed.
#options VAX8800 # VAX 8500, 8530, 8550, 8700, 8800
@@ -115,7 +115,8 @@ file-system PTYFS # /dev/pts/N support
file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
-options QUOTA
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/vax/conf/INSTALL b/sys/arch/vax/conf/INSTALL
index 43f37b364a9..c8b5041158b 100644
--- a/sys/arch/vax/conf/INSTALL
+++ b/sys/arch/vax/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.54 2010/11/23 11:14:07 hannken Exp $
+# $NetBSD: INSTALL,v 1.55 2011/03/06 17:08:32 bouyer Exp $
#
# INSTALL kernel; all supported devices but nothing fancy.
#
@@ -63,7 +63,8 @@ file-system CD9660
#file-system PTYFS # /dev/pts/N support
# Filesystem options
-#options QUOTA
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
#options NFS_V2_ONLY # Exclude NFS3 code to save space
diff --git a/sys/arch/vax/conf/VAX780 b/sys/arch/vax/conf/VAX780
index 47ec82308f3..73451585cd1 100644
--- a/sys/arch/vax/conf/VAX780
+++ b/sys/arch/vax/conf/VAX780
@@ -1,4 +1,4 @@
-# $NetBSD: VAX780,v 1.3 2010/04/16 13:48:36 pooka Exp $
+# $NetBSD: VAX780,v 1.4 2011/03/06 17:08:32 bouyer Exp $
#
# 11/780,750,730 machine description file
#
@@ -99,7 +99,8 @@ file-system PTYFS # /dev/pts/N support
#file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
-options QUOTA
+options QUOTA # legacy UFS quotas
+options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/x68k/conf/GENERIC b/sys/arch/x68k/conf/GENERIC
index 1309e32ca21..1867fe13476 100644
--- a/sys/arch/x68k/conf/GENERIC
+++ b/sys/arch/x68k/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.153 2011/01/03 06:15:16 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.154 2011/03/06 17:08:33 bouyer Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/x68k/conf/std.x68k"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.153 $"
+#ident "GENERIC-$Revision: 1.154 $"
maxusers 8
@@ -190,7 +190,8 @@ file-system TMPFS # Efficient memory file-system
## File system options.
options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental
diff --git a/sys/arch/x68k/conf/INSTALL b/sys/arch/x68k/conf/INSTALL
index 7b7d763de96..c917c1720ff 100644
--- a/sys/arch/x68k/conf/INSTALL
+++ b/sys/arch/x68k/conf/INSTALL
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.90 2010/11/23 11:14:07 hannken Exp $
+# $NetBSD: INSTALL,v 1.91 2011/03/06 17:08:33 bouyer Exp $
#
# INSTALL -- installation kernel.
@@ -8,7 +8,7 @@ include "arch/x68k/conf/std.x68k"
#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "INSTALL-$Revision: 1.90 $"
+#ident "INSTALL-$Revision: 1.91 $"
makeoptions COPTS="-Os" # Optimise for space. Implies -O2
@@ -173,7 +173,8 @@ file-system MSDOSFS # MS-DOS FAT filesystem(s).
## File system options.
#options NFSSERVER # Sun NFS-compatible filesystem server
-#options QUOTA # FFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independent support
options WAPBL # File system journaling support - Experimental
#options NFS_V2_ONLY # Exclude NFS3 code to save space
diff --git a/sys/arch/zaurus/conf/GENERIC b/sys/arch/zaurus/conf/GENERIC
index af09b862526..7bfd42dda66 100644
--- a/sys/arch/zaurus/conf/GENERIC
+++ b/sys/arch/zaurus/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.33 2011/02/13 14:28:29 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.34 2011/03/06 17:08:33 bouyer Exp $
#
# GENERIC machine description file
#
@@ -69,7 +69,8 @@ file-system TMPFS # Efficient memory file-system
#file-system UDF # experimental - OSTA UDF CD/DVD file-system
# File system options
-#options QUOTA # UFS quotas
+#options QUOTA # legacy UFS quotas
+#options QUOTA2 # new, in-filesystem UFS quotas
#options FFS_EI # FFS Endian Independant support
#options NFSSERVER
options WAPBL # File system journaling support - Experimental
diff --git a/sys/compat/common/compat_mod.c b/sys/compat/common/compat_mod.c
index 9ae9d298180..4ec37d0c699 100644
--- a/sys/compat/common/compat_mod.c
+++ b/sys/compat/common/compat_mod.c
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_mod.c,v 1.12 2011/01/19 10:21:16 tsutsui Exp $ */
+/* $NetBSD: compat_mod.c,v 1.13 2011/03/06 17:08:33 bouyer Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.12 2011/01/19 10:21:16 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.13 2011/03/06 17:08:33 bouyer Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -230,6 +230,7 @@ static const struct syscall_package compat_syscalls[] = {
# endif
{ SYS_compat_50___fhstat40, 0, (sy_call_t *)compat_50_sys___fhstat40 },
{ SYS_compat_50_aio_suspend, 0, (sy_call_t *)compat_50_sys_aio_suspend },
+ { SYS_compat_50_quotactl, 0, (sy_call_t *)compat_50_sys_quotactl },
#endif
{ 0, 0, NULL },
};
diff --git a/sys/compat/common/vfs_syscalls_50.c b/sys/compat/common/vfs_syscalls_50.c
index 98f49abfe35..a80db965509 100644
--- a/sys/compat/common/vfs_syscalls_50.c
+++ b/sys/compat/common/vfs_syscalls_50.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_50.c,v 1.6 2010/07/13 15:38:15 pooka Exp $ */
+/* $NetBSD: vfs_syscalls_50.c,v 1.7 2011/03/06 17:08:33 bouyer Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.6 2010/07/13 15:38:15 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.7 2011/03/06 17:08:33 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -312,3 +312,218 @@ compat_50_sys_mknod(struct lwp *l,
return do_sys_mknod(l, SCARG(uap, path), SCARG(uap, mode),
SCARG(uap, dev), retval, UIO_USERSPACE);
}
+
+#include <ufs/ufs/quota1.h>
+#include <ufs/ufs/quota2_prop.h>
+
+/* ARGSUSED */
+int
+compat_50_sys_quotactl(struct lwp *l, const struct compat_50_sys_quotactl_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(const char *) path;
+ syscallarg(int) cmd;
+ syscallarg(int) uid;
+ syscallarg(void *) arg;
+ } */
+ struct mount *mp;
+ int error;
+ uint8_t error8;
+ struct vnode *vp;
+ int q1cmd = SCARG(uap, cmd);
+ prop_dictionary_t dict, data, cmd;
+ prop_array_t cmds, datas;
+ char *bufpath;
+ struct dqblk dqblk;
+ struct quota2_entry q2e;
+ static const char *quotatypes[MAXQUOTAS] = INITQFNAMES;
+
+ error = namei_simple_user(SCARG(uap, path),
+ NSM_FOLLOW_TRYEMULROOT, &vp);
+ if (error != 0)
+ return (error);
+ error = ENOMEM;
+ mp = vp->v_mount;
+ if ((dict = quota2_prop_create()) == NULL)
+ goto out;
+ if ((cmds = prop_array_create()) == NULL)
+ goto out_dict;
+ if ((datas = prop_array_create()) == NULL)
+ goto out_cmds;
+
+ switch((q1cmd & ~SUBCMDMASK) >> SUBCMDSHIFT) {
+ case Q_QUOTAON:
+ data = prop_dictionary_create();
+ if (data == NULL)
+ goto out_datas;
+ bufpath = malloc(PATH_MAX * sizeof(char), M_TEMP, M_WAITOK);
+ if (bufpath == NULL)
+ goto out_data;
+ error = copyinstr(SCARG(uap, arg), bufpath, PATH_MAX, NULL);
+ if (error != 0) {
+ free(bufpath, M_TEMP);
+ goto out_data;
+ }
+ if (!prop_dictionary_set_cstring(data, "quotafile", bufpath))
+ error = ENOMEM;
+ free(bufpath, M_TEMP);
+ if (error)
+ goto out_data;
+ error = ENOMEM;
+ if (!prop_array_add_and_rel(datas, data))
+ goto out_datas;
+ if (!quota2_prop_add_command(cmds, "quotaon",
+ quotatypes[q1cmd & SUBCMDMASK], datas))
+ goto out_cmds;
+ goto do_quotaonoff;
+
+ case Q_QUOTAOFF:
+ error = ENOMEM;
+ if (!quota2_prop_add_command(cmds, "quotaoff",
+ quotatypes[q1cmd & SUBCMDMASK], datas))
+ goto out_cmds;
+do_quotaonoff:
+ if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
+ goto out_dict;
+ error = VFS_QUOTACTL(mp, dict);
+ if (error)
+ goto out_dict;
+ if ((error = quota2_get_cmds(dict, &cmds)) != 0)
+ goto out_dict;
+ cmd = prop_array_get(cmds, 0);
+ if (cmd == NULL) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ error = error8;
+ goto out_dict;
+
+ case Q_GETQUOTA:
+ error = ENOMEM;
+ data = prop_dictionary_create();
+ if (data == NULL)
+ goto out_datas;
+ if (!prop_dictionary_set_uint32(data, "id", SCARG(uap, uid)))
+ goto out_data;
+ if (!prop_array_add_and_rel(datas, data))
+ goto out_datas;
+ if (!quota2_prop_add_command(cmds, "get",
+ quotatypes[q1cmd & SUBCMDMASK], datas))
+ goto out_cmds;
+ if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
+ goto out_dict;
+ error = VFS_QUOTACTL(mp, dict);
+ if (error)
+ goto out_dict;
+ if ((error = quota2_get_cmds(dict, &cmds)) != 0)
+ goto out_dict;
+ cmd = prop_array_get(cmds, 0);
+ if (cmd == NULL) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ error = error8;
+ if (error)
+ goto out_dict;
+ datas = prop_dictionary_get(cmd, "data");
+ error = EINVAL;
+ if (datas == NULL)
+ goto out_dict;
+ data = prop_array_get(datas, 0);
+ if (data == NULL)
+ goto out_dict;
+ error = quota2_dict_get_q2e_usage(data, &q2e);
+ if (error)
+ goto out_dict;
+ q2e2dqblk(&q2e, &dqblk);
+ error = copyout(&dqblk, SCARG(uap, arg), sizeof(dqblk));
+ goto out_dict;
+
+ case Q_SETQUOTA:
+ error = copyin(SCARG(uap, arg), &dqblk, sizeof(dqblk));
+ if (error)
+ goto out_datas;
+ dqblk2q2e(&dqblk, &q2e);
+ q2e.q2e_uid = SCARG(uap, uid);
+
+ error = ENOMEM;
+ data = q2etoprop(&q2e, 0);
+ if (data == NULL)
+ goto out_data;
+ if (!prop_array_add_and_rel(datas, data))
+ goto out_datas;
+ if (!quota2_prop_add_command(cmds, "set",
+ quotatypes[q1cmd & SUBCMDMASK], datas))
+ goto out_cmds;
+ if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
+ goto out_dict;
+ error = VFS_QUOTACTL(mp, dict);
+ if (error)
+ goto out_dict;
+ if ((error = quota2_get_cmds(dict, &cmds)) != 0)
+ goto out_dict;
+ cmd = prop_array_get(cmds, 0);
+ if (cmd == NULL) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ error = error8;
+ goto out_dict;
+
+ case Q_SYNC:
+ /*
+ * not supported but used only to see if quota is supported,
+ * emulate with a "get version"
+ */
+ error = ENOMEM;
+ if (!quota2_prop_add_command(cmds, "get version",
+ quotatypes[q1cmd & SUBCMDMASK], datas))
+ goto out_cmds;
+ if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
+ goto out_dict;
+ error = VFS_QUOTACTL(mp, dict);
+ if (error)
+ goto out_dict;
+ if ((error = quota2_get_cmds(dict, &cmds)) != 0)
+ goto out_dict;
+ cmd = prop_array_get(cmds, 0);
+ if (cmd == NULL) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ if (!prop_dictionary_get_int8(cmd, "return", &error8)) {
+ error = EINVAL;
+ goto out_dict;
+ }
+ error = error8;
+ goto out_dict;
+
+ case Q_SETUSE:
+ default:
+ error = EOPNOTSUPP;
+ goto out_datas;
+ }
+out_data:
+ prop_object_release(data);
+out_datas:
+ prop_object_release(datas);
+out_cmds:
+ prop_object_release(cmds);
+out_dict:
+ prop_object_release(dict);
+out:
+ vrele(vp);
+ return error;
+}
diff --git a/sys/compat/freebsd/freebsd_syscall.h b/sys/compat/freebsd/freebsd_syscall.h
index 5e56a6dc6f0..dac3166763d 100644
--- a/sys/compat/freebsd/freebsd_syscall.h
+++ b/sys/compat/freebsd/freebsd_syscall.h
@@ -1,10 +1,10 @@
-/* $NetBSD: freebsd_syscall.h,v 1.76 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: freebsd_syscall.h,v 1.77 2011/03/06 17:08:33 bouyer Exp $ */
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.64 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.64.6.1 2011/02/08 21:46:53 bouyer Exp
*/
#ifndef _FREEBSD_SYS_SYSCALL_H_
diff --git a/sys/compat/freebsd/freebsd_syscallargs.h b/sys/compat/freebsd/freebsd_syscallargs.h
index 118e54dc514..3eb2b49a443 100644
--- a/sys/compat/freebsd/freebsd_syscallargs.h
+++ b/sys/compat/freebsd/freebsd_syscallargs.h
@@ -1,10 +1,10 @@
-/* $NetBSD: freebsd_syscallargs.h,v 1.79 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: freebsd_syscallargs.h,v 1.80 2011/03/06 17:08:33 bouyer Exp $ */
/*
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.64 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.64.6.1 2011/02/08 21:46:53 bouyer Exp
*/
#ifndef _FREEBSD_SYS_SYSCALLARGS_H_
@@ -27,7 +27,7 @@
}
#undef check_syscall_args
-#define check_syscall_args(call) \
+#define check_syscall_args(call) /*LINTED*/ \
typedef char call##_check_args[sizeof (struct call##_args) \
<= FREEBSD_SYS_MAXSYSARGS * sizeof (register_t) ? 1 : -1];
@@ -302,7 +302,7 @@ struct compat_43_sys_setrlimit_args;
struct compat_43_sys_killpg_args;
-struct sys_quotactl_args;
+struct compat_50_sys_quotactl_args;
struct compat_43_sys_getsockname_args;
@@ -887,7 +887,7 @@ int compat_43_sys_killpg(struct lwp *, const struct compat_43_sys_killpg_args *,
int sys_setsid(struct lwp *, const void *, register_t *);
-int sys_quotactl(struct lwp *, const struct sys_quotactl_args *, register_t *);
+int compat_50_sys_quotactl(struct lwp *, const struct compat_50_sys_quotactl_args *, register_t *);
int compat_43_sys_quota(struct lwp *, const void *, register_t *);
diff --git a/sys/compat/freebsd/freebsd_syscalls.c b/sys/compat/freebsd/freebsd_syscalls.c
index 31b8046c4f4..138d57236a9 100644
--- a/sys/compat/freebsd/freebsd_syscalls.c
+++ b/sys/compat/freebsd/freebsd_syscalls.c
@@ -1,14 +1,14 @@
-/* $NetBSD: freebsd_syscalls.c,v 1.76 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: freebsd_syscalls.c,v 1.77 2011/03/06 17:08:33 bouyer Exp $ */
/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.64 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.64.6.1 2011/02/08 21:46:53 bouyer Exp
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_syscalls.c,v 1.76 2010/03/02 21:14:44 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_syscalls.c,v 1.77 2011/03/06 17:08:33 bouyer Exp $");
#if defined(_KERNEL_OPT)
#if defined(_KERNEL_OPT)
@@ -535,4 +535,76 @@ const char *const freebsd_syscallnames[] = {
/* 437 */ "#437 (unimplemented extattr_list_fd)",
/* 438 */ "#438 (unimplemented extattr_list_file)",
/* 439 */ "#439 (unimplemented extattr_list_link)",
+ /* 440 */ "# filler",
+ /* 441 */ "# filler",
+ /* 442 */ "# filler",
+ /* 443 */ "# filler",
+ /* 444 */ "# filler",
+ /* 445 */ "# filler",
+ /* 446 */ "# filler",
+ /* 447 */ "# filler",
+ /* 448 */ "# filler",
+ /* 449 */ "# filler",
+ /* 450 */ "# filler",
+ /* 451 */ "# filler",
+ /* 452 */ "# filler",
+ /* 453 */ "# filler",
+ /* 454 */ "# filler",
+ /* 455 */ "# filler",
+ /* 456 */ "# filler",
+ /* 457 */ "# filler",
+ /* 458 */ "# filler",
+ /* 459 */ "# filler",
+ /* 460 */ "# filler",
+ /* 461 */ "# filler",
+ /* 462 */ "# filler",
+ /* 463 */ "# filler",
+ /* 464 */ "# filler",
+ /* 465 */ "# filler",
+ /* 466 */ "# filler",
+ /* 467 */ "# filler",
+ /* 468 */ "# filler",
+ /* 469 */ "# filler",
+ /* 470 */ "# filler",
+ /* 471 */ "# filler",
+ /* 472 */ "# filler",
+ /* 473 */ "# filler",
+ /* 474 */ "# filler",
+ /* 475 */ "# filler",
+ /* 476 */ "# filler",
+ /* 477 */ "# filler",
+ /* 478 */ "# filler",
+ /* 479 */ "# filler",
+ /* 480 */ "# filler",
+ /* 481 */ "# filler",
+ /* 482 */ "# filler",
+ /* 483 */ "# filler",
+ /* 484 */ "# filler",
+ /* 485 */ "# filler",
+ /* 486 */ "# filler",
+ /* 487 */ "# filler",
+ /* 488 */ "# filler",
+ /* 489 */ "# filler",
+ /* 490 */ "# filler",
+ /* 491 */ "# filler",
+ /* 492 */ "# filler",
+ /* 493 */ "# filler",
+ /* 494 */ "# filler",
+ /* 495 */ "# filler",
+ /* 496 */ "# filler",
+ /* 497 */ "# filler",
+ /* 498 */ "# filler",
+ /* 499 */ "# filler",
+ /* 500 */ "# filler",
+ /* 501 */ "# filler",
+ /* 502 */ "# filler",
+ /* 503 */ "# filler",
+ /* 504 */ "# filler",
+ /* 505 */ "# filler",
+ /* 506 */ "# filler",
+ /* 507 */ "# filler",
+ /* 508 */ "# filler",
+ /* 509 */ "# filler",
+ /* 510 */ "# filler",
+ /* 511 */ "# filler",
};
diff --git a/sys/compat/freebsd/freebsd_sysent.c b/sys/compat/freebsd/freebsd_sysent.c
index 20f65744c95..51c3a18499c 100644
--- a/sys/compat/freebsd/freebsd_sysent.c
+++ b/sys/compat/freebsd/freebsd_sysent.c
@@ -1,14 +1,14 @@
-/* $NetBSD: freebsd_sysent.c,v 1.78 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: freebsd_sysent.c,v 1.79 2011/03/06 17:08:33 bouyer Exp $ */
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.64 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.64.6.1 2011/02/08 21:46:53 bouyer Exp
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_sysent.c,v 1.78 2010/03/02 21:14:44 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_sysent.c,v 1.79 2011/03/06 17:08:33 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ktrace.h"
@@ -338,8 +338,8 @@ struct sysent freebsd_sysent[] = {
(sy_call_t *)compat_43_sys_killpg },/* 146 = okillpg */
{ 0, 0, 0,
(sy_call_t *)sys_setsid }, /* 147 = setsid */
- { ns(struct sys_quotactl_args), 0,
- (sy_call_t *)sys_quotactl }, /* 148 = quotactl */
+ { ns(struct compat_50_sys_quotactl_args), 0,
+ (sy_call_t *)compat_50_sys_quotactl },/* 148 = quotactl */
{ 0, 0, 0,
(sy_call_t *)compat_43_sys_quota }, /* 149 = oquota */
{ ns(struct compat_43_sys_getsockname_args), 0,
diff --git a/sys/compat/freebsd/syscalls.master b/sys/compat/freebsd/syscalls.master
index b9ca56fd820..13fa55278ce 100644
--- a/sys/compat/freebsd/syscalls.master
+++ b/sys/compat/freebsd/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.64 2010/03/02 21:07:21 pooka Exp $
+ $NetBSD: syscalls.master,v 1.65 2011/03/06 17:08:34 bouyer Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -278,8 +278,8 @@
146 NOARGS { int|compat_43_sys||killpg(int pgid, int signum); } \
okillpg
147 NOARGS { int|sys||setsid(void); }
-148 NOARGS { int|sys||quotactl(char *path, int cmd, int uid, \
- void *arg); }
+148 NOARGS { int|compat_50_sys||quotactl(char *path, int cmd, \
+ int uid, void *arg); }
149 NOARGS { int|compat_43_sys||quota(void); } oquota
150 NOARGS { int|compat_43_sys||getsockname(int fdec, void *asa, \
int *alen); } ogetsockname
diff --git a/sys/compat/netbsd32/netbsd32.h b/sys/compat/netbsd32/netbsd32.h
index c1ed68c7e65..0162671b8f1 100644
--- a/sys/compat/netbsd32/netbsd32.h
+++ b/sys/compat/netbsd32/netbsd32.h
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.85 2011/01/22 22:26:10 matt Exp $ */
+/* $NetBSD: netbsd32.h,v 1.86 2011/03/06 17:08:34 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -789,6 +789,12 @@ struct netbsd32_timex {
netbsd32_long stbcnt; /* stability limit exceeded (ro) */
};
+/* <prop/plistref.h> */
+struct netbsd32_plistref {
+ netbsd32_pointer_t pref_plist;
+ netbsd32_size_t pref_len;
+};
+
/* from <ufs/lfs/lfs.h> */
typedef netbsd32_pointer_t netbsd32_block_infop_t; /* XXX broken */
diff --git a/sys/compat/netbsd32/netbsd32_compat_50.c b/sys/compat/netbsd32/netbsd32_compat_50.c
index cf768b4a9fb..429766e5364 100644
--- a/sys/compat/netbsd32/netbsd32_compat_50.c
+++ b/sys/compat/netbsd32/netbsd32_compat_50.c
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_50.c,v 1.17 2010/05/30 19:31:39 drochner Exp $ */
+/* $NetBSD: netbsd32_compat_50.c,v 1.18 2011/03/06 17:08:34 bouyer Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.17 2010/05/30 19:31:39 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.18 2011/03/06 17:08:34 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_sysv.h"
@@ -1069,3 +1069,21 @@ compat_50_netbsd32___shmctl13(struct lwp *l, const struct compat_50_netbsd32___s
return error;
}
#endif
+
+int
+compat_50_netbsd32_quotactl(struct lwp *l, const struct compat_50_netbsd32_quotactl_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(int) cmd;
+ syscallarg(int) uid;
+ syscallarg(netbsd32_voidp) arg;
+ } */
+ struct compat_50_sys_quotactl_args ua;
+
+ NETBSD32TOP_UAP(path, const char);
+ NETBSD32TO64_UAP(cmd);
+ NETBSD32TO64_UAP(uid);
+ NETBSD32TOP_UAP(arg, void *);
+ return (compat_50_sys_quotactl(l, &ua, retval));
+}
diff --git a/sys/compat/netbsd32/netbsd32_conv.h b/sys/compat/netbsd32/netbsd32_conv.h
index 344973ee889..e81b58bdc7b 100644
--- a/sys/compat/netbsd32/netbsd32_conv.h
+++ b/sys/compat/netbsd32/netbsd32_conv.h
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_conv.h,v 1.25 2011/02/20 08:07:09 matt Exp $ */
+/* $NetBSD: netbsd32_conv.h,v 1.26 2011/03/06 17:08:34 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -52,6 +52,8 @@
#include <compat/sys/dirent.h>
+#include <prop/plistref.h>
+
#include <compat/netbsd32/netbsd32.h>
/* converters for structures that we need */
@@ -755,4 +757,30 @@ netbsd32_to_dirent12(char *buf, int nbytes)
return ((char *)(void *)odp) - buf;
}
+static inline int
+netbsd32_copyin_plistref(netbsd32_pointer_t n32p, struct plistref *p)
+{
+ struct netbsd32_plistref n32plist;
+ int error;
+
+ error = copyin(NETBSD32PTR64(n32p), &n32plist,
+ sizeof(struct netbsd32_plistref));
+ if (error)
+ return error;
+ p->pref_plist = NETBSD32PTR64(n32plist.pref_plist);
+ p->pref_len = n32plist.pref_len;
+ return 0;
+}
+
+static inline int
+netbsd32_copyout_plistref(netbsd32_pointer_t n32p, struct plistref *p)
+{
+ struct netbsd32_plistref n32plist;
+
+ NETBSD32PTR32(n32plist.pref_plist, p->pref_plist);
+ n32plist.pref_len = p->pref_len;
+ return copyout(&n32plist, NETBSD32PTR64(n32p),
+ sizeof(struct netbsd32_plistref));
+}
+
#endif /* _COMPAT_NETBSD32_NETBSD32_CONV_H_ */
diff --git a/sys/compat/netbsd32/netbsd32_ioctl.h b/sys/compat/netbsd32/netbsd32_ioctl.h
index c7f6b04844f..d4b85b2900b 100644
--- a/sys/compat/netbsd32/netbsd32_ioctl.h
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_ioctl.h,v 1.30 2011/02/01 00:53:22 matt Exp $ */
+/* $NetBSD: netbsd32_ioctl.h,v 1.31 2011/03/06 17:08:34 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -389,11 +389,6 @@ struct netbsd32_vnd_ioctl50 {
#define VNDIOCSET5032 _IOWR('F', 0, struct netbsd32_vnd_ioctl50)
#define VNDIOCCLR5032 _IOW('F', 1, struct netbsd32_vnd_ioctl50)
-struct netbsd32_plistref {
- netbsd32_voidp pref_plist; /* plist data */
- netbsd32_size_t pref_len; /* total length of plist data */
-};
-
#define ENVSYS_GETDICTIONARY32 _IOWR('E', 0, struct netbsd32_plistref)
#define ENVSYS_SETDICTIONARY32 _IOWR('E', 1, struct netbsd32_plistref)
#define ENVSYS_REMOVEPROPS32 _IOWR('E', 2, struct netbsd32_plistref)
diff --git a/sys/compat/netbsd32/netbsd32_netbsd.c b/sys/compat/netbsd32/netbsd32_netbsd.c
index 3e2f676c750..6e469708a00 100644
--- a/sys/compat/netbsd32/netbsd32_netbsd.c
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_netbsd.c,v 1.168 2010/11/19 06:44:37 dholland Exp $ */
+/* $NetBSD: netbsd32_netbsd.c,v 1.169 2011/03/06 17:08:34 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.168 2010/11/19 06:44:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.169 2011/03/06 17:08:34 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@@ -1185,21 +1185,39 @@ netbsd32_rmdir(struct lwp *l, const struct netbsd32_rmdir_args *uap, register_t
}
int
-netbsd32_quotactl(struct lwp *l, const struct netbsd32_quotactl_args *uap, register_t *retval)
+netbsd32___quotactl50(struct lwp *l, const struct netbsd32___quotactl50_args *uap, register_t *retval)
{
/* {
syscallarg(const netbsd32_charp) path;
- syscallarg(int) cmd;
- syscallarg(int) uid;
- syscallarg(netbsd32_voidp) arg;
+ syscallarg(netbsd32_voidp) v;
} */
- struct sys_quotactl_args ua;
+ struct plistref pref;
+ int error;
+ struct vnode *vp;
+ struct mount *mp;
+ prop_dictionary_t dict;
- NETBSD32TOP_UAP(path, const char);
- NETBSD32TO64_UAP(cmd);
- NETBSD32TO64_UAP(uid);
- NETBSD32TOP_UAP(arg, void *);
- return (sys_quotactl(l, &ua, retval));
+ error = namei_simple_user(SCARG_P32(uap, path),
+ NSM_FOLLOW_TRYEMULROOT, &vp);
+
+ if (error != 0)
+ return (error);
+ mp = vp->v_mount;
+
+ error = netbsd32_copyin_plistref(SCARG(uap, pref), &pref);
+ if (error)
+ return error;
+ error = prop_dictionary_copyin(&pref, &dict);
+ if (error)
+ return error;
+ error = VFS_QUOTACTL(mp, dict);
+ vrele(vp);
+ if (!error)
+ error = prop_dictionary_copyout(&pref, dict);
+ if (!error)
+ error = netbsd32_copyout_plistref(SCARG(uap, pref), &pref);
+ prop_object_release(dict);
+ return (error);
}
int
diff --git a/sys/compat/netbsd32/netbsd32_syscall.h b/sys/compat/netbsd32/netbsd32_syscall.h
index 321e1d637de..8cee05a4753 100644
--- a/sys/compat/netbsd32/netbsd32_syscall.h
+++ b/sys/compat/netbsd32/netbsd32_syscall.h
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.92 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.93 2011/03/06 17:08:34 bouyer Exp $ */
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.84 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.84.6.2 2011/02/09 16:09:55 bouyer Exp
*/
#ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -432,8 +432,8 @@
/* syscall: "setsid" ret: "int" args: */
#define NETBSD32_SYS_setsid 147
-/* syscall: "netbsd32_quotactl" ret: "int" args: "netbsd32_charp" "int" "int" "netbsd32_voidp" */
-#define NETBSD32_SYS_netbsd32_quotactl 148
+/* syscall: "compat_50_netbsd32_quotactl" ret: "int" args: "netbsd32_charp" "int" "int" "netbsd32_voidp" */
+#define NETBSD32_SYS_compat_50_netbsd32_quotactl 148
/* syscall: "compat_43_oquota" ret: "int" args: */
#define NETBSD32_SYS_compat_43_oquota 149
@@ -1196,6 +1196,9 @@
/* syscall: "netbsd32___fhstat50" ret: "int" args: "const netbsd32_voidp" "netbsd32_size_t" "netbsd32_statp_t" */
#define NETBSD32_SYS_netbsd32___fhstat50 451
-#define NETBSD32_SYS_MAXSYSCALL 452
+/* syscall: "netbsd32___quotactl50" ret: "int" args: "const netbsd32_charp" "netbsd32_voidp" */
+#define NETBSD32_SYS_netbsd32___quotactl50 452
+
+#define NETBSD32_SYS_MAXSYSCALL 453
#define NETBSD32_SYS_NSYSENT 512
#endif /* _NETBSD32_SYS_SYSCALL_H_ */
diff --git a/sys/compat/netbsd32/netbsd32_syscallargs.h b/sys/compat/netbsd32/netbsd32_syscallargs.h
index 3e01af7f428..1af1ed5da04 100644
--- a/sys/compat/netbsd32/netbsd32_syscallargs.h
+++ b/sys/compat/netbsd32/netbsd32_syscallargs.h
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.92 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.93 2011/03/06 17:08:34 bouyer Exp $ */
/*
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.84 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.84.6.2 2011/02/09 16:09:55 bouyer Exp
*/
#ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -27,7 +27,7 @@
}
#undef check_syscall_args
-#define check_syscall_args(call) \
+#define check_syscall_args(call) /*LINTED*/ \
typedef char call##_check_args[sizeof (struct call##_args) \
<= NETBSD32_SYS_MAXSYSARGS * sizeof (register32_t) ? 1 : -1];
@@ -801,13 +801,13 @@ struct compat_43_netbsd32_killpg_args {
};
check_syscall_args(compat_43_netbsd32_killpg)
-struct netbsd32_quotactl_args {
+struct compat_50_netbsd32_quotactl_args {
syscallarg(netbsd32_charp) path;
syscallarg(int) cmd;
syscallarg(int) uid;
syscallarg(netbsd32_voidp) arg;
};
-check_syscall_args(netbsd32_quotactl)
+check_syscall_args(compat_50_netbsd32_quotactl)
struct compat_43_netbsd32_ogetsockname_args {
syscallarg(int) fdec;
@@ -2303,6 +2303,12 @@ struct netbsd32___fhstat50_args {
};
check_syscall_args(netbsd32___fhstat50)
+struct netbsd32___quotactl50_args {
+ syscallarg(const netbsd32_charp) path;
+ syscallarg(netbsd32_voidp) pref;
+};
+check_syscall_args(netbsd32___quotactl50)
+
/*
* System call prototypes.
*/
@@ -2581,7 +2587,7 @@ int compat_43_netbsd32_killpg(struct lwp *, const struct compat_43_netbsd32_kill
int sys_setsid(struct lwp *, const void *, register_t *);
-int netbsd32_quotactl(struct lwp *, const struct netbsd32_quotactl_args *, register_t *);
+int compat_50_netbsd32_quotactl(struct lwp *, const struct compat_50_netbsd32_quotactl_args *, register_t *);
int compat_43_sys_quota(struct lwp *, const void *, register_t *);
@@ -3079,4 +3085,6 @@ int netbsd32___mknod50(struct lwp *, const struct netbsd32___mknod50_args *, reg
int netbsd32___fhstat50(struct lwp *, const struct netbsd32___fhstat50_args *, register_t *);
+int netbsd32___quotactl50(struct lwp *, const struct netbsd32___quotactl50_args *, register_t *);
+
#endif /* _NETBSD32_SYS_SYSCALLARGS_H_ */
diff --git a/sys/compat/netbsd32/netbsd32_syscalls.c b/sys/compat/netbsd32/netbsd32_syscalls.c
index 4993c625e62..9529c75a969 100644
--- a/sys/compat/netbsd32/netbsd32_syscalls.c
+++ b/sys/compat/netbsd32/netbsd32_syscalls.c
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.91 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.92 2011/03/06 17:08:34 bouyer Exp $ */
/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.84 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.84.6.2 2011/02/09 16:09:55 bouyer Exp
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.91 2010/03/02 21:14:44 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.92 2011/03/06 17:08:34 bouyer Exp $");
#if defined(_KERNEL_OPT)
#if defined(_KERNEL_OPT)
@@ -176,7 +176,7 @@ const char *const netbsd32_syscallnames[] = {
/* 145 */ "compat_43_netbsd32_osetrlimit",
/* 146 */ "compat_43_netbsd32_killpg",
/* 147 */ "setsid",
- /* 148 */ "netbsd32_quotactl",
+ /* 148 */ "compat_50_netbsd32_quotactl",
/* 149 */ "compat_43_oquota",
/* 150 */ "compat_43_netbsd32_ogetsockname",
/* 151 */ "#151 (unimplemented)",
@@ -563,4 +563,64 @@ const char *const netbsd32_syscallnames[] = {
/* 449 */ "netbsd32___wait450",
/* 450 */ "netbsd32___mknod50",
/* 451 */ "netbsd32___fhstat50",
+ /* 452 */ "netbsd32___quotactl50",
+ /* 453 */ "# filler",
+ /* 454 */ "# filler",
+ /* 455 */ "# filler",
+ /* 456 */ "# filler",
+ /* 457 */ "# filler",
+ /* 458 */ "# filler",
+ /* 459 */ "# filler",
+ /* 460 */ "# filler",
+ /* 461 */ "# filler",
+ /* 462 */ "# filler",
+ /* 463 */ "# filler",
+ /* 464 */ "# filler",
+ /* 465 */ "# filler",
+ /* 466 */ "# filler",
+ /* 467 */ "# filler",
+ /* 468 */ "# filler",
+ /* 469 */ "# filler",
+ /* 470 */ "# filler",
+ /* 471 */ "# filler",
+ /* 472 */ "# filler",
+ /* 473 */ "# filler",
+ /* 474 */ "# filler",
+ /* 475 */ "# filler",
+ /* 476 */ "# filler",
+ /* 477 */ "# filler",
+ /* 478 */ "# filler",
+ /* 479 */ "# filler",
+ /* 480 */ "# filler",
+ /* 481 */ "# filler",
+ /* 482 */ "# filler",
+ /* 483 */ "# filler",
+ /* 484 */ "# filler",
+ /* 485 */ "# filler",
+ /* 486 */ "# filler",
+ /* 487 */ "# filler",
+ /* 488 */ "# filler",
+ /* 489 */ "# filler",
+ /* 490 */ "# filler",
+ /* 491 */ "# filler",
+ /* 492 */ "# filler",
+ /* 493 */ "# filler",
+ /* 494 */ "# filler",
+ /* 495 */ "# filler",
+ /* 496 */ "# filler",
+ /* 497 */ "# filler",
+ /* 498 */ "# filler",
+ /* 499 */ "# filler",
+ /* 500 */ "# filler",
+ /* 501 */ "# filler",
+ /* 502 */ "# filler",
+ /* 503 */ "# filler",
+ /* 504 */ "# filler",
+ /* 505 */ "# filler",
+ /* 506 */ "# filler",
+ /* 507 */ "# filler",
+ /* 508 */ "# filler",
+ /* 509 */ "# filler",
+ /* 510 */ "# filler",
+ /* 511 */ "# filler",
};
diff --git a/sys/compat/netbsd32/netbsd32_sysent.c b/sys/compat/netbsd32/netbsd32_sysent.c
index ff8c4bae8c5..d5df1e6accb 100644
--- a/sys/compat/netbsd32/netbsd32_sysent.c
+++ b/sys/compat/netbsd32/netbsd32_sysent.c
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.91 2010/03/02 21:14:44 pooka Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 1.92 2011/03/06 17:08:35 bouyer Exp $ */
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.84 2010/03/02 21:07:21 pooka Exp
+ * created from NetBSD: syscalls.master,v 1.84.6.2 2011/02/09 16:09:55 bouyer Exp
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.91 2010/03/02 21:14:44 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.92 2011/03/06 17:08:35 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -404,8 +404,8 @@ struct sysent netbsd32_sysent[] = {
(sy_call_t *)compat_43(netbsd32_killpg) },/* 146 = compat_43_netbsd32_killpg */
{ 0, 0, 0,
(sy_call_t *)sys_setsid }, /* 147 = setsid */
- { ns(struct netbsd32_quotactl_args), 0,
- (sy_call_t *)netbsd32_quotactl }, /* 148 = netbsd32_quotactl */
+ { ns(struct compat_50_netbsd32_quotactl_args), 0,
+ (sy_call_t *)compat_50(netbsd32_quotactl) },/* 148 = compat_50_netbsd32_quotactl */
{ 0, 0, 0,
(sy_call_t *)compat_43(sys_quota) },/* 149 = compat_43_oquota */
{ ns(struct compat_43_netbsd32_ogetsockname_args), 0,
@@ -1130,8 +1130,8 @@ struct sysent netbsd32_sysent[] = {
(sy_call_t *)netbsd32___mknod50 }, /* 450 = netbsd32___mknod50 */
{ ns(struct netbsd32___fhstat50_args), 0,
(sy_call_t *)netbsd32___fhstat50 }, /* 451 = netbsd32___fhstat50 */
- { 0, 0, 0,
- sys_nosys }, /* 452 = filler */
+ { ns(struct netbsd32___quotactl50_args), 0,
+ (sy_call_t *)netbsd32___quotactl50 },/* 452 = netbsd32___quotactl50 */
{ 0, 0, 0,
sys_nosys }, /* 453 = filler */
{ 0, 0, 0,
diff --git a/sys/compat/netbsd32/syscalls.master b/sys/compat/netbsd32/syscalls.master
index b94bc990754..bc0c2e86e02 100644
--- a/sys/compat/netbsd32/syscalls.master
+++ b/sys/compat/netbsd32/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.84 2010/03/02 21:07:21 pooka Exp $
+ $NetBSD: syscalls.master,v 1.85 2011/03/06 17:08:35 bouyer Exp $
; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -304,7 +304,7 @@
netbsd32_orlimitp_t rlp); }
146 COMPAT_43 { int|netbsd32||killpg(int pgid, int signum); }
147 NOARGS { int|sys||setsid(void); }
-148 STD { int|netbsd32||quotactl(netbsd32_charp path, int cmd, \
+148 COMPAT_50 { int|netbsd32||quotactl(netbsd32_charp path, int cmd, \
int uid, netbsd32_voidp arg); }
149 COMPAT_43 { int|sys||quota(void); } oquota
150 COMPAT_43 { int|netbsd32||ogetsockname(int fdec, \
@@ -969,3 +969,5 @@
mode_t mode, netbsd32_dev_t dev); }
451 STD { int|netbsd32|50|fhstat(const netbsd32_voidp fhp, \
netbsd32_size_t fh_size, netbsd32_statp_t sb); }
+452 STD { int|netbsd32|50|quotactl(const netbsd32_charp path, \
+ netbsd32_voidp pref); }
diff --git a/sys/conf/files b/sys/conf/files
index 7a1d9d508e4..8c7b440268c 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1003 2011/02/26 18:07:30 ahoka Exp $
+# $NetBSD: files,v 1.1004 2011/03/06 17:08:35 bouyer Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20100430
@@ -225,7 +225,7 @@ defparam SB_MAX
# file system options
#
-defflag QUOTA # XXX files.ufs?
+defflag opt_quota.h QUOTA QUOTA2 # XXX files.ufs?
defflag VNODE_LOCKDEBUG
defflag MAGICLINKS
diff --git a/sys/fs/unionfs/unionfs_vfsops.c b/sys/fs/unionfs/unionfs_vfsops.c
index 0a9209b788d..a87a491821b 100644
--- a/sys/fs/unionfs/unionfs_vfsops.c
+++ b/sys/fs/unionfs/unionfs_vfsops.c
@@ -371,7 +371,7 @@ unionfs_root(struct mount *mp, struct vnode **vpp)
}
int
-unionfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg)
+unionfs_quotactl(struct mount *mp, prop_dictionary_t dict)
{
struct unionfs_mount *ump;
@@ -380,7 +380,7 @@ unionfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg)
/*
* Writing is always performed to upper vnode.
*/
- return (VFS_QUOTACTL(ump->um_uppervp->v_mount, cmd, uid, arg));
+ return (VFS_QUOTACTL(ump->um_uppervp->v_mount, dict));
}
int
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index 1880dbcc4c2..bc07133e971 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -1,14 +1,14 @@
-/* $NetBSD: init_sysent.c,v 1.253 2011/02/21 23:31:00 pooka Exp $ */
+/* $NetBSD: init_sysent.c,v 1.254 2011/03/06 17:08:36 bouyer Exp $ */
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
+ * created from NetBSD
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.253 2011/02/21 23:31:00 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.254 2011/03/06 17:08:36 bouyer Exp $");
#include "opt_modular.h"
#include "opt_ntp.h"
@@ -399,8 +399,8 @@ struct sysent sysent[] = {
(sy_call_t *)sys_nomodule }, /* 146 = compat_43_okillpg */
{ 0, 0, 0,
(sy_call_t *)sys_setsid }, /* 147 = setsid */
- { ns(struct sys_quotactl_args), 0,
- (sy_call_t *)sys_quotactl }, /* 148 = quotactl */
+ { ns(struct compat_50_sys_quotactl_args), 0,
+ (sy_call_t *)sys_nomodule }, /* 148 = compat_50_quotactl */
{ 0, 0, 0,
(sy_call_t *)sys_nomodule }, /* 149 = compat_43_oquota */
{ ns(struct compat_43_sys_getsockname_args), 0,
@@ -1095,8 +1095,8 @@ struct sysent sysent[] = {
(sy_call_t *)sys___mknod50 }, /* 450 = __mknod50 */
{ ns(struct sys___fhstat50_args), 0,
(sy_call_t *)sys___fhstat50 }, /* 451 = __fhstat50 */
- { 0, 0, 0,
- sys_nosys }, /* 452 = filler */
+ { ns(struct sys___quotactl50_args), 0,
+ (sy_call_t *)sys___quotactl50 }, /* 452 = __quotactl50 */
{ 0, 0, 0,
sys_nosys }, /* 453 = filler */
{ 0, 0, 0,
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index 305cddaa185..1b4cb2e53f4 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -1,14 +1,14 @@
-/* $NetBSD: syscalls.c,v 1.244 2011/02/21 23:31:00 pooka Exp $ */
+/* $NetBSD: syscalls.c,v 1.245 2011/03/06 17:08:36 bouyer Exp $ */
/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
+ * created from NetBSD
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.244 2011/02/21 23:31:00 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.245 2011/03/06 17:08:36 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_modular.h"
@@ -171,7 +171,7 @@ const char *const syscallnames[] = {
/* 145 */ "compat_43_osetrlimit",
/* 146 */ "compat_43_okillpg",
/* 147 */ "setsid",
- /* 148 */ "quotactl",
+ /* 148 */ "compat_50_quotactl",
/* 149 */ "compat_43_oquota",
/* 150 */ "compat_43_ogetsockname",
/* 151 */ "#151 (unimplemented)",
@@ -540,7 +540,7 @@ const char *const syscallnames[] = {
/* 449 */ "__wait450",
/* 450 */ "__mknod50",
/* 451 */ "__fhstat50",
- /* 452 */ "# filler",
+ /* 452 */ "__quotactl50",
/* 453 */ "# filler",
/* 454 */ "# filler",
/* 455 */ "# filler",
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index c487f886361..d01b3852aa3 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp $
+ $NetBSD: syscalls.master,v 1.246 2011/03/06 17:08:36 bouyer Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -282,7 +282,7 @@
const struct orlimit *rlp); } osetrlimit
146 COMPAT_43 MODULAR { int|sys||killpg(int pgid, int signum); } okillpg
147 STD RUMP { int|sys||setsid(void); }
-148 STD { int|sys||quotactl(const char *path, int cmd, \
+148 COMPAT_50 MODULAR { int|sys||quotactl(const char *path, int cmd, \
int uid, void *arg); }
149 COMPAT_43 MODULAR { int|sys||quota(void); } oquota
150 COMPAT_43 MODULAR { int|sys||getsockname(int fdec, void *asa, \
@@ -884,3 +884,5 @@
dev_t dev); }
451 STD RUMP { int|sys|50|fhstat(const void *fhp, \
size_t fh_size, struct stat *sb); }
+452 STD RUMP { int|sys|50|quotactl(const char *path, \
+ struct plistref *pref); }
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index cb7bea9d8d8..1362a4c137d 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_subr.c,v 1.419 2011/02/17 19:04:03 matt Exp $ */
+/* $NetBSD: vfs_subr.c,v 1.420 2011/03/06 17:08:36 bouyer Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.419 2011/02/17 19:04:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.420 2011/03/06 17:08:36 bouyer Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -3018,14 +3018,14 @@ VFS_ROOT(struct mount *mp, struct vnode **a)
}
int
-VFS_QUOTACTL(struct mount *mp, int a, uid_t b, void *c)
+VFS_QUOTACTL(struct mount *mp, prop_dictionary_t dict)
{
int error;
if ((mp->mnt_iflag & IMNT_MPSAFE) == 0) {
KERNEL_LOCK(1, NULL);
}
- error = (*(mp->mnt_op->vfs_quotactl))(mp, a, b, c);
+ error = (*(mp->mnt_op->vfs_quotactl))(mp, dict);
if ((mp->mnt_iflag & IMNT_MPSAFE) == 0) {
KERNEL_UNLOCK_ONE(NULL);
}
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index c775d3d9ccd..cf19076a235 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls.c,v 1.417 2011/02/28 03:23:44 dholland Exp $ */
+/* $NetBSD: vfs_syscalls.c,v 1.418 2011/03/06 17:08:36 bouyer Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.417 2011/02/28 03:23:44 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.418 2011/03/06 17:08:36 bouyer Exp $");
#ifdef _KERNEL_OPT
#include "opt_fileassoc.h"
@@ -852,26 +852,37 @@ sys_sync(struct lwp *l, const void *v, register_t *retval)
*/
/* ARGSUSED */
int
-sys_quotactl(struct lwp *l, const struct sys_quotactl_args *uap, register_t *retval)
+sys___quotactl50(struct lwp *l, const struct sys___quotactl50_args *uap,
+ register_t *retval)
{
/* {
syscallarg(const char *) path;
- syscallarg(int) cmd;
- syscallarg(int) uid;
- syscallarg(void *) arg;
+ syscallarg(struct plistref *) pref;
} */
struct mount *mp;
int error;
struct vnode *vp;
+ prop_dictionary_t dict;
+ struct plistref pref;
error = namei_simple_user(SCARG(uap, path),
NSM_FOLLOW_TRYEMULROOT, &vp);
if (error != 0)
return (error);
mp = vp->v_mount;
- error = VFS_QUOTACTL(mp, SCARG(uap, cmd), SCARG(uap, uid),
- SCARG(uap, arg));
+ error = copyin(SCARG(uap, pref), &pref, sizeof(pref));
+ if (error)
+ return error;
+ error = prop_dictionary_copyin(&pref, &dict);
+ if (error)
+ return error;
+ error = VFS_QUOTACTL(mp, dict);
vrele(vp);
+ if (!error)
+ error = prop_dictionary_copyout(&pref, dict);
+ if (!error)
+ error = copyout(&pref, SCARG(uap, pref), sizeof(pref));
+ prop_object_release(dict);
return (error);
}
diff --git a/sys/kern/vnode_if.c b/sys/kern/vnode_if.c
index 527111d2e7e..a20e2d474c8 100644
--- a/sys/kern/vnode_if.c
+++ b/sys/kern/vnode_if.c
@@ -1,11 +1,11 @@
-/* $NetBSD: vnode_if.c,v 1.85 2010/06/24 13:03:12 hannken Exp $ */
+/* $NetBSD: vnode_if.c,v 1.86 2011/03/06 17:08:36 bouyer Exp $ */
/*
* Warning: DO NOT EDIT! This file is automatically generated!
* (Modifications made here may easily be lost!)
*
* Created from the file:
- * NetBSD: vnode_if.src,v 1.59 2010/06/24 12:58:48 hannken Exp
+ * NetBSD: vnode_if.src,v 1.60 2011/01/02 06:58:45 dholland Exp
* by the script:
* NetBSD: vnode_if.sh,v 1.56 2010/04/14 13:58:51 pooka Exp
*/
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.85 2010/06/24 13:03:12 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.86 2011/03/06 17:08:36 bouyer Exp $");
#include <sys/param.h>
#include <sys/mount.h>
diff --git a/sys/miscfs/genfs/layer_extern.h b/sys/miscfs/genfs/layer_extern.h
index 1af4d4a0274..c446f295091 100644
--- a/sys/miscfs/genfs/layer_extern.h
+++ b/sys/miscfs/genfs/layer_extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: layer_extern.h,v 1.27 2011/01/10 11:11:03 hannken Exp $ */
+/* $NetBSD: layer_extern.h,v 1.28 2011/03/06 17:08:36 bouyer Exp $ */
/*
* Copyright (c) 1999 National Aeronautics & Space Administration
@@ -88,7 +88,7 @@ struct vnode *layer_node_find(struct mount *, struct vnode *);
/* VFS routines */
int layerfs_start(struct mount *, int);
int layerfs_root(struct mount *, struct vnode **);
-int layerfs_quotactl(struct mount *, int, uid_t, void *);
+int layerfs_quotactl(struct mount *, prop_dictionary_t);
int layerfs_statvfs(struct mount *, struct statvfs *);
int layerfs_sync(struct mount *, int, struct kauth_cred *);
int layerfs_vget(struct mount *, ino_t, struct vnode **);
diff --git a/sys/miscfs/genfs/layer_vfsops.c b/sys/miscfs/genfs/layer_vfsops.c
index ce5fc5b910a..6b9bc5cf11d 100644
--- a/sys/miscfs/genfs/layer_vfsops.c
+++ b/sys/miscfs/genfs/layer_vfsops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: layer_vfsops.c,v 1.33 2010/07/02 03:16:01 rmind Exp $ */
+/* $NetBSD: layer_vfsops.c,v 1.34 2011/03/06 17:08:36 bouyer Exp $ */
/*
* Copyright (c) 1999 National Aeronautics & Space Administration
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: layer_vfsops.c,v 1.33 2010/07/02 03:16:01 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: layer_vfsops.c,v 1.34 2011/03/06 17:08:36 bouyer Exp $");
#include <sys/param.h>
#include <sys/sysctl.h>
@@ -141,10 +141,10 @@ layerfs_root(struct mount *mp, struct vnode **vpp)
}
int
-layerfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg)
+layerfs_quotactl(struct mount *mp, prop_dictionary_t dict)
{
- return VFS_QUOTACTL(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, cmd, uid, arg);
+ return VFS_QUOTACTL(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, dict);
}
int
diff --git a/sys/modules/ffs/Makefile b/sys/modules/ffs/Makefile
index 3f9750e574e..cf8b21275d0 100644
--- a/sys/modules/ffs/Makefile
+++ b/sys/modules/ffs/Makefile
@@ -1,15 +1,16 @@
-# $NetBSD: Makefile,v 1.4 2010/03/03 00:01:20 pooka Exp $
+# $NetBSD: Makefile,v 1.5 2011/03/06 17:08:36 bouyer Exp $
.include "../Makefile.inc"
.PATH: ${S}/ufs/ffs
KMOD= ffs
-CPPFLAGS+= -DUFS_DIRHASH -DFFS_EI -DWAPBL -DAPPLE_UFS -DQUOTA
+CPPFLAGS+= -DUFS_DIRHASH -DFFS_EI -DWAPBL -DAPPLE_UFS -DQUOTA -DQUOTA2
.PATH: ${S}/ufs/ufs
SRCS= ufs_bmap.c ufs_dirhash.c ufs_extattr.c ufs_ihash.c ufs_inode.c \
- ufs_lookup.c ufs_quota.c ufs_vfsops.c ufs_vnops.c ufs_wapbl.c
+ ufs_lookup.c ufs_quota.c ufs_quota1.c ufs_quota2.c ufs_vfsops.c \
+ ufs_vnops.c ufs_wapbl.c
.PATH: ${S}/ufs/ffs
SRCS+= ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_subr.c ffs_tables.c \
diff --git a/sys/rump/fs/lib/libffs/Makefile b/sys/rump/fs/lib/libffs/Makefile
index 6ed78cb9be9..3b2eb5ee191 100644
--- a/sys/rump/fs/lib/libffs/Makefile
+++ b/sys/rump/fs/lib/libffs/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2010/05/20 18:23:59 pooka Exp $
+# $NetBSD: Makefile,v 1.13 2011/03/06 17:08:37 bouyer Exp $
#
.PATH: ${.CURDIR}/../../../../ufs/ffs ${.CURDIR}/../../../../ufs/ufs
@@ -7,12 +7,14 @@ LIB= rumpfs_ffs
SRCS= ffs_alloc.c ffs_appleufs.c ffs_balloc.c ffs_bswap.c ffs_inode.c \
ffs_snapshot.c ffs_subr.c ffs_tables.c ffs_vfsops.c ffs_vnops.c \
- ffs_wapbl.c
+ ffs_wapbl.c ffs_quota2.c
SRCS+= ufs_bmap.c ufs_dirhash.c ufs_extattr.c ufs_ihash.c ufs_inode.c \
- ufs_lookup.c ufs_vfsops.c ufs_vnops.c ufs_wapbl.c
+ ufs_lookup.c ufs_vfsops.c ufs_vnops.c ufs_wapbl.c \
+ ufs_quota.c ufs_quota2.c quota2_subr.c
-CPPFLAGS+= -DFFS_EI -DUFS_DIRHASH -DWAPBL -DAPPLE_UFS -DUFS_EXTATTR
+CPPFLAGS+= -DFFS_EI -DUFS_DIRHASH -DWAPBL -DAPPLE_UFS -DUFS_EXTATTR \
+ -DQUOTA2
.include <bsd.lib.mk>
.include <bsd.klinks.mk>
diff --git a/sys/rump/include/rump/rump_syscalls.h b/sys/rump/include/rump/rump_syscalls.h
index 3f6c168346a..31be1b82035 100644
--- a/sys/rump/include/rump/rump_syscalls.h
+++ b/sys/rump/include/rump/rump_syscalls.h
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_syscalls.h,v 1.47 2011/02/22 14:09:35 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.48 2011/03/06 17:08:37 bouyer Exp $ */
/*
* System call protos in rump namespace.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
+ * created from NetBSD
*/
#ifndef _RUMP_RUMP_SYSCALLS_H_
@@ -569,6 +569,10 @@
#define RUMP_SYS_RENAME___SETLOGIN rump___sysimpl___setlogin
#endif
+#ifndef RUMP_SYS_RENAME_QUOTACTL
+#define RUMP_SYS_RENAME_QUOTACTL rump___sysimpl_quotactl50
+#endif
+
#ifndef RUMP_SYS_RENAME_SOCKET
#define RUMP_SYS_RENAME_SOCKET rump___sysimpl_socket30
#endif
@@ -631,6 +635,7 @@ struct kevent;
struct timespec;
struct statvfs;
struct stat;
+struct plistref;
ssize_t rump_sys_read(int, void *, size_t) __RENAME(RUMP_SYS_RENAME_READ);
ssize_t rump_sys_write(int, const void *, size_t) __RENAME(RUMP_SYS_RENAME_WRITE);
@@ -782,6 +787,7 @@ int rump_sys_fhstatvfs1(const void *, size_t, struct statvfs *, int) __RENAME(RU
int rump_sys_fhstat(const void *, size_t, struct stat *) __RENAME(RUMP_SYS_RENAME_FHSTAT);
int rump_sys_mount(const char *, const char *, int, void *, size_t) __RENAME(RUMP_SYS_RENAME_MOUNT);
int rump_sys_posix_fadvise(int, off_t, off_t, int) __RENAME(RUMP_SYS_RENAME_POSIX_FADVISE);
+int rump_sys_quotactl(const char *, struct plistref *) __RENAME(RUMP_SYS_RENAME_QUOTACTL);
int rump_sys_pipe(int *);
#endif /* _RUMP_RUMP_SYSCALLS_H_ */
diff --git a/sys/rump/include/rump/rumpvnode_if.h b/sys/rump/include/rump/rumpvnode_if.h
index 21ac060137a..d08ee488bcc 100644
--- a/sys/rump/include/rump/rumpvnode_if.h
+++ b/sys/rump/include/rump/rumpvnode_if.h
@@ -1,11 +1,11 @@
-/* $NetBSD: rumpvnode_if.h,v 1.8 2010/06/24 13:03:18 hannken Exp $ */
+/* $NetBSD: rumpvnode_if.h,v 1.9 2011/03/06 17:08:37 bouyer Exp $ */
/*
* Warning: DO NOT EDIT! This file is automatically generated!
* (Modifications made here may easily be lost!)
*
* Created from the file:
- * NetBSD: vnode_if.src,v 1.59 2010/06/24 12:58:48 hannken Exp
+ * NetBSD: vnode_if.src,v 1.60 2011/01/02 06:58:45 dholland Exp
* by the script:
* NetBSD: vnode_if.sh,v 1.56 2010/04/14 13:58:51 pooka Exp
*/
diff --git a/sys/rump/librump/rumpkern/rump_syscalls.c b/sys/rump/librump/rumpkern/rump_syscalls.c
index b3aaac93bf3..7499ce5d068 100644
--- a/sys/rump/librump/rumpkern/rump_syscalls.c
+++ b/sys/rump/librump/rumpkern/rump_syscalls.c
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_syscalls.c,v 1.69 2011/02/22 14:09:35 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.70 2011/03/06 17:08:37 bouyer Exp $ */
/*
* System call vector and marshalling for rump.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
+ * created from NetBSD
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.69 2011/02/22 14:09:35 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.70 2011/03/06 17:08:37 bouyer Exp $");
#include <sys/param.h>
#include <sys/fstypes.h>
@@ -3995,6 +3995,30 @@ rump___sysimpl_fhstat50(const void * fhp, size_t fh_size, struct stat * sb)
}
rsys_alias(sys___fhstat50,rump_enosys)
+int rump___sysimpl_quotactl50(const char *, struct plistref *);
+int
+rump___sysimpl_quotactl50(const char * path, struct plistref * pref)
+{
+ register_t retval[2] = {0, 0};
+ int error = 0;
+ int rv = -1;
+ struct sys___quotactl50_args callarg;
+
+ SPARG(&callarg, path) = path;
+ SPARG(&callarg, pref) = pref;
+
+ error = rsys_syscall(SYS___quotactl50, &callarg, sizeof(callarg), retval);
+ rsys_seterrno(error);
+ if (error == 0) {
+ if (sizeof(int) > sizeof(register_t))
+ rv = *(int *)retval;
+ else
+ rv = *retval;
+ }
+ return rv;
+}
+rsys_alias(sys___quotactl50,rump_enosys)
+
int rump_sys_pipe(int *);
int
rump_sys_pipe(int *fd)
@@ -4314,8 +4338,8 @@ struct sysent rump_sysent[] = {
(sy_call_t *)sys_nomodule }, /* 146 = okillpg */
{ 0, 0, 0,
(sy_call_t *)sys_setsid }, /* 147 = setsid */
- { 0, 0, SYCALL_NOSYS,
- (sy_call_t *)rump_enosys }, /* 148 = quotactl */
+ { 0, 0, 0,
+ (sy_call_t *)sys_nomodule }, /* 148 = quotactl */
{ 0, 0, 0,
(sy_call_t *)sys_nomodule }, /* 149 = oquota */
{ 0, 0, 0,
@@ -5010,8 +5034,8 @@ struct sysent rump_sysent[] = {
(sy_call_t *)sys___mknod50 }, /* 450 = __mknod50 */
{ ns(struct sys___fhstat50_args), 0,
(sy_call_t *)sys___fhstat50 }, /* 451 = __fhstat50 */
- { 0, 0, SYCALL_NOSYS,
- (sy_call_t *)rump_enosys }, /* 452 = filler */
+ { ns(struct sys___quotactl50_args), 0,
+ (sy_call_t *)sys___quotactl50 }, /* 452 = __quotactl50 */
{ 0, 0, SYCALL_NOSYS,
(sy_call_t *)rump_enosys }, /* 453 = filler */
{ 0, 0, SYCALL_NOSYS,
diff --git a/sys/rump/librump/rumpvfs/Makefile.rumpvfs b/sys/rump/librump/rumpvfs/Makefile.rumpvfs
index 71a58b62c73..f93432a6519 100644
--- a/sys/rump/librump/rumpvfs/Makefile.rumpvfs
+++ b/sys/rump/librump/rumpvfs/Makefile.rumpvfs
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.rumpvfs,v 1.28 2010/04/21 16:29:08 pooka Exp $
+# $NetBSD: Makefile.rumpvfs,v 1.29 2011/03/06 17:08:37 bouyer Exp $
#
.include "${RUMPTOP}/Makefile.rump"
@@ -10,7 +10,8 @@ LIB= rumpvfs
${RUMPTOP}/../miscfs/genfs ${RUMPTOP}/../miscfs/syncfs \
${RUMPTOP}/../miscfs/specfs ${RUMPTOP}/../miscfs/deadfs \
${RUMPTOP}/../compat/common ${RUMPTOP}/../uvm \
- ${RUMPTOP}/../dev ${RUMPTOP}/../ufs/mfs
+ ${RUMPTOP}/../dev ${RUMPTOP}/../ufs/mfs \
+ ${RUMPTOP}/../dev ${RUMPTOP}/../ufs/ufs
#
# Source modules, first the ones specifically implemented for librump.
@@ -49,6 +50,9 @@ SRCS+= subr_bufq.c bufq_disksort.c bufq_fcfs.c bufq_priocscan.c \
# MFS miniroot support
SRCS+= mfs_miniroot.c
+#quota2 plists
+SRCS+= quota1_subr.c quota2_prop.c
+
# dev
# firmload is technically part of rumpdev, but it's pure vfs in nature.
SRCS+= firmload.c
diff --git a/sys/rump/librump/rumpvfs/rumpvnode_if.c b/sys/rump/librump/rumpvfs/rumpvnode_if.c
index 94cc3787d41..04d56f1ecda 100644
--- a/sys/rump/librump/rumpvfs/rumpvnode_if.c
+++ b/sys/rump/librump/rumpvfs/rumpvnode_if.c
@@ -1,11 +1,11 @@
-/* $NetBSD: rumpvnode_if.c,v 1.7 2010/06/24 13:03:18 hannken Exp $ */
+/* $NetBSD: rumpvnode_if.c,v 1.8 2011/03/06 17:08:37 bouyer Exp $ */
/*
* Warning: DO NOT EDIT! This file is automatically generated!
* (Modifications made here may easily be lost!)
*
* Created from the file:
- * NetBSD: vnode_if.src,v 1.59 2010/06/24 12:58:48 hannken Exp
+ * NetBSD: vnode_if.src,v 1.60 2011/01/02 06:58:45 dholland Exp
* by the script:
* NetBSD: vnode_if.sh,v 1.56 2010/04/14 13:58:51 pooka Exp
*/
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.7 2010/06/24 13:03:18 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.8 2011/03/06 17:08:37 bouyer Exp $");
#include <sys/param.h>
#include <sys/mount.h>
diff --git a/sys/sys/Makefile b/sys/sys/Makefile
index 7fca862beb8..45a468538d5 100644
--- a/sys/sys/Makefile
+++ b/sys/sys/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.130 2011/02/26 18:07:32 ahoka Exp $
+# $NetBSD: Makefile,v 1.131 2011/03/06 17:08:38 bouyer Exp $
.include <bsd.sys.mk>
@@ -26,7 +26,7 @@ INCS= acct.h agpio.h aio.h ansi.h aout_mids.h ataio.h atomic.h audioio.h \
namei.h null.h \
param.h pcu.h pipe.h pmc.h poll.h pool.h power.h proc.h \
protosw.h pset.h ptrace.h ptree.h \
- queue.h \
+ queue.h quota.h \
ras.h rbtree.h reboot.h radioio.h resource.h resourcevar.h rmd160.h \
rnd.h rwlock.h sa.h satypes.h \
scanio.h sched.h scsiio.h sdt.h select.h selinfo.h sem.h sha1.h \
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index abd3cdf6418..d38de1cb26a 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mount.h,v 1.196 2010/05/30 02:26:37 dholland Exp $ */
+/* $NetBSD: mount.h,v 1.197 2011/03/06 17:08:38 bouyer Exp $ */
/*
* Copyright (c) 1989, 1991, 1993
@@ -189,6 +189,7 @@ struct mount {
}
#if defined(_KERNEL)
+#include <prop/proplib.h>
#if __STDC__
struct nameidata;
#endif
@@ -205,7 +206,7 @@ struct vfsops {
int (*vfs_start) (struct mount *, int);
int (*vfs_unmount) (struct mount *, int);
int (*vfs_root) (struct mount *, struct vnode **);
- int (*vfs_quotactl) (struct mount *, int, uid_t, void *);
+ int (*vfs_quotactl) (struct mount *, prop_dictionary_t);
int (*vfs_statvfs) (struct mount *, struct statvfs *);
int (*vfs_sync) (struct mount *, int, struct kauth_cred *);
int (*vfs_vget) (struct mount *, ino_t, struct vnode **);
@@ -240,7 +241,7 @@ int VFS_MOUNT(struct mount *, const char *, void *, size_t *);
int VFS_START(struct mount *, int);
int VFS_UNMOUNT(struct mount *, int);
int VFS_ROOT(struct mount *, struct vnode **);
-int VFS_QUOTACTL(struct mount *, int, uid_t, void *);
+int VFS_QUOTACTL(struct mount *, prop_dictionary_t);
int VFS_STATVFS(struct mount *, struct statvfs *);
int VFS_SYNC(struct mount *, int, struct kauth_cred *);
int VFS_FHTOVP(struct mount *, struct fid *, struct vnode **);
@@ -266,7 +267,7 @@ int fsname##_mount(struct mount *, const char *, void *, \
int fsname##_start(struct mount *, int); \
int fsname##_unmount(struct mount *, int); \
int fsname##_root(struct mount *, struct vnode **); \
-int fsname##_quotactl(struct mount *, int, uid_t, void *); \
+int fsname##_quotactl(struct mount *, prop_dictionary_t); \
int fsname##_statvfs(struct mount *, struct statvfs *); \
int fsname##_sync(struct mount *, int, struct kauth_cred *); \
int fsname##_vget(struct mount *, ino_t, struct vnode **); \
diff --git a/sys/sys/quota.h b/sys/sys/quota.h
new file mode 100644
index 00000000000..47560407b7a
--- /dev/null
+++ b/sys/sys/quota.h
@@ -0,0 +1,38 @@
+/* $NetBSD: quota.h,v 1.2 2011/03/06 17:08:38 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SYS_QUOTA_H_
+#define _SYS_QUOTA_H_
+
+#ifndef _KERNEL
+__BEGIN_DECLS
+int quotactl(const char *, struct plistref *) __RENAME(__quotactl50);
+__END_DECLS
+#endif
+#endif /* _SYS_QUOTA_H_ */
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index 8e2afc5e619..c31edc2f0b1 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stat.h,v 1.59 2009/08/27 07:28:42 mouse Exp $ */
+/* $NetBSD: stat.h,v 1.60 2011/03/06 17:08:38 bouyer Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -195,6 +195,7 @@ struct stat {
/* SF_NOUNLINK 0x00100000 [NOT IMPLEMENTED] */
#define SF_SNAPSHOT 0x00200000 /* snapshot inode */
#define SF_LOG 0x00400000 /* WAPBL log file inode */
+#define SF_SNAPINVAL 0x00800000 /* snapshot is invalid */
#ifdef _KERNEL
/*
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index 76d69778653..9838ca0a171 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -1,10 +1,10 @@
-/* $NetBSD: syscall.h,v 1.240 2011/02/21 23:31:01 pooka Exp $ */
+/* $NetBSD: syscall.h,v 1.241 2011/03/06 17:08:38 bouyer Exp $ */
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
+ * created from NetBSD
*/
#ifndef _SYS_SYSCALL_H_
@@ -432,8 +432,8 @@
/* syscall: "setsid" ret: "int" args: */
#define SYS_setsid 147
-/* syscall: "quotactl" ret: "int" args: "const char *" "int" "int" "void *" */
-#define SYS_quotactl 148
+/* syscall: "compat_50_quotactl" ret: "int" args: "const char *" "int" "int" "void *" */
+#define SYS_compat_50_quotactl 148
/* syscall: "compat_43_oquota" ret: "int" args: */
#define SYS_compat_43_oquota 149
@@ -1279,6 +1279,9 @@
/* syscall: "__fhstat50" ret: "int" args: "const void *" "size_t" "struct stat *" */
#define SYS___fhstat50 451
-#define SYS_MAXSYSCALL 452
+/* syscall: "__quotactl50" ret: "int" args: "const char *" "struct plistref *" */
+#define SYS___quotactl50 452
+
+#define SYS_MAXSYSCALL 453
#define SYS_NSYSENT 512
#endif /* _SYS_SYSCALL_H_ */
diff --git a/sys/sys/syscallargs.h b/sys/sys/syscallargs.h
index 781216d9cd5..1717156ea32 100644
--- a/sys/sys/syscallargs.h
+++ b/sys/sys/syscallargs.h
@@ -1,10 +1,10 @@
-/* $NetBSD: syscallargs.h,v 1.223 2011/02/21 23:31:01 pooka Exp $ */
+/* $NetBSD: syscallargs.h,v 1.224 2011/03/06 17:08:38 bouyer Exp $ */
/*
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from NetBSD: syscalls.master,v 1.245 2011/02/21 23:20:19 pooka Exp
+ * created from NetBSD
*/
#ifndef _SYS_SYSCALLARGS_H_
@@ -804,13 +804,13 @@ struct compat_43_sys_killpg_args {
};
check_syscall_args(compat_43_sys_killpg)
-struct sys_quotactl_args {
+struct compat_50_sys_quotactl_args {
syscallarg(const char *) path;
syscallarg(int) cmd;
syscallarg(int) uid;
syscallarg(void *) arg;
};
-check_syscall_args(sys_quotactl)
+check_syscall_args(compat_50_sys_quotactl)
struct compat_43_sys_getsockname_args {
syscallarg(int) fdec;
@@ -2531,6 +2531,12 @@ struct sys___fhstat50_args {
};
check_syscall_args(sys___fhstat50)
+struct sys___quotactl50_args {
+ syscallarg(const char *) path;
+ syscallarg(struct plistref *) pref;
+};
+check_syscall_args(sys___quotactl50)
+
/*
* System call prototypes.
*/
@@ -2809,7 +2815,7 @@ int compat_43_sys_killpg(struct lwp *, const struct compat_43_sys_killpg_args *,
int sys_setsid(struct lwp *, const void *, register_t *);
-int sys_quotactl(struct lwp *, const struct sys_quotactl_args *, register_t *);
+int compat_50_sys_quotactl(struct lwp *, const struct compat_50_sys_quotactl_args *, register_t *);
int compat_43_sys_quota(struct lwp *, const void *, register_t *);
@@ -3371,4 +3377,6 @@ int sys___mknod50(struct lwp *, const struct sys___mknod50_args *, register_t *)
int sys___fhstat50(struct lwp *, const struct sys___fhstat50_args *, register_t *);
+int sys___quotactl50(struct lwp *, const struct sys___quotactl50_args *, register_t *);
+
#endif /* _SYS_SYSCALLARGS_H_ */
diff --git a/sys/sys/vnode_if.h b/sys/sys/vnode_if.h
index da10ab22341..0768968fbfd 100644
--- a/sys/sys/vnode_if.h
+++ b/sys/sys/vnode_if.h
@@ -1,11 +1,11 @@
-/* $NetBSD: vnode_if.h,v 1.79 2010/06/24 13:03:18 hannken Exp $ */
+/* $NetBSD: vnode_if.h,v 1.80 2011/03/06 17:08:38 bouyer Exp $ */
/*
* Warning: DO NOT EDIT! This file is automatically generated!
* (Modifications made here may easily be lost!)
*
* Created from the file:
- * NetBSD: vnode_if.src,v 1.59 2010/06/24 12:58:48 hannken Exp
+ * NetBSD: vnode_if.src,v 1.60 2011/01/02 06:58:45 dholland Exp
* by the script:
* NetBSD: vnode_if.sh,v 1.56 2010/04/14 13:58:51 pooka Exp
*/
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 57c8caf8ef3..737b5cc3d3f 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_alloc.c,v 1.126 2011/03/06 04:46:26 rmind Exp $ */
+/* $NetBSD: ffs_alloc.c,v 1.127 2011/03/06 17:08:38 bouyer Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.126 2011/03/06 04:46:26 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.127 2011/03/06 17:08:38 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -174,7 +174,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, int flags,
struct fs *fs;
daddr_t bno;
int cg;
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
int error;
#endif
@@ -218,7 +218,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, int flags,
kauth_authorize_system(cred, KAUTH_SYSTEM_FS_RESERVEDSPACE, 0, NULL,
NULL, NULL) != 0)
goto nospace;
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
mutex_exit(&ump->um_lock);
if ((error = chkdq(ip, btodb(size), cred, 0)) != 0)
return (error);
@@ -238,7 +238,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, int flags,
*bnp = bno;
return (0);
}
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
/*
* Restore user's disk quota because allocation failed.
*/
@@ -348,7 +348,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize,
brelse(bp, 0);
return (error);
}
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
if ((error = chkdq(ip, btodb(nsize - osize), cred, 0)) != 0) {
if (bpp != NULL) {
brelse(bp, 0);
@@ -481,7 +481,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize,
}
mutex_exit(&ump->um_lock);
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
/*
* Restore user's disk quota because allocation failed.
*/
@@ -1979,100 +1979,6 @@ ffs_mapsearch(struct fs *fs, struct cg *cgp, daddr_t bpref, int allocsiz)
}
/*
- * Update the cluster map because of an allocation or free.
- *
- * Cnt == 1 means free; cnt == -1 means allocating.
- */
-void
-ffs_clusteracct(struct fs *fs, struct cg *cgp, int32_t blkno, int cnt)
-{
- int32_t *sump;
- int32_t *lp;
- u_char *freemapp, *mapp;
- int i, start, end, forw, back, map, bit;
-#ifdef FFS_EI
- const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
-
- /* KASSERT(mutex_owned(&ump->um_lock)); */
-
- if (fs->fs_contigsumsize <= 0)
- return;
- freemapp = cg_clustersfree(cgp, needswap);
- sump = cg_clustersum(cgp, needswap);
- /*
- * Allocate or clear the actual block.
- */
- if (cnt > 0)
- setbit(freemapp, blkno);
- else
- clrbit(freemapp, blkno);
- /*
- * Find the size of the cluster going forward.
- */
- start = blkno + 1;
- end = start + fs->fs_contigsumsize;
- if (end >= ufs_rw32(cgp->cg_nclusterblks, needswap))
- end = ufs_rw32(cgp->cg_nclusterblks, needswap);
- mapp = &freemapp[start / NBBY];
- map = *mapp++;
- bit = 1 << (start % NBBY);
- for (i = start; i < end; i++) {
- if ((map & bit) == 0)
- break;
- if ((i & (NBBY - 1)) != (NBBY - 1)) {
- bit <<= 1;
- } else {
- map = *mapp++;
- bit = 1;
- }
- }
- forw = i - start;
- /*
- * Find the size of the cluster going backward.
- */
- start = blkno - 1;
- end = start - fs->fs_contigsumsize;
- if (end < 0)
- end = -1;
- mapp = &freemapp[start / NBBY];
- map = *mapp--;
- bit = 1 << (start % NBBY);
- for (i = start; i > end; i--) {
- if ((map & bit) == 0)
- break;
- if ((i & (NBBY - 1)) != 0) {
- bit >>= 1;
- } else {
- map = *mapp--;
- bit = 1 << (NBBY - 1);
- }
- }
- back = start - i;
- /*
- * Account for old cluster and the possibly new forward and
- * back clusters.
- */
- i = back + forw + 1;
- if (i > fs->fs_contigsumsize)
- i = fs->fs_contigsumsize;
- ufs_add32(sump[i], cnt, needswap);
- if (back > 0)
- ufs_add32(sump[back], -cnt, needswap);
- if (forw > 0)
- ufs_add32(sump[forw], -cnt, needswap);
-
- /*
- * Update cluster summary information.
- */
- lp = &sump[fs->fs_contigsumsize];
- for (i = fs->fs_contigsumsize; i > 0; i--)
- if (ufs_rw32(*lp--, needswap) > 0)
- break;
- fs->fs_maxcluster[ufs_rw32(cgp->cg_cgx, needswap)] = i;
-}
-
-/*
* Fserr prints the name of a file system with an error diagnostic.
*
* The form of the error message is:
diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c
index a64d7e599fc..b97dc23e3a8 100644
--- a/sys/ufs/ffs/ffs_balloc.c
+++ b/sys/ufs/ffs/ffs_balloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_balloc.c,v 1.52 2009/02/22 20:28:06 ad Exp $ */
+/* $NetBSD: ffs_balloc.c,v 1.53 2011/03/06 17:08:38 bouyer Exp $ */
/*
* Copyright (c) 2002 Networks Associates Technology, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_balloc.c,v 1.52 2009/02/22 20:28:06 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_balloc.c,v 1.53 2011/03/06 17:08:38 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@@ -501,7 +501,7 @@ fail:
deallocated += fs->fs_bsize;
}
if (deallocated) {
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
/*
* Restore user's disk quota because allocation failed.
*/
@@ -1029,7 +1029,7 @@ fail:
deallocated += fs->fs_bsize;
}
if (deallocated) {
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
/*
* Restore user's disk quota because allocation failed.
*/
diff --git a/sys/ufs/ffs/ffs_bswap.c b/sys/ufs/ffs/ffs_bswap.c
index 20c385a0579..ddac30db09b 100644
--- a/sys/ufs/ffs/ffs_bswap.c
+++ b/sys/ufs/ffs/ffs_bswap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_bswap.c,v 1.34 2009/10/19 18:41:17 bouyer Exp $ */
+/* $NetBSD: ffs_bswap.c,v 1.35 2011/03/06 17:08:38 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@@ -30,7 +30,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_bswap.c,v 1.34 2009/10/19 18:41:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_bswap.c,v 1.35 2011/03/06 17:08:38 bouyer Exp $");
#include <sys/param.h>
#if defined(_KERNEL)
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: ffs_bswap.c,v 1.34 2009/10/19 18:41:17 bouyer Exp $"
#endif
#include <ufs/ufs/dinode.h>
+#include <ufs/ufs/quota.h>
#include <ufs/ufs/ufs_bswap.h>
#include <ufs/ffs/fs.h>
#include <ufs/ffs/ffs_extern.h>
@@ -75,6 +76,10 @@ ffs_sb_swap(struct fs *o, struct fs *n)
* first half of the historic FS_42POSTBLFMT postbl table.
*/
n->fs_maxbsize = bswap32(o->fs_maxbsize);
+ /* XXX journal */
+ n->fs_quota_magic = bswap32(o->fs_quota_magic);
+ for (i = 0; i < MAXQUOTAS; i++)
+ n->fs_quotafile[i] = bswap64(o->fs_quotafile[i]);
n->fs_sblockloc = bswap64(o->fs_sblockloc);
ffs_csumtotal_swap(&o->fs_cstotal, &n->fs_cstotal);
n->fs_time = bswap64(o->fs_time);
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index cad20e81768..8831905a1de 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_extern.h,v 1.75 2009/02/22 20:28:06 ad Exp $ */
+/* $NetBSD: ffs_extern.h,v 1.76 2011/03/06 17:08:38 bouyer Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -99,7 +99,6 @@ int ffs_blkalloc_ump(struct ufsmount *, daddr_t, long);
void ffs_blkfree(struct fs *, struct vnode *, daddr_t, long, ino_t);
void ffs_blkfree_snap(struct fs *, struct vnode *, daddr_t, long, ino_t);
int ffs_vfree(struct vnode *, ino_t, int);
-void ffs_clusteracct(struct fs *, struct cg *, int32_t, int);
int ffs_checkfreefile(struct fs *, struct vnode *, ino_t);
int ffs_freefile(struct mount *, ino_t, int);
int ffs_freefile_snap(struct fs *, struct vnode *, ino_t, int);
@@ -200,6 +199,10 @@ void ffs_clrblock(struct fs *, u_char *, int32_t);
void ffs_setblock(struct fs *, u_char *, int32_t);
void ffs_itimes(struct inode *, const struct timespec *,
const struct timespec *, const struct timespec *);
+void ffs_clusteracct(struct fs *, struct cg *, int32_t, int);
+
+/* ffs_quota2.c */
+int ffs_quota2_mount(struct mount *);
__END_DECLS
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index f7f0aa6e2df..243eac18bfb 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_inode.c,v 1.104 2010/02/07 17:12:40 bouyer Exp $ */
+/* $NetBSD: ffs_inode.c,v 1.105 2011/03/06 17:08:38 bouyer Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_inode.c,v 1.104 2010/02/07 17:12:40 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_inode.c,v 1.105 2011/03/06 17:08:38 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -519,7 +519,7 @@ done:
genfs_node_unlock(ovp);
oip->i_flag |= IN_CHANGE;
UFS_WAPBL_UPDATE(ovp, NULL, NULL, 0);
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
(void) chkdq(oip, -blocksreleased, NOCRED, 0);
#endif
KASSERT(ovp->v_type != VREG || ovp->v_size == oip->i_size);
diff --git a/sys/ufs/ffs/ffs_quota2.c b/sys/ufs/ffs/ffs_quota2.c
new file mode 100644
index 00000000000..e6c285bff8e
--- /dev/null
+++ b/sys/ufs/ffs/ffs_quota2.c
@@ -0,0 +1,120 @@
+/* $NetBSD: ffs_quota2.c,v 1.2 2011/03/06 17:08:38 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: ffs_quota2.c,v 1.2 2011/03/06 17:08:38 bouyer Exp $");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/namei.h>
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/vnode.h>
+#include <sys/mount.h>
+#include <sys/kauth.h>
+
+#include <ufs/ufs/quota2.h>
+#include <ufs/ufs/inode.h>
+#include <ufs/ufs/ufsmount.h>
+#include <ufs/ffs/ffs_extern.h>
+#include <ufs/ffs/fs.h>
+
+
+int
+ffs_quota2_mount(struct mount *mp)
+{
+ struct ufsmount *ump = VFSTOUFS(mp);
+ struct fs *fs = ump->um_fs;
+ int error = 0;
+ struct vnode *vp;
+ struct lwp *l = curlwp;
+
+ if ((fs->fs_flags & FS_DOQUOTA2) == 0)
+ return 0;
+
+ ump->um_flags |= UFS_QUOTA2;
+ ump->umq2_bsize = fs->fs_bsize;
+ ump->umq2_bmask = fs->fs_qbmask;
+ if (fs->fs_quota_magic != Q2_HEAD_MAGIC) {
+ printf("%s: Invalid quota magic number\n",
+ mp->mnt_stat.f_mntonname);
+ return EINVAL;
+ }
+ if ((fs->fs_quota_flags & FS_Q2_DO_TYPE(USRQUOTA)) &&
+ fs->fs_quotafile[USRQUOTA] == 0) {
+ printf("%s: no user quota inode\n",
+ mp->mnt_stat.f_mntonname);
+ error = EINVAL;
+ }
+ if ((fs->fs_quota_flags & FS_Q2_DO_TYPE(GRPQUOTA)) &&
+ fs->fs_quotafile[GRPQUOTA] == 0) {
+ printf("%s: no group quota inode\n",
+ mp->mnt_stat.f_mntonname);
+ error = EINVAL;
+ }
+ if (error)
+ return error;
+
+ if (fs->fs_quota_flags & FS_Q2_DO_TYPE(USRQUOTA) &&
+ ump->um_quotas[USRQUOTA] == NULLVP) {
+ error = VFS_VGET(mp, fs->fs_quotafile[USRQUOTA], &vp);
+ if (error) {
+ printf("%s: can't vget() user quota inode: %d\n",
+ mp->mnt_stat.f_mntonname, error);
+ return error;
+ }
+ ump->um_quotas[USRQUOTA] = vp;
+ ump->um_cred[USRQUOTA] = l->l_cred;
+ mutex_enter(&vp->v_interlock);
+ vp->v_writecount++;
+ mutex_exit(&vp->v_interlock);
+ VOP_UNLOCK(vp);
+ }
+ if (fs->fs_quota_flags & FS_Q2_DO_TYPE(GRPQUOTA) &&
+ ump->um_quotas[GRPQUOTA] == NULLVP) {
+ error = VFS_VGET(mp, fs->fs_quotafile[GRPQUOTA], &vp);
+ if (error) {
+ vn_close(ump->um_quotas[USRQUOTA],
+ FREAD|FWRITE, l->l_cred);
+ printf("%s: can't vget() group quota inode: %d\n",
+ mp->mnt_stat.f_mntonname, error);
+ return error;
+ }
+ ump->um_quotas[GRPQUOTA] = vp;
+ ump->um_cred[GRPQUOTA] = l->l_cred;
+ mutex_enter(&vp->v_interlock);
+ vp->v_vflag |= VV_SYSTEM;
+ vp->v_writecount++;
+ mutex_exit(&vp->v_interlock);
+ VOP_UNLOCK(vp);
+ }
+ mp->mnt_flag |= MNT_QUOTA;
+ return 0;
+}
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 262f2fb0228..5ecc6279b2c 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_snapshot.c,v 1.110 2011/02/24 09:38:57 hannken Exp $ */
+/* $NetBSD: ffs_snapshot.c,v 1.111 2011/03/06 17:08:38 bouyer Exp $ */
/*
* Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,10 +38,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.110 2011/02/24 09:38:57 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.111 2011/03/06 17:08:38 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
+#include "opt_quota.h"
#endif
#include <sys/param.h>
@@ -196,7 +197,7 @@ ffs_snapshot(struct mount *mp, struct vnode *vp, struct timespec *ctime)
/*
* If the vnode already is a snapshot, return.
*/
- if (VTOI(vp)->i_flags & SF_SNAPSHOT) {
+ if ((VTOI(vp)->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL)) == SF_SNAPSHOT) {
if (ctime) {
ctime->tv_sec = DIP(VTOI(vp), mtime);
ctime->tv_nsec = DIP(VTOI(vp), mtimensec);
@@ -217,12 +218,7 @@ ffs_snapshot(struct mount *mp, struct vnode *vp, struct timespec *ctime)
error = snapshot_setup(mp, vp);
if (error)
goto out;
- /*
- * Change inode to snapshot type file.
- */
- ip->i_flags |= SF_SNAPSHOT;
- DIP_ASSIGN(ip, flags, ip->i_flags);
- ip->i_flag |= IN_CHANGE | IN_UPDATE;
+
/*
* Copy all the cylinder group maps. Although the
* filesystem is still active, we hope that only a few
@@ -234,6 +230,14 @@ ffs_snapshot(struct mount *mp, struct vnode *vp, struct timespec *ctime)
error = cgaccount(vp, 1, NULL);
if (error)
goto out;
+
+ /*
+ * snapshot is now valid
+ */
+ ip->i_flags &= ~SF_SNAPINVAL;
+ DIP_ASSIGN(ip, flags, ip->i_flags);
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
+
/*
* Ensure that the snapshot is completely on disk.
* Since we have marked it as a snapshot it is safe to
@@ -407,6 +411,7 @@ snapshot_setup(struct mount *mp, struct vnode *vp)
struct fs *fs = VFSTOUFS(mp)->um_fs;
struct lwp *l = curlwp;
const int wbreak = blocks_in_journal(fs)/8;
+ struct inode *ip = VTOI(vp);
/*
* Check mount, exclusive reference and owner.
@@ -425,6 +430,22 @@ snapshot_setup(struct mount *mp, struct vnode *vp)
if (error)
return error;
}
+
+ /* Change inode to snapshot type file. */
+ error = UFS_WAPBL_BEGIN(mp);
+ if (error)
+ return error;
+#if defined(QUOTA) || defined(QUOTA2)
+ /* shapshot inodes are not accounted in quotas */
+ chkiq(ip, -1, l->l_cred, 0);
+#endif
+ ip->i_flags |= (SF_SNAPSHOT | SF_SNAPINVAL);
+ DIP_ASSIGN(ip, flags, ip->i_flags);
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ ffs_update(vp, NULL, NULL, UPDATE_WAIT);
+ UFS_WAPBL_END(mp);
+
+ KASSERT(ip->i_flags & SF_SNAPSHOT);
/*
* Write an empty list of preallocated blocks to the end of
* the snapshot to set size to at least that of the filesystem.
@@ -1033,22 +1054,28 @@ expunge(struct vnode *snapvp, struct inode *cancelip, struct fs *fs,
if (fs->fs_magic == FS_UFS1_MAGIC) {
dip1 = (struct ufs1_dinode *)bp->b_data +
ino_to_fsbo(fs, cancelip->i_number);
+ if (cancelip->i_flags & SF_SNAPSHOT) {
+ dip1->di_flags =
+ ufs_rw32(ufs_rw32(dip1->di_flags, ns) |
+ SF_SNAPINVAL, ns);
+ }
if (expungetype == BLK_NOCOPY || cancelip->i_nlink == 0)
dip1->di_mode = 0;
dip1->di_size = 0;
dip1->di_blocks = 0;
- dip1->di_flags =
- ufs_rw32(ufs_rw32(dip1->di_flags, ns) & ~SF_SNAPSHOT, ns);
memset(&dip1->di_db[0], 0, (NDADDR + NIADDR) * sizeof(int32_t));
} else {
dip2 = (struct ufs2_dinode *)bp->b_data +
ino_to_fsbo(fs, cancelip->i_number);
+ if (cancelip->i_flags & SF_SNAPSHOT) {
+ dip2->di_flags =
+ ufs_rw32(ufs_rw32(dip2->di_flags, ns) |
+ SF_SNAPINVAL, ns);
+ }
if (expungetype == BLK_NOCOPY || cancelip->i_nlink == 0)
dip2->di_mode = 0;
dip2->di_size = 0;
dip2->di_blocks = 0;
- dip2->di_flags =
- ufs_rw32(ufs_rw32(dip2->di_flags, ns) & ~SF_SNAPSHOT, ns);
memset(&dip2->di_db[0], 0, (NDADDR + NIADDR) * sizeof(int64_t));
}
bdwrite(bp);
@@ -1458,9 +1485,13 @@ ffs_snapremove(struct vnode *vp)
/*
* Clear snapshot flag and drop reference.
*/
- ip->i_flags &= ~SF_SNAPSHOT;
+ ip->i_flags &= ~(SF_SNAPSHOT | SF_SNAPINVAL);
DIP_ASSIGN(ip, flags, ip->i_flags);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
+#if defined(QUOTA) || defined(QUOTA2)
+ chkdq(ip, DIP(ip, blocks), l->l_cred, FORCE);
+ chkiq(ip, 1, l->l_cred, FORCE);
+#endif
}
/*
@@ -1700,7 +1731,8 @@ ffs_snapshot_mount(struct mount *mp)
continue;
}
ip = VTOI(vp);
- if ((ip->i_flags & SF_SNAPSHOT) == 0) {
+ if ((ip->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL)) !=
+ SF_SNAPSHOT) {
printf("ffs_snapshot_mount: non-snapshot inode %d\n",
fs->fs_snapinum[snaploc]);
vput(vp);
diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c
index ced70d0f2b2..3451ec79e49 100644
--- a/sys/ufs/ffs/ffs_subr.c
+++ b/sys/ufs/ffs/ffs_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_subr.c,v 1.45 2008/06/03 09:47:49 hannken Exp $ */
+/* $NetBSD: ffs_subr.c,v 1.46 2011/03/06 17:08:38 bouyer Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -36,7 +36,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.45 2008/06/03 09:47:49 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.46 2011/03/06 17:08:38 bouyer Exp $");
#include <sys/param.h>
@@ -44,6 +44,9 @@ __KERNEL_RCSID(0, "$NetBSD: ffs_subr.c,v 1.45 2008/06/03 09:47:49 hannken Exp $"
extern const int inside[], around[];
extern const u_char * const fragtbl[];
+#ifndef _KERNEL
+#define FFS_EI /* always include byteswapped filesystems support */
+#endif
#include <ufs/ffs/fs.h>
#include <ufs/ffs/ffs_extern.h>
#include <ufs/ufs/ufs_bswap.h>
@@ -270,3 +273,99 @@ ffs_setblock(struct fs *fs, u_char *cp, int32_t h)
(int)fs->fs_fragshift);
}
}
+
+/*
+ * Update the cluster map because of an allocation or free.
+ *
+ * Cnt == 1 means free; cnt == -1 means allocating.
+ */
+void
+ffs_clusteracct(struct fs *fs, struct cg *cgp, int32_t blkno, int cnt)
+{
+ int32_t *sump;
+ int32_t *lp;
+ u_char *freemapp, *mapp;
+ int i, start, end, forw, back, map, bit;
+#ifdef FFS_EI
+ const int needswap = UFS_FSNEEDSWAP(fs);
+#endif
+
+ /* KASSERT(mutex_owned(&ump->um_lock)); */
+
+ if (fs->fs_contigsumsize <= 0)
+ return;
+ freemapp = cg_clustersfree(cgp, needswap);
+ sump = cg_clustersum(cgp, needswap);
+ /*
+ * Allocate or clear the actual block.
+ */
+ if (cnt > 0)
+ setbit(freemapp, blkno);
+ else
+ clrbit(freemapp, blkno);
+ /*
+ * Find the size of the cluster going forward.
+ */
+ start = blkno + 1;
+ end = start + fs->fs_contigsumsize;
+ if (end >= ufs_rw32(cgp->cg_nclusterblks, needswap))
+ end = ufs_rw32(cgp->cg_nclusterblks, needswap);
+ mapp = &freemapp[start / NBBY];
+ map = *mapp++;
+ bit = 1 << (start % NBBY);
+ for (i = start; i < end; i++) {
+ if ((map & bit) == 0)
+ break;
+ if ((i & (NBBY - 1)) != (NBBY - 1)) {
+ bit <<= 1;
+ } else {
+ map = *mapp++;
+ bit = 1;
+ }
+ }
+ forw = i - start;
+ /*
+ * Find the size of the cluster going backward.
+ */
+ start = blkno - 1;
+ end = start - fs->fs_contigsumsize;
+ if (end < 0)
+ end = -1;
+ mapp = &freemapp[start / NBBY];
+ map = *mapp--;
+ bit = 1 << (start % NBBY);
+ for (i = start; i > end; i--) {
+ if ((map & bit) == 0)
+ break;
+ if ((i & (NBBY - 1)) != 0) {
+ bit >>= 1;
+ } else {
+ map = *mapp--;
+ bit = 1 << (NBBY - 1);
+ }
+ }
+ back = start - i;
+ /*
+ * Account for old cluster and the possibly new forward and
+ * back clusters.
+ */
+ i = back + forw + 1;
+ if (i > fs->fs_contigsumsize)
+ i = fs->fs_contigsumsize;
+ ufs_add32(sump[i], cnt, needswap);
+ if (back > 0)
+ ufs_add32(sump[back], -cnt, needswap);
+ if (forw > 0)
+ ufs_add32(sump[forw], -cnt, needswap);
+
+ /*
+ * Update cluster summary information.
+ */
+ lp = &sump[fs->fs_contigsumsize];
+ for (i = fs->fs_contigsumsize; i > 0; i--)
+ if (ufs_rw32(*lp--, needswap) > 0)
+ break;
+#if defined(_KERNEL)
+ fs->fs_maxcluster[ufs_rw32(cgp->cg_cgx, needswap)] = i;
+#endif
+}
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index f3e7c22317a..bad74352af1 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.263 2010/12/27 18:49:42 hannken Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.264 2011/03/06 17:08:38 bouyer Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.263 2010/12/27 18:49:42 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.264 2011/03/06 17:08:38 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -492,6 +492,16 @@ ffs_mount(struct mount *mp, const char *path, void *data, size_t *data_len)
/*
* Changing from read-only to read/write
*/
+#ifndef QUOTA2
+ if (fs->fs_flags & FS_DOQUOTA2) {
+ ump->um_flags |= UFS_QUOTA2;
+ uprintf("%s: options QUOTA2 not enabled%s\n",
+ mp->mnt_stat.f_mntonname,
+ (mp->mnt_flag & MNT_FORCE) ? "" :
+ ", not mounting");
+ return EINVAL;
+ }
+#endif
fs->fs_ronly = 0;
fs->fs_clean <<= 1;
fs->fs_fmod = 1;
@@ -519,6 +529,14 @@ ffs_mount(struct mount *mp, const char *path, void *data, size_t *data_len)
return error;
#endif /* WAPBL */
+#ifdef QUOTA2
+ if (!fs->fs_ronly) {
+ error = ffs_quota2_mount(mp);
+ if (error) {
+ return error;
+ }
+ }
+#endif
if (args->fspec == NULL)
return 0;
}
@@ -1196,7 +1214,6 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l)
devvp->v_specmountpoint = mp;
if (ronly == 0 && fs->fs_snapinum[0] != 0)
ffs_snapshot_mount(mp);
-
#ifdef WAPBL
if (!ronly) {
KDASSERT(fs->fs_ronly == 0);
@@ -1213,6 +1230,28 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l)
}
}
#endif /* WAPBL */
+ if (ronly == 0) {
+#ifdef QUOTA2
+ error = ffs_quota2_mount(mp);
+ if (error) {
+ free(fs->fs_csp, M_UFSMNT);
+ goto out;
+ }
+#else
+ if (fs->fs_flags & FS_DOQUOTA2) {
+ ump->um_flags |= UFS_QUOTA2;
+ uprintf("%s: options QUOTA2 not enabled%s\n",
+ mp->mnt_stat.f_mntonname,
+ (mp->mnt_flag & MNT_FORCE) ? "" : ", not mounting");
+ if ((mp->mnt_flag & MNT_FORCE) == 0) {
+ error = EINVAL;
+ free(fs->fs_csp, M_UFSMNT);
+ goto out;
+ }
+ }
+#endif
+ }
+
#ifdef UFS_EXTATTR
/*
* Initialize file-backed extended attributes on UFS1 file
@@ -1453,20 +1492,12 @@ ffs_flushfiles(struct mount *mp, int flags, struct lwp *l)
flags &= ~FORCECLOSE;
ump = VFSTOUFS(mp);
#ifdef QUOTA
- if (mp->mnt_flag & MNT_QUOTA) {
- int i;
- if ((error = vflush(mp, NULLVP, SKIPSYSTEM | flags)) != 0)
- return (error);
- for (i = 0; i < MAXQUOTAS; i++) {
- if (ump->um_quotas[i] == NULLVP)
- continue;
- quotaoff(l, mp, i);
- }
- /*
- * Here we fall through to vflush again to ensure
- * that we have gotten rid of all the system vnodes.
- */
- }
+ if ((error = quota1_umount(mp, flags)) != 0)
+ return (error);
+#endif
+#ifdef QUOTA2
+ if ((error = quota2_umount(mp, flags)) != 0)
+ return (error);
#endif
if ((error = vflush(mp, 0, SKIPSYSTEM | flags)) != 0)
return (error);
@@ -1667,7 +1698,7 @@ loop:
goto loop;
}
}
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
qsync(mp);
#endif
/*
@@ -1756,7 +1787,7 @@ ffs_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
ip->i_fs = fs = ump->um_fs;
ip->i_dev = dev;
ip->i_number = ino;
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
ufsquota_init(ip);
#endif
diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h
index 2395af34e86..7e5af7c89d3 100644
--- a/sys/ufs/ffs/fs.h
+++ b/sys/ufs/ffs/fs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fs.h,v 1.55 2010/01/31 10:54:10 mlelstv Exp $ */
+/* $NetBSD: fs.h,v 1.56 2011/03/06 17:08:38 bouyer Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -336,7 +336,11 @@ struct fs {
uint8_t fs_journal_reserved[2];/* reserved for future use */
uint32_t fs_journal_flags; /* journal flags */
uint64_t fs_journallocs[4]; /* location info for journal */
- int64_t fs_sparecon64[12]; /* reserved for future use */
+ uint32_t fs_quota_magic; /* see quota2.h */
+ uint8_t fs_quota_flags; /* see quota2.h */
+ uint8_t fs_quota_reserved[3];
+ uint64_t fs_quotafile[2]; /* pointer to quota inodes */
+ int64_t fs_sparecon64[9]; /* reserved for future use */
int64_t fs_sblockloc; /* byte offset of standard superblock */
struct csum_total fs_cstotal; /* cylinder summary information */
int64_t fs_time; /* last time written */
@@ -424,9 +428,10 @@ struct fs {
#define FS_GJOURNAL 0x40 /* gjournaled file system */
#define FS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */
#define FS_DOWAPBL 0x100 /* Write ahead physical block logging */
+#define FS_DOQUOTA2 0x200 /* in-filesystem quotas */
/* File system flags that are ok for NetBSD if set in fs_flags */
-#define FS_KNOWN_FLAGS (FS_DOSOFTDEP | FS_DOWAPBL)
+#define FS_KNOWN_FLAGS (FS_DOSOFTDEP | FS_DOWAPBL | FS_DOQUOTA2)
/*
* File system internal flags, also in fs_flags.
diff --git a/sys/ufs/files.ufs b/sys/ufs/files.ufs
index 2841171162e..a99a5aca956 100644
--- a/sys/ufs/files.ufs
+++ b/sys/ufs/files.ufs
@@ -1,4 +1,4 @@
-# $NetBSD: files.ufs,v 1.24 2010/03/02 19:59:09 pooka Exp $
+# $NetBSD: files.ufs,v 1.25 2011/03/06 17:08:38 bouyer Exp $
deffs FFS
deffs EXT2FS
@@ -33,6 +33,7 @@ file ufs/ffs/ffs_vfsops.c ffs | lfs | mfs | ext2fs
file ufs/ffs/ffs_vnops.c ffs | lfs | mfs | ext2fs
file ufs/ffs/ffs_wapbl.c ffs & wapbl
file ufs/ffs/ffs_appleufs.c ffs & apple_ufs
+file ufs/ffs/ffs_quota2.c quota2 & (ffs | lfs | mfs | ext2fs)
file ufs/lfs/lfs_alloc.c lfs
file ufs/lfs/lfs_balloc.c lfs
@@ -58,7 +59,12 @@ file ufs/ufs/ufs_extattr.c (ffs | mfs) & ufs_extattr
file ufs/ufs/ufs_ihash.c ffs | lfs | mfs | ext2fs
file ufs/ufs/ufs_inode.c ffs | lfs | mfs | ext2fs
file ufs/ufs/ufs_lookup.c ffs | lfs | mfs | ext2fs
-file ufs/ufs/ufs_quota.c quota & (ffs | lfs | mfs | ext2fs)
+file ufs/ufs/ufs_quota.c (quota | quota2) & (ffs | lfs | mfs | ext2fs)
+file ufs/ufs/ufs_quota1.c quota & (ffs | lfs | mfs | ext2fs)
+file ufs/ufs/ufs_quota2.c quota2 & (ffs | lfs | mfs | ext2fs)
+file ufs/ufs/quota1_subr.c
+file ufs/ufs/quota2_subr.c quota2 & (ffs | lfs | mfs | ext2fs)
+file ufs/ufs/quota2_prop.c
file ufs/ufs/ufs_vfsops.c ffs | lfs | mfs | ext2fs
file ufs/ufs/ufs_vnops.c ffs | lfs | mfs | ext2fs
file ufs/ufs/ufs_wapbl.c ffs & wapbl
diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c
index 1b908fc04bf..7586262abaf 100644
--- a/sys/ufs/lfs/lfs_vfsops.c
+++ b/sys/ufs/lfs/lfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vfsops.c,v 1.287 2010/06/24 13:03:19 hannken Exp $ */
+/* $NetBSD: lfs_vfsops.c,v 1.288 2011/03/06 17:08:39 bouyer Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.287 2010/06/24 13:03:19 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.288 2011/03/06 17:08:39 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_lfs.h"
@@ -1123,21 +1123,8 @@ lfs_unmount(struct mount *mp, int mntflags)
mutex_exit(&lfs_lock);
#ifdef QUOTA
- if (mp->mnt_flag & MNT_QUOTA) {
- int i;
- error = vflush(mp, fs->lfs_ivnode, SKIPSYSTEM|flags);
- if (error)
- return (error);
- for (i = 0; i < MAXQUOTAS; i++) {
- if (ump->um_quotas[i] == NULLVP)
- continue;
- quotaoff(l, mp, i);
- }
- /*
- * Here we fall through to vflush again to ensure
- * that we have gotten rid of all the system vnodes.
- */
- }
+ if ((error = quota1_umount(mp, flags)) != 0)
+ return (error);
#endif
if ((error = vflush(mp, fs->lfs_ivnode, flags)) != 0)
return (error);
diff --git a/sys/ufs/ufs/Makefile b/sys/ufs/ufs/Makefile
index e288c1cdc14..6f08db609a1 100644
--- a/sys/ufs/ufs/Makefile
+++ b/sys/ufs/ufs/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.6 2008/07/31 05:38:06 simonb Exp $
+# $NetBSD: Makefile,v 1.7 2011/03/06 17:08:39 bouyer Exp $
INCSDIR= /usr/include/ufs/ufs
-INCS= dinode.h dir.h extattr.h inode.h quota.h ufs_bswap.h ufs_extern.h \
- ufs_wapbl.h ufsmount.h
+INCS= dinode.h dir.h extattr.h inode.h quota.h quota1.h quota2.h \
+ ufs_bswap.h ufs_extern.h ufs_wapbl.h ufsmount.h
.include <bsd.kinc.mk>
diff --git a/sys/ufs/ufs/quota.h b/sys/ufs/ufs/quota.h
index 5c4e986fbb3..ec991e73bd7 100644
--- a/sys/ufs/ufs/quota.h
+++ b/sys/ufs/ufs/quota.h
@@ -1,4 +1,4 @@
-/* $NetBSD: quota.h,v 1.25 2007/07/10 09:50:08 hannken Exp $ */
+/* $NetBSD: quota.h,v 1.26 2011/03/06 17:08:39 bouyer Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -38,16 +38,9 @@
#define _UFS_UFS_QUOTA_H_
/*
- * Definitions for disk quotas imposed on the average user
- * (big brother finally hits UNIX).
- *
- * The following constants define the amount of time given a user before the
- * soft limits are treated as hard limits (usually resulting in an allocation
- * failure). The timer is started when the user crosses their soft limit, it
- * is reset when they go below their soft limit.
+ * These definitions are common to the original disk quota implementation
+ * (quota1) and the newer implementation (quota2)
*/
-#define MAX_IQ_TIME (7*24*60*60) /* seconds in 1 week */
-#define MAX_DQ_TIME (7*24*60*60) /* seconds in 1 week */
/*
* The following constants define the usage of the quota file array in the
@@ -61,49 +54,21 @@
#define GRPQUOTA 1 /* element used for group quotas */
/*
- * Definitions for the default names of the quotas files.
+ * Definitions for the default names of the quotas files/quota types.
*/
#define INITQFNAMES { \
"user", /* USRQUOTA */ \
"group", /* GRPQUOTA */ \
- "undefined", \
}
-#define QUOTAFILENAME "quota"
-#define QUOTAGROUP "operator"
-/*
- * Command definitions for the 'quotactl' system call. The commands are
- * broken into a main command defined below and a subcommand that is used
- * to convey the type of quota that is being manipulated (see above).
- */
-#define SUBCMDMASK 0x00ff
-#define SUBCMDSHIFT 8
-#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+/* definition of limits types for each quota */
+#define QL_BLOCK 0
+#define QL_FILE 1
+#define N_QL 2
+
+#define INITQLNAMES {"block", "file", "undefined" }
-#define Q_QUOTAON 0x0100 /* enable quotas */
-#define Q_QUOTAOFF 0x0200 /* disable quotas */
-#define Q_GETQUOTA 0x0300 /* get limits and usage */
-#define Q_SETQUOTA 0x0400 /* set limits and usage */
-#define Q_SETUSE 0x0500 /* set usage */
-#define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
-/*
- * The following structure defines the format of the disk quota file
- * (as it appears on disk) - the file is an array of these structures
- * indexed by user or group number. The setquota system call establishes
- * the vnode for each quota file (a pointer is retained in the ufsmount
- * structure).
- */
-struct dqblk {
- u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
- u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
- u_int32_t dqb_curblocks; /* current block count */
- u_int32_t dqb_ihardlimit; /* maximum # allocated inodes + 1 */
- u_int32_t dqb_isoftlimit; /* preferred inode limit */
- u_int32_t dqb_curinodes; /* current # allocated inodes */
- int32_t dqb_btime; /* time limit for excessive disk use */
- int32_t dqb_itime; /* time limit for excessive files */
-};
#ifdef _KERNEL
@@ -114,10 +79,6 @@ void dqinit(void);
void dqreinit(void);
void dqdone(void);
__END_DECLS
-#else
-__BEGIN_DECLS
-int quotactl(const char *, int , int, void *);
-__END_DECLS
#endif /* _KERNEL */
#endif /* !_UFS_UFS_QUOTA_H_ */
diff --git a/sys/ufs/ufs/quota1.h b/sys/ufs/ufs/quota1.h
new file mode 100644
index 00000000000..100f700d1f0
--- /dev/null
+++ b/sys/ufs/ufs/quota1.h
@@ -0,0 +1,100 @@
+/* $NetBSD: quota1.h,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)quota.h 8.3 (Berkeley) 8/19/94
+ */
+
+#ifndef _UFS_UFS_QUOTA1_H_
+#define _UFS_UFS_QUOTA1_H_
+#include <ufs/ufs/quota.h>
+
+/*
+ * These definitions are for the original disk quota implementation, which
+ * is deprecated. the newer implementation is defined in quota2.h
+ * and friends
+ */
+/*
+ * Definitions for disk quotas imposed on the average user
+ * (big brother finally hits UNIX).
+ *
+ * The following constants define the amount of time given a user before the
+ * soft limits are treated as hard limits (usually resulting in an allocation
+ * failure). The timer is started when the user crosses their soft limit, it
+ * is reset when they go below their soft limit.
+ */
+#define MAX_IQ_TIME (7*24*60*60) /* seconds in 1 week */
+#define MAX_DQ_TIME (7*24*60*60) /* seconds in 1 week */
+
+#define QUOTAFILENAME "quota"
+#define QUOTAGROUP "operator"
+
+/*
+ * Command definitions for the 'compat_50_quotactl' system call. The commands
+ * are broken into a main command defined below and a subcommand that is used
+ * to convey the type of quota that is being manipulated (see above).
+ */
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_QUOTAON 0x0100 /* enable quotas */
+#define Q_QUOTAOFF 0x0200 /* disable quotas */
+#define Q_GETQUOTA 0x0300 /* get limits and usage */
+#define Q_SETQUOTA 0x0400 /* set limits and usage */
+#define Q_SETUSE 0x0500 /* set usage */
+#define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
+
+/*
+ * The following structure defines the format of the disk quota file
+ * (as it appears on disk) - the file is an array of these structures
+ * indexed by user or group number. The setquota system call establishes
+ * the vnode for each quota file (a pointer is retained in the ufsmount
+ * structure).
+ */
+struct dqblk {
+ u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
+ u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
+ u_int32_t dqb_curblocks; /* current block count */
+ u_int32_t dqb_ihardlimit; /* maximum # allocated inodes + 1 */
+ u_int32_t dqb_isoftlimit; /* preferred inode limit */
+ u_int32_t dqb_curinodes; /* current # allocated inodes */
+ int32_t dqb_btime; /* time limit for excessive disk use */
+ int32_t dqb_itime; /* time limit for excessive files */
+};
+
+/* quota1_subr.c */
+struct quota2_entry;
+void dqblk2q2e(const struct dqblk *, struct quota2_entry *);
+void q2e2dqblk(const struct quota2_entry *, struct dqblk *);
+
+#endif /* !_UFS_UFS_QUOTA1_H_ */
diff --git a/sys/ufs/ufs/quota1_subr.c b/sys/ufs/ufs/quota1_subr.c
new file mode 100644
index 00000000000..a06a7f268c5
--- /dev/null
+++ b/sys/ufs/ufs/quota1_subr.c
@@ -0,0 +1,91 @@
+/* $NetBSD: quota1_subr.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: quota1_subr.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $");
+
+#include <sys/types.h>
+#include <machine/limits.h>
+
+#include <ufs/ufs/quota2.h>
+#include <ufs/ufs/quota1.h>
+
+static uint64_t
+dqblk2q2e_limit(uint32_t lim)
+{
+ if (lim == 0)
+ return UQUAD_MAX;
+ else
+ return (lim - 1);
+}
+
+static uint32_t
+q2e2dqblk_limit(uint64_t lim)
+{
+ if (lim == UQUAD_MAX)
+ return 0;
+ else
+ return (lim + 1);
+}
+
+void
+dqblk2q2e(const struct dqblk *dqblk, struct quota2_entry *q2e)
+{
+ q2e->q2e_val[QL_BLOCK].q2v_hardlimit =
+ dqblk2q2e_limit(dqblk->dqb_bhardlimit);
+ q2e->q2e_val[QL_BLOCK].q2v_softlimit =
+ dqblk2q2e_limit(dqblk->dqb_bsoftlimit);
+ q2e->q2e_val[QL_BLOCK].q2v_cur = dqblk->dqb_curblocks;
+ q2e->q2e_val[QL_BLOCK].q2v_time = dqblk->dqb_btime;
+
+ q2e->q2e_val[QL_FILE].q2v_hardlimit =
+ dqblk2q2e_limit(dqblk->dqb_ihardlimit);
+ q2e->q2e_val[QL_FILE].q2v_softlimit =
+ dqblk2q2e_limit(dqblk->dqb_isoftlimit);
+ q2e->q2e_val[QL_FILE].q2v_cur = dqblk->dqb_curinodes;
+ q2e->q2e_val[QL_FILE].q2v_time = dqblk->dqb_itime;
+}
+
+void
+q2e2dqblk(const struct quota2_entry *q2e, struct dqblk *dqblk)
+{
+ dqblk->dqb_bhardlimit =
+ q2e2dqblk_limit(q2e->q2e_val[QL_BLOCK].q2v_hardlimit);
+ dqblk->dqb_bsoftlimit =
+ q2e2dqblk_limit(q2e->q2e_val[QL_BLOCK].q2v_softlimit);
+ dqblk->dqb_curblocks = q2e->q2e_val[QL_BLOCK].q2v_cur;
+ dqblk->dqb_btime = q2e->q2e_val[QL_BLOCK].q2v_time;
+
+ dqblk->dqb_ihardlimit =
+ q2e2dqblk_limit(q2e->q2e_val[QL_FILE].q2v_hardlimit);
+ dqblk->dqb_isoftlimit =
+ q2e2dqblk_limit(q2e->q2e_val[QL_FILE].q2v_softlimit);
+ dqblk->dqb_curinodes = q2e->q2e_val[QL_FILE].q2v_cur;
+ dqblk->dqb_itime = q2e->q2e_val[QL_FILE].q2v_time;
+}
diff --git a/sys/ufs/ufs/quota2.h b/sys/ufs/ufs/quota2.h
new file mode 100644
index 00000000000..33ac5ba4068
--- /dev/null
+++ b/sys/ufs/ufs/quota2.h
@@ -0,0 +1,115 @@
+/* $NetBSD: quota2.h,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _UFS_UFS_QUOTA2_H_
+#define _UFS_UFS_QUOTA2_H_
+#include <ufs/ufs/quota.h>
+
+
+/* New disk quota implementation. In this implementation, the quota datas
+ * (default values, user limits and current usage) are part of the filesystem
+ * metadata. On FFS, this will be in a hidden, unlinked inode. fsck_ffs is
+ * responsible for checking quotas with the rest of the filesystem integrity,
+ * and quotas metadata are also covered by the filesystem journal if any.
+ * quota enable/disable is done on a filesystem basis via flags in the
+ * superblock
+ */
+
+/*
+ * The quota file is comprised of 2 parts, the header and the entries.
+ * The header contains global informations, and head of list of quota entries.
+ * A quota entry can either be in the free list, or one of the hash lists.
+ */
+
+/* description of a block or inode quota */
+struct quota2_val {
+ uint64_t q2v_hardlimit; /* absolute limit */
+ uint64_t q2v_softlimit; /* overflowable limit */
+ uint64_t q2v_cur; /* current usage */
+ int64_t q2v_time; /* grace expiration date for softlimit overflow */
+ int64_t q2v_grace; /* allowed time for softlimit overflow */
+};
+
+/*
+ * On-disk description of a user or group quota
+ * These entries are keept as linked list, either in one of the hash HEAD,
+ * or in the free list.
+ */
+
+struct quota2_entry {
+ /* block & inode limits and status */
+ struct quota2_val q2e_val[N_QL];
+ /* pointer to next entry for this list (offset in the file) */
+ uint64_t q2e_next;
+ /* ownerchip information */
+ uint32_t q2e_uid;
+ uint32_t q2e_pad;
+};
+
+/* header present at the start of the quota file */
+struct quota2_header {
+ uint32_t q2h_magic_number;
+ uint8_t q2h_type; /* quota type, see below */
+ uint8_t q2h_hash_shift; /* bytes used for hash index */
+ uint16_t q2h_hash_size; /* size of hash table */
+ /* default values applied to new entries */
+ struct quota2_entry q2h_defentry;
+ /* head of free quota2_entry list */
+ uint64_t q2h_free;
+ /* variable-sized hash table */
+ uint64_t q2h_entries[0];
+};
+
+#define Q2_HEAD_MAGIC 0xb746915e
+
+/* superblock flags */
+#define FS_Q2_DO_TYPE(type) (0x01 << (type))
+
+#define off2qindex(hsize, off) (((off) - (hsize)) / sizeof(struct quota2_entry))
+#define qindex2off(hsize, idx) \
+ ((daddr_t)(idx) * sizeof(struct quota2_entry) + (hsize))
+
+/* quota2_subr.c */
+void quota2_addfreeq2e(struct quota2_header *, void *, uint64_t, uint64_t, int);
+void quota2_create_blk0(uint64_t, void *bp, int, int, int);
+void quota2_ufs_rwq2v(const struct quota2_val *, struct quota2_val *, int);
+void quota2_ufs_rwq2e(const struct quota2_entry *, struct quota2_entry *, int);
+
+int quota2_check_limit(struct quota2_val *, uint64_t, time_t);
+#define QL_S_ALLOW_OK 0x00 /* below soft limit */
+#define QL_S_ALLOW_SOFT 0x01 /* over soft limit */
+#define QL_S_DENY_GRACE 0x02 /* over soft limit, grace time expired */
+#define QL_S_DENY_HARD 0x03 /* over hard limit */
+
+#define QL_F_CROSS 0x80 /* crossing soft limit */
+
+#define QL_STATUS(x) ((x) & 0x0f)
+#define QL_FLAGS(x) ((x) & 0xf0)
+
+#endif /* _UFS_UFS_QUOTA2_H_ */
diff --git a/sys/ufs/ufs/quota2_prop.c b/sys/ufs/ufs/quota2_prop.c
new file mode 100644
index 00000000000..0d87dbf2148
--- /dev/null
+++ b/sys/ufs/ufs/quota2_prop.c
@@ -0,0 +1,275 @@
+/* $NetBSD: quota2_prop.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/inttypes.h>
+#include <sys/errno.h>
+
+#include <ufs/ufs/quota2_prop.h>
+
+const char *quota2_valnames[] = INITQLNAMES;
+
+prop_dictionary_t
+prop_dictionary_get_dict(prop_dictionary_t dict, const char *key)
+{
+ prop_object_t o;
+ o = prop_dictionary_get(dict, key);
+ if (o == NULL || prop_object_type(o) != PROP_TYPE_DICTIONARY)
+ return NULL;
+ return o;
+
+}
+
+int
+quota2_dict_get_q2v_limits(prop_dictionary_t dict, struct quota2_val *q2v,
+ bool update)
+{
+ uint64_t vu;
+ int64_t v;
+ if (!prop_dictionary_get_uint64(dict, "soft", &vu)) {
+ if (!update)
+ return EINVAL;
+ } else
+ q2v->q2v_softlimit = vu;
+ if (!prop_dictionary_get_uint64(dict, "hard", &vu)) {
+ if (!update)
+ return EINVAL;
+ } else
+ q2v->q2v_hardlimit = vu;
+ if (!prop_dictionary_get_int64(dict, "grace time", &v)) {
+ if (!update)
+ return EINVAL;
+ } else
+ q2v->q2v_grace = v;
+ return 0;
+}
+
+int
+quota2_dict_update_q2e_limits(prop_dictionary_t data, struct quota2_entry *q2e)
+{
+ int i, error;
+ prop_dictionary_t val;
+ for (i = 0; i < N_QL; i++) {
+ val = prop_dictionary_get_dict(data, quota2_valnames[i]);
+ if (val == NULL)
+ continue;
+ error = quota2_dict_get_q2v_limits(val, &q2e->q2e_val[i], 1);
+ if (error)
+ return error;
+ }
+ return 0;
+}
+
+int
+quota2_dict_get_q2v_usage(prop_dictionary_t dict, struct quota2_val *q2v)
+{
+ uint64_t vu;
+ int64_t v;
+ int err;
+
+ err = quota2_dict_get_q2v_limits(dict, q2v, false);
+ if (err)
+ return err;
+ if (!prop_dictionary_get_uint64(dict, "usage", &vu))
+ return EINVAL;
+ q2v->q2v_cur = vu;
+ if (!prop_dictionary_get_int64(dict, "expire time", &v))
+ return EINVAL;
+ q2v->q2v_time = v;
+ return 0;
+}
+
+int
+quota2_dict_get_q2e_usage(prop_dictionary_t data, struct quota2_entry *q2e)
+{
+ int i, error;
+ prop_dictionary_t val;
+ for (i = 0; i < N_QL; i++) {
+ val = prop_dictionary_get_dict(data, quota2_valnames[i]);
+ if (val == NULL)
+ return EINVAL;
+ error = quota2_dict_get_q2v_usage(val, &q2e->q2e_val[i]);
+ if (error)
+ return error;
+ }
+ return 0;
+}
+
+int
+quota2_get_cmds(prop_dictionary_t qdict, prop_array_t *cmds)
+{
+ prop_number_t pn;
+ prop_object_t o;
+
+ pn = prop_dictionary_get(qdict, "interface version");
+ if (pn == NULL)
+ return EINVAL;
+ if (prop_number_integer_value(pn) != 1)
+ return EINVAL;
+
+ o = prop_dictionary_get(qdict, "commands");
+ if (o == NULL)
+ return ENOMEM;
+ if(prop_object_type(o) != PROP_TYPE_ARRAY)
+ return EINVAL;
+ *cmds = o;
+ return 0;
+}
+
+bool
+prop_array_add_and_rel(prop_array_t array, prop_object_t po)
+{
+ bool ret;
+ if (po == NULL)
+ return false;
+ ret = prop_array_add(array, po);
+ prop_object_release(po);
+ return ret;
+}
+
+bool
+prop_dictionary_set_and_rel(prop_dictionary_t dict, const char *key,
+ prop_object_t po)
+{
+ bool ret;
+ if (po == NULL)
+ return false;
+ ret = prop_dictionary_set(dict, key, po);
+ prop_object_release(po);
+ return ret;
+}
+
+prop_dictionary_t
+quota2_prop_create(void)
+{
+ prop_dictionary_t dict = prop_dictionary_create();
+
+ if (dict == NULL)
+ return NULL;
+
+ if (!prop_dictionary_set_uint8(dict, "interface version", 1)) {
+ goto err;
+ }
+ return dict;
+err:
+ prop_object_release(dict);
+ return NULL;
+}
+
+bool
+quota2_prop_add_command(prop_array_t arrcmd, const char *cmd, const char *type,
+ prop_array_t data)
+{
+ prop_dictionary_t dict;
+
+ dict = prop_dictionary_create();
+ if (dict == NULL) {
+ return false;
+ }
+ if (!prop_dictionary_set_cstring(dict, "type", type)) {
+ goto err;
+ }
+ if (!prop_dictionary_set_cstring(dict, "command", cmd)) {
+ goto err;
+ }
+ if (!prop_dictionary_set_and_rel(dict, "data", data)) {
+ goto err;
+ }
+ if (!prop_array_add(arrcmd, dict)) {
+ goto err;
+ }
+ prop_object_release(dict);
+ return true;
+err:
+ prop_object_release(dict);
+ return false;
+}
+
+prop_dictionary_t
+q2vtoprop(struct quota2_val *q2v)
+{
+ prop_dictionary_t dict1 = prop_dictionary_create();
+
+ if (dict1 == NULL)
+ return NULL;
+ if (!prop_dictionary_set_uint64(dict1, "hard", q2v->q2v_hardlimit)) {
+ goto err;
+ }
+ if (!prop_dictionary_set_uint64(dict1, "soft", q2v->q2v_softlimit)) {
+ goto err;
+ }
+ if (!prop_dictionary_set_uint64(dict1, "usage", q2v->q2v_cur)) {
+ goto err;
+ }
+ if (!prop_dictionary_set_int64(dict1, "expire time", q2v->q2v_time)) {
+ goto err;
+ }
+ if (!prop_dictionary_set_int64(dict1, "grace time", q2v->q2v_grace)) {
+ goto err;
+ }
+ return dict1;
+err:
+ prop_object_release(dict1);
+ return NULL;
+}
+
+prop_dictionary_t
+q2etoprop(struct quota2_entry *q2e, int def)
+{
+ prop_dictionary_t dict1 = prop_dictionary_create();
+ prop_dictionary_t dict2;
+ int i;
+
+ if (dict1 == NULL)
+ return NULL;
+ if (def) {
+ if (!prop_dictionary_set_cstring_nocopy(dict1, "id",
+ "default")) {
+ goto err;
+ }
+ } else {
+ if (!prop_dictionary_set_uint32(dict1, "id", q2e->q2e_uid)) {
+ goto err;
+ }
+ }
+ for (i = 0; i < N_QL; i++) {
+ dict2 = q2vtoprop(&q2e->q2e_val[i]);
+ if (dict2 == NULL)
+ goto err;
+ if (!prop_dictionary_set_and_rel(dict1, quota2_valnames[i],
+ dict2))
+ goto err;
+ }
+
+ return dict1;
+err:
+ prop_object_release(dict1);
+ return NULL;
+}
diff --git a/sys/ufs/ufs/quota2_prop.h b/sys/ufs/ufs/quota2_prop.h
new file mode 100644
index 00000000000..d13042d8bca
--- /dev/null
+++ b/sys/ufs/ufs/quota2_prop.h
@@ -0,0 +1,47 @@
+/* $NetBSD: quota2_prop.h,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <prop/proplib.h>
+#include <ufs/ufs/quota2.h>
+
+prop_dictionary_t prop_dictionary_get_dict(prop_dictionary_t, const char *);
+int quota2_dict_get_q2v_limits(prop_dictionary_t, struct quota2_val *, bool);
+int quota2_dict_update_q2e_limits(prop_dictionary_t, struct quota2_entry *);
+int quota2_dict_get_q2v_usage(prop_dictionary_t, struct quota2_val *);
+int quota2_dict_get_q2e_usage(prop_dictionary_t, struct quota2_entry *);
+int quota2_get_cmds(prop_dictionary_t, prop_array_t *);
+
+bool prop_array_add_and_rel(prop_array_t, prop_object_t);
+bool prop_dictionary_set_and_rel(prop_dictionary_t, const char *,
+ prop_object_t);
+prop_dictionary_t quota2_prop_create(void);
+bool quota2_prop_add_command(prop_array_t, const char *, const char *,
+ prop_array_t);
+prop_dictionary_t q2vtoprop(struct quota2_val *);
+prop_dictionary_t q2etoprop(struct quota2_entry *, int);
diff --git a/sys/ufs/ufs/quota2_subr.c b/sys/ufs/ufs/quota2_subr.c
new file mode 100644
index 00000000000..7ed74e4700b
--- /dev/null
+++ b/sys/ufs/ufs/quota2_subr.c
@@ -0,0 +1,128 @@
+/* $NetBSD: quota2_subr.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: quota2_subr.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $");
+
+#include <sys/param.h>
+#include <sys/time.h>
+
+#include <ufs/ufs/dinode.h>
+#include <ufs/ffs/fs.h>
+#include <ufs/ffs/ffs_extern.h>
+#include <ufs/ufs/ufs_bswap.h>
+#include <ufs/ufs/quota2.h>
+
+#ifndef _KERNEL
+#include <string.h>
+#endif
+
+void
+quota2_addfreeq2e(struct quota2_header *q2h, void *bp, uint64_t baseoff,
+ uint64_t bsize, int ns)
+{
+ uint64_t blkoff = baseoff % bsize;
+ int i, nq2e;
+ struct quota2_entry *q2e;
+
+ q2e = (void *)((char *)bp + blkoff);
+ nq2e = (bsize - blkoff) / sizeof(*q2e);
+ for (i = 0; i < nq2e; i++) {
+ q2e[i].q2e_next = q2h->q2h_free;
+ q2h->q2h_free = ufs_rw64(i * sizeof(*q2e) + baseoff, ns);
+ }
+}
+
+void
+quota2_create_blk0(uint64_t bsize, void *bp, int q2h_hash_shift, int type,
+ int ns)
+{
+ struct quota2_header *q2h;
+ const int quota2_hash_size = 1 << q2h_hash_shift;
+ const int quota2_full_header_size = sizeof(struct quota2_header) +
+ sizeof(q2h->q2h_entries[0]) * quota2_hash_size;
+ int i;
+
+ memset(bp, 0, bsize);
+ q2h = bp;
+ q2h->q2h_magic_number = ufs_rw32(Q2_HEAD_MAGIC, ns);
+ q2h->q2h_type = type;
+ q2h->q2h_hash_shift = q2h_hash_shift;
+ q2h->q2h_hash_size = ufs_rw16(quota2_hash_size, ns);
+ /* setup defaut entry: unlimited, 7 days grace */
+ for (i = 0; i < N_QL; i++) {
+ q2h->q2h_defentry.q2e_val[i].q2v_hardlimit =
+ q2h->q2h_defentry.q2e_val[i].q2v_softlimit =
+ ufs_rw64(UQUAD_MAX, ns);
+ q2h->q2h_defentry.q2e_val[i].q2v_grace =
+ ufs_rw64(7ULL * 24ULL * 3600ULL, ns);
+ }
+
+ /* first quota entry, after the hash table */
+ quota2_addfreeq2e(q2h, bp, quota2_full_header_size, bsize, ns);
+}
+
+void
+quota2_ufs_rwq2v(const struct quota2_val *s, struct quota2_val *d, int needswap)
+{
+ d->q2v_hardlimit = ufs_rw64(s->q2v_hardlimit, needswap);
+ d->q2v_softlimit = ufs_rw64(s->q2v_softlimit, needswap);
+ d->q2v_cur = ufs_rw64(s->q2v_cur, needswap);
+ d->q2v_time = ufs_rw64(s->q2v_time, needswap);
+ d->q2v_grace = ufs_rw64(s->q2v_grace, needswap);
+}
+
+void
+quota2_ufs_rwq2e(const struct quota2_entry *s, struct quota2_entry *d,
+int needswap)
+{
+ quota2_ufs_rwq2v(&s->q2e_val[QL_BLOCK], &d->q2e_val[QL_BLOCK],
+ needswap);
+ quota2_ufs_rwq2v(&s->q2e_val[QL_FILE], &d->q2e_val[QL_FILE],
+ needswap);
+ d->q2e_uid = ufs_rw32(s->q2e_uid, needswap);
+}
+
+int
+quota2_check_limit(struct quota2_val *q2v, uint64_t change, time_t now)
+{
+ if (q2v->q2v_cur + change > q2v->q2v_hardlimit) {
+ if (q2v->q2v_cur <= q2v->q2v_softlimit)
+ return (QL_F_CROSS | QL_S_DENY_HARD);
+ return QL_S_DENY_HARD;
+ } else if (q2v->q2v_cur + change > q2v->q2v_softlimit) {
+ if (q2v->q2v_cur <= q2v->q2v_softlimit)
+ return (QL_F_CROSS | QL_S_ALLOW_SOFT);
+ if (now > q2v->q2v_time) {
+ return QL_S_DENY_GRACE;
+ }
+ return QL_S_ALLOW_SOFT;
+ }
+ return QL_S_ALLOW_OK;
+}
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 18b57108a87..3420e227a19 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_bmap.c,v 1.48 2008/03/27 19:06:52 ad Exp $ */
+/* $NetBSD: ufs_bmap.c,v 1.49 2011/03/06 17:08:39 bouyer Exp $ */
/*
* Copyright (c) 1989, 1991, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_bmap.c,v 1.48 2008/03/27 19:06:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_bmap.c,v 1.49 2011/03/06 17:08:39 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -164,11 +164,13 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, struct indir *ap,
* return a request for a zeroed out buffer if attempts
* are made to read a BLK_NOCOPY or BLK_SNAP block.
*/
- if ((ip->i_flags & SF_SNAPSHOT) && daddr > 0 &&
+ if ((ip->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL)) == SF_SNAPSHOT
+ && daddr > 0 &&
daddr < ump->um_seqinc) {
*bnp = -1;
} else if (*bnp == 0) {
- if (ip->i_flags & SF_SNAPSHOT) {
+ if ((ip->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL))
+ == SF_SNAPSHOT) {
*bnp = blkptrtodb(ump, bn * ump->um_seqinc);
} else {
*bnp = -1;
@@ -305,14 +307,15 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, struct indir *ap,
* return a request for a zeroed out buffer if attempts are made
* to read a BLK_NOCOPY or BLK_SNAP block.
*/
- if ((ip->i_flags & SF_SNAPSHOT) && daddr > 0 &&
- daddr < ump->um_seqinc) {
+ if ((ip->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL)) == SF_SNAPSHOT
+ && daddr > 0 && daddr < ump->um_seqinc) {
*bnp = -1;
return (0);
}
*bnp = blkptrtodb(ump, daddr);
if (*bnp == 0) {
- if (ip->i_flags & SF_SNAPSHOT) {
+ if ((ip->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL))
+ == SF_SNAPSHOT) {
*bnp = blkptrtodb(ump, bn * ump->um_seqinc);
} else {
*bnp = -1;
diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h
index 7b865973c7e..0f3530c9b15 100644
--- a/sys/ufs/ufs/ufs_extern.h
+++ b/sys/ufs/ufs/ufs_extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_extern.h,v 1.62 2009/09/13 05:17:37 tsutsui Exp $ */
+/* $NetBSD: ufs_extern.h,v 1.63 2011/03/06 17:08:39 bouyer Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -139,23 +139,24 @@ int ufs_blkatoff(struct vnode *, off_t, char **, struct buf **, bool);
#define FORCE 0x01 /* force usage changes independent of limits */
void ufsquota_init(struct inode *);
void ufsquota_free(struct inode *);
-int getinoquota(struct inode *);
int chkdq(struct inode *, int64_t, kauth_cred_t, int);
int chkiq(struct inode *, int32_t, kauth_cred_t, int);
-int quotaon(struct lwp *, struct mount *, int, void *);
-int quotaoff(struct lwp *, struct mount *, int);
-int getquota(struct mount *, u_long, int, void *);
-int setquota(struct mount *, u_long, int, void *);
-int setuse(struct mount *, u_long, int, void *);
+int quota_handle_cmd(struct mount *, struct lwp *, prop_dictionary_t);
int qsync(struct mount *);
+/* ufs_quota1.c */
+int quota1_umount(struct mount *, int);
+
+/* ufs_quota2.c */
+int quota2_umount(struct mount *, int);
+
/* ufs_vfsops.c */
void ufs_init(void);
void ufs_reinit(void);
void ufs_done(void);
int ufs_start(struct mount *, int);
int ufs_root(struct mount *, struct vnode **);
-int ufs_quotactl(struct mount *, int, uid_t, void *);
+int ufs_quotactl(struct mount *, prop_dictionary_t);
int ufs_fhtovp(struct mount *, struct ufid *, struct vnode **);
/* ufs_vnops.c */
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c
index b66281c1565..680da8dc3b2 100644
--- a/sys/ufs/ufs/ufs_inode.c
+++ b/sys/ufs/ufs/ufs_inode.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_inode.c,v 1.83 2010/09/01 16:56:19 chs Exp $ */
+/* $NetBSD: ufs_inode.c,v 1.84 2011/03/06 17:08:39 bouyer Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.83 2010/09/01 16:56:19 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.84 2011/03/06 17:08:39 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -103,9 +103,6 @@ ufs_inactive(void *v)
if (error)
goto out;
logged = 1;
-#ifdef QUOTA
- (void)chkiq(ip, -1, NOCRED, 0);
-#endif
#ifdef UFS_EXTATTR
ufs_extattr_vnode_inactive(vp, curlwp);
#endif
@@ -140,6 +137,9 @@ ufs_inactive(void *v)
if (!error)
error = UFS_TRUNCATE(vp, (off_t)0, 0, NOCRED);
}
+#if defined(QUOTA) || defined(QUOTA2)
+ (void)chkiq(ip, -1, NOCRED, 0);
+#endif
DIP_ASSIGN(ip, rdev, 0);
mode = ip->i_mode;
ip->i_mode = 0;
@@ -202,7 +202,7 @@ ufs_reclaim(struct vnode *vp)
vrele(ip->i_devvp);
ip->i_devvp = 0;
}
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
ufsquota_free(ip);
#endif
#ifdef UFS_DIRHASH
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index ac4f0bd787d..52c73492e11 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_quota.c,v 1.68 2010/11/19 06:44:47 dholland Exp $ */
+/* $NetBSD: ufs_quota.c,v 1.69 2011/03/06 17:08:39 bouyer Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993, 1995
@@ -35,8 +35,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.68 2010/11/19 06:44:47 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.69 2011/03/06 17:08:39 bouyer Exp $");
+#if defined(_KERNEL_OPT)
+#include "opt_quota.h"
+#endif
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
@@ -51,119 +54,38 @@ __KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.68 2010/11/19 06:44:47 dholland Exp
#include <ufs/ufs/inode.h>
#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/ufs_extern.h>
+#include <ufs/ufs/ufs_quota.h>
+#include <ufs/ufs/quota2_prop.h>
-/*
- * The following structure records disk usage for a user or group on a
- * filesystem. There is one allocated for each quota that exists on any
- * filesystem for the current user or group. A cache is kept of recently
- * used entries.
- * Field markings and the corresponding locks:
- * h: dqlock
- * d: dq_interlock
- *
- * Lock order is: dq_interlock -> dqlock
- * dq_interlock -> dqvp
- */
-struct dquot {
- LIST_ENTRY(dquot) dq_hash; /* h: hash list */
- u_int16_t dq_flags; /* d: flags, see below */
- u_int16_t dq_type; /* d: quota type of this dquot */
- u_int32_t dq_cnt; /* h: count of active references */
- u_int32_t dq_id; /* d: identifier this applies to */
- struct ufsmount *dq_ump; /* d: filesystem this is taken from */
- kmutex_t dq_interlock; /* d: lock this dquot */
- struct dqblk dq_dqb; /* d: actual usage & quotas */
-};
-/*
- * Flag values.
- */
-#define DQ_MOD 0x04 /* this quota modified since read */
-#define DQ_FAKE 0x08 /* no limits here, just usage */
-#define DQ_BLKS 0x10 /* has been warned about blk limit */
-#define DQ_INODS 0x20 /* has been warned about inode limit */
-/*
- * Shorthand notation.
- */
-#define dq_bhardlimit dq_dqb.dqb_bhardlimit
-#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
-#define dq_curblocks dq_dqb.dqb_curblocks
-#define dq_ihardlimit dq_dqb.dqb_ihardlimit
-#define dq_isoftlimit dq_dqb.dqb_isoftlimit
-#define dq_curinodes dq_dqb.dqb_curinodes
-#define dq_btime dq_dqb.dqb_btime
-#define dq_itime dq_dqb.dqb_itime
-/*
- * If the system has never checked for a quota for this file, then it is
- * set to NODQUOT. Once a write attempt is made the inode pointer is set
- * to reference a dquot structure.
- */
-#define NODQUOT NULL
+kmutex_t dqlock;
+kcondvar_t dqcv;
-static int chkdqchg(struct inode *, int64_t, kauth_cred_t, int);
-static int chkiqchg(struct inode *, int32_t, kauth_cred_t, int);
-#ifdef DIAGNOSTIC
-static void dqflush(struct vnode *);
-#endif
-static int dqget(struct vnode *, u_long, struct ufsmount *, int,
- struct dquot **);
-static void dqref(struct dquot *);
-static void dqrele(struct vnode *, struct dquot *);
-static int dqsync(struct vnode *, struct dquot *);
+const char *quotatypes[MAXQUOTAS] = INITQFNAMES;
-static kmutex_t dqlock;
-static kcondvar_t dqcv;
/*
- * Quota name to error message mapping.
- */
-static const char *quotatypes[] = INITQFNAMES;
-
-/*
- * Set up the quotas for an inode.
- *
- * This routine completely defines the semantics of quotas.
- * If other criterion want to be used to establish quotas, the
- * MAXQUOTAS value in quotas.h should be increased, and the
- * additional dquots set up here.
+ * Code pertaining to management of the in-core dquot data structures.
*/
-int
-getinoquota(struct inode *ip)
-{
- struct ufsmount *ump = ip->i_ump;
- struct vnode *vp = ITOV(ip);
- int i, error;
- u_int32_t ino_ids[MAXQUOTAS];
-
- /*
- * To avoid deadlocks never update quotas for quota files
- * on the same file system
- */
- for (i = 0; i < MAXQUOTAS; i++)
- if (ITOV(ip) == ump->um_quotas[i])
- return 0;
+#define DQHASH(dqvp, id) \
+ (((((long)(dqvp)) >> 8) + id) & dqhash)
+static LIST_HEAD(dqhashhead, dquot) *dqhashtbl;
+static u_long dqhash;
+static pool_cache_t dquot_cache;
- ino_ids[USRQUOTA] = ip->i_uid;
- ino_ids[GRPQUOTA] = ip->i_gid;
- for (i = 0; i < MAXQUOTAS; i++) {
- /*
- * If the file id changed the quota needs update.
- */
- if (ip->i_dquot[i] != NODQUOT &&
- ip->i_dquot[i]->dq_id != ino_ids[i]) {
- dqrele(ITOV(ip), ip->i_dquot[i]);
- ip->i_dquot[i] = NODQUOT;
- }
- /*
- * Set up the quota based on file id.
- * EINVAL means that quotas are not enabled.
- */
- if (ip->i_dquot[i] == NODQUOT &&
- (error = dqget(vp, ino_ids[i], ump, i, &ip->i_dquot[i])) &&
- error != EINVAL)
- return (error);
- }
- return 0;
-}
+static int quota_handle_cmd_get_version(struct mount *, struct lwp *,
+ prop_dictionary_t, prop_array_t);
+static int quota_handle_cmd_get(struct mount *, struct lwp *,
+ prop_dictionary_t, int, prop_array_t);
+static int quota_handle_cmd_set(struct mount *, struct lwp *,
+ prop_dictionary_t, int, prop_array_t);
+static int quota_handle_cmd_getall(struct mount *, struct lwp *,
+ prop_dictionary_t, int, prop_array_t);
+static int quota_handle_cmd_clear(struct mount *, struct lwp *,
+ prop_dictionary_t, int, prop_array_t);
+static int quota_handle_cmd_quotaon(struct mount *, struct lwp *,
+ prop_dictionary_t, int, prop_array_t);
+static int quota_handle_cmd_quotaoff(struct mount *, struct lwp *,
+ prop_dictionary_t, int, prop_array_t);
/*
* Initialize the quota fields of an inode.
*/
@@ -196,104 +118,19 @@ ufsquota_free(struct inode *ip)
int
chkdq(struct inode *ip, int64_t change, kauth_cred_t cred, int flags)
{
- struct dquot *dq;
- int i;
- int ncurblocks, error;
-
- if ((error = getinoquota(ip)) != 0)
- return error;
- if (change == 0)
- return (0);
- if (change < 0) {
- for (i = 0; i < MAXQUOTAS; i++) {
- if ((dq = ip->i_dquot[i]) == NODQUOT)
- continue;
- mutex_enter(&dq->dq_interlock);
- ncurblocks = dq->dq_curblocks + change;
- if (ncurblocks >= 0)
- dq->dq_curblocks = ncurblocks;
- else
- dq->dq_curblocks = 0;
- dq->dq_flags &= ~DQ_BLKS;
- dq->dq_flags |= DQ_MOD;
- mutex_exit(&dq->dq_interlock);
- }
- return (0);
- }
- if ((flags & FORCE) == 0 &&
- kauth_authorize_system(cred, KAUTH_SYSTEM_FS_QUOTA,
- KAUTH_REQ_SYSTEM_FS_QUOTA_NOLIMIT, NULL, NULL, NULL) != 0) {
- for (i = 0; i < MAXQUOTAS; i++) {
- if ((dq = ip->i_dquot[i]) == NODQUOT)
- continue;
- mutex_enter(&dq->dq_interlock);
- error = chkdqchg(ip, change, cred, i);
- mutex_exit(&dq->dq_interlock);
- if (error != 0)
- return (error);
- }
- }
- for (i = 0; i < MAXQUOTAS; i++) {
- if ((dq = ip->i_dquot[i]) == NODQUOT)
- continue;
- mutex_enter(&dq->dq_interlock);
- dq->dq_curblocks += change;
- dq->dq_flags |= DQ_MOD;
- mutex_exit(&dq->dq_interlock);
- }
- return (0);
-}
-
-/*
- * Check for a valid change to a users allocation.
- * Issue an error message if appropriate.
- */
-static int
-chkdqchg(struct inode *ip, int64_t change, kauth_cred_t cred, int type)
-{
- struct dquot *dq = ip->i_dquot[type];
- long ncurblocks = dq->dq_curblocks + change;
+ /* do not track snapshot usage, or we will deadlock */
+ if ((ip->i_flags & SF_SNAPSHOT) != 0)
+ return 0;
- KASSERT(mutex_owned(&dq->dq_interlock));
- /*
- * If user would exceed their hard limit, disallow space allocation.
- */
- if (ncurblocks >= dq->dq_bhardlimit && dq->dq_bhardlimit) {
- if ((dq->dq_flags & DQ_BLKS) == 0 &&
- ip->i_uid == kauth_cred_geteuid(cred)) {
- uprintf("\n%s: write failed, %s disk limit reached\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
- quotatypes[type]);
- dq->dq_flags |= DQ_BLKS;
- }
- return (EDQUOT);
- }
- /*
- * If user is over their soft limit for too long, disallow space
- * allocation. Reset time limit as they cross their soft limit.
- */
- if (ncurblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) {
- if (dq->dq_curblocks < dq->dq_bsoftlimit) {
- dq->dq_btime = time_second + ip->i_ump->um_btime[type];
- if (ip->i_uid == kauth_cred_geteuid(cred))
- uprintf("\n%s: warning, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
- quotatypes[type], "disk quota exceeded");
- return (0);
- }
- if (time_second > dq->dq_btime) {
- if ((dq->dq_flags & DQ_BLKS) == 0 &&
- ip->i_uid == kauth_cred_geteuid(cred)) {
- uprintf("\n%s: write failed, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
- quotatypes[type],
- "disk quota exceeded for too long");
- dq->dq_flags |= DQ_BLKS;
- }
- return (EDQUOT);
- }
- }
- return (0);
+#ifdef QUOTA
+ if (ip->i_ump->um_flags & UFS_QUOTA)
+ return chkdq1(ip, change, cred, flags);
+#endif
+#ifdef QUOTA2
+ if (ip->i_ump->um_flags & UFS_QUOTA2)
+ return chkdq2(ip, change, cred, flags);
+#endif
+ return 0;
}
/*
@@ -302,488 +139,446 @@ chkdqchg(struct inode *ip, int64_t change, kauth_cred_t cred, int type)
int
chkiq(struct inode *ip, int32_t change, kauth_cred_t cred, int flags)
{
- struct dquot *dq;
- int i;
- int ncurinodes, error;
+ /* do not track snapshot usage, or we will deadlock */
+ if ((ip->i_flags & SF_SNAPSHOT) != 0)
+ return 0;
+#ifdef QUOTA
+ if (ip->i_ump->um_flags & UFS_QUOTA)
+ return chkiq1(ip, change, cred, flags);
+#endif
+#ifdef QUOTA2
+ if (ip->i_ump->um_flags & UFS_QUOTA2)
+ return chkiq2(ip, change, cred, flags);
+#endif
+ return 0;
+}
- if ((error = getinoquota(ip)) != 0)
- return error;
- if (change == 0)
- return (0);
- if (change < 0) {
- for (i = 0; i < MAXQUOTAS; i++) {
- if ((dq = ip->i_dquot[i]) == NODQUOT)
- continue;
- mutex_enter(&dq->dq_interlock);
- ncurinodes = dq->dq_curinodes + change;
- if (ncurinodes >= 0)
- dq->dq_curinodes = ncurinodes;
- else
- dq->dq_curinodes = 0;
- dq->dq_flags &= ~DQ_INODS;
- dq->dq_flags |= DQ_MOD;
- mutex_exit(&dq->dq_interlock);
- }
- return (0);
+int
+quota_handle_cmd(struct mount *mp, struct lwp *l, prop_dictionary_t cmddict)
+{
+ int error = 0;
+ const char *cmd, *type;
+ prop_array_t datas;
+ int q2type;
+
+ if (!prop_dictionary_get_cstring_nocopy(cmddict, "command", &cmd))
+ return EINVAL;
+ if (!prop_dictionary_get_cstring_nocopy(cmddict, "type", &type))
+ return EINVAL;
+ if (!strcmp(type, "user")) {
+ q2type = USRQUOTA;
+ } else if (!strcmp(type, "group")) {
+ q2type = GRPQUOTA;
+ } else
+ return EOPNOTSUPP;
+ datas = prop_dictionary_get(cmddict, "data");
+ if (datas == NULL || prop_object_type(datas) != PROP_TYPE_ARRAY)
+ return EINVAL;
+
+ prop_object_retain(datas);
+ prop_dictionary_remove(cmddict, "data"); /* prepare for return */
+
+ if (strcmp(cmd, "get version") == 0) {
+ error = quota_handle_cmd_get_version(mp, l, cmddict, datas);
+ goto end;
}
- if ((flags & FORCE) == 0 && kauth_authorize_system(cred,
- KAUTH_SYSTEM_FS_QUOTA, KAUTH_REQ_SYSTEM_FS_QUOTA_NOLIMIT, NULL,
- NULL, NULL) != 0) {
- for (i = 0; i < MAXQUOTAS; i++) {
- if ((dq = ip->i_dquot[i]) == NODQUOT)
- continue;
- mutex_enter(&dq->dq_interlock);
- error = chkiqchg(ip, change, cred, i);
- mutex_exit(&dq->dq_interlock);
- if (error != 0)
- return (error);
- }
+ if (strcmp(cmd, "quotaon") == 0) {
+ error = quota_handle_cmd_quotaon(mp, l, cmddict,
+ q2type, datas);
+ goto end;
}
- for (i = 0; i < MAXQUOTAS; i++) {
- if ((dq = ip->i_dquot[i]) == NODQUOT)
- continue;
- mutex_enter(&dq->dq_interlock);
- dq->dq_curinodes += change;
- dq->dq_flags |= DQ_MOD;
- mutex_exit(&dq->dq_interlock);
+ if (strcmp(cmd, "quotaoff") == 0) {
+ error = quota_handle_cmd_quotaoff(mp, l, cmddict,
+ q2type, datas);
+ goto end;
}
- return (0);
-}
-
-/*
- * Check for a valid change to a users allocation.
- * Issue an error message if appropriate.
- */
-static int
-chkiqchg(struct inode *ip, int32_t change, kauth_cred_t cred, int type)
-{
- struct dquot *dq = ip->i_dquot[type];
- long ncurinodes = dq->dq_curinodes + change;
-
- KASSERT(mutex_owned(&dq->dq_interlock));
- /*
- * If user would exceed their hard limit, disallow inode allocation.
- */
- if (ncurinodes >= dq->dq_ihardlimit && dq->dq_ihardlimit) {
- if ((dq->dq_flags & DQ_INODS) == 0 &&
- ip->i_uid == kauth_cred_geteuid(cred)) {
- uprintf("\n%s: write failed, %s inode limit reached\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
- quotatypes[type]);
- dq->dq_flags |= DQ_INODS;
- }
- return (EDQUOT);
+ if (strcmp(cmd, "get") == 0) {
+ error = quota_handle_cmd_get(mp, l, cmddict, q2type, datas);
+ goto end;
}
- /*
- * If user is over their soft limit for too long, disallow inode
- * allocation. Reset time limit as they cross their soft limit.
- */
- if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) {
- if (dq->dq_curinodes < dq->dq_isoftlimit) {
- dq->dq_itime = time_second + ip->i_ump->um_itime[type];
- if (ip->i_uid == kauth_cred_geteuid(cred))
- uprintf("\n%s: warning, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
- quotatypes[type], "inode quota exceeded");
- return (0);
- }
- if (time_second > dq->dq_itime) {
- if ((dq->dq_flags & DQ_INODS) == 0 &&
- ip->i_uid == kauth_cred_geteuid(cred)) {
- uprintf("\n%s: write failed, %s %s\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
- quotatypes[type],
- "inode quota exceeded for too long");
- dq->dq_flags |= DQ_INODS;
- }
- return (EDQUOT);
- }
+ if (strcmp(cmd, "set") == 0) {
+ error = quota_handle_cmd_set(mp, l, cmddict, q2type, datas);
+ goto end;
}
- return (0);
+ if (strcmp(cmd, "getall") == 0) {
+ error = quota_handle_cmd_getall(mp, l, cmddict, q2type, datas);
+ goto end;
+ }
+ if (strcmp(cmd, "clear") == 0) {
+ error = quota_handle_cmd_clear(mp, l, cmddict, q2type, datas);
+ goto end;
+ }
+ error = EOPNOTSUPP;
+end:
+ error = (prop_dictionary_set_int8(cmddict, "return",
+ error) ? 0 : ENOMEM);
+ prop_object_release(datas);
+ return error;
}
-/*
- * Code to process quotactl commands.
- */
-
-/*
- * Q_QUOTAON - set up a quota file for a particular file system.
- */
-int
-quotaon(struct lwp *l, struct mount *mp, int type, void *fname)
+static int
+quota_handle_cmd_get_version(struct mount *mp, struct lwp *l,
+ prop_dictionary_t cmddict, prop_array_t datas)
{
struct ufsmount *ump = VFSTOUFS(mp);
- struct vnode *vp, **vpp, *mvp;
- struct dquot *dq;
- int error;
- struct pathbuf *pb;
- struct nameidata nd;
+ prop_array_t replies;
+ prop_dictionary_t data;
+ int error = 0;
- /* XXX XXX XXX */
- if (mp->mnt_wapbl != NULL) {
- printf("%s: quotas cannot yet be used with -o log\n",
- mp->mnt_stat.f_mntonname);
- return (EOPNOTSUPP);
- }
+ if ((ump->um_flags & (UFS_QUOTA|UFS_QUOTA2)) == 0)
+ return EOPNOTSUPP;
- vpp = &ump->um_quotas[type];
+ replies = prop_array_create();
+ if (replies == NULL)
+ return ENOMEM;
- error = pathbuf_copyin(fname, &pb);
- if (error) {
- return error;
- }
- NDINIT(&nd, LOOKUP, FOLLOW, pb);
- if ((error = vn_open(&nd, FREAD|FWRITE, 0)) != 0) {
- pathbuf_destroy(pb);
- return error;
+ data = prop_dictionary_create();
+ if (data == NULL) {
+ prop_object_release(replies);
+ return ENOMEM;
}
- vp = nd.ni_vp;
- pathbuf_destroy(pb);
- VOP_UNLOCK(vp);
- if (vp->v_type != VREG) {
- (void) vn_close(vp, FREAD|FWRITE, l->l_cred);
- return (EACCES);
- }
- if (*vpp != vp)
- quotaoff(l, mp, type);
- mutex_enter(&dqlock);
- while ((ump->um_qflags[type] & (QTF_CLOSING | QTF_OPENING)) != 0)
- cv_wait(&dqcv, &dqlock);
- ump->um_qflags[type] |= QTF_OPENING;
- mutex_exit(&dqlock);
- mp->mnt_flag |= MNT_QUOTA;
- vp->v_vflag |= VV_SYSTEM; /* XXXSMP */
- *vpp = vp;
- /*
- * Save the credential of the process that turned on quotas.
- * Set up the time limits for this quota.
- */
- kauth_cred_hold(l->l_cred);
- ump->um_cred[type] = l->l_cred;
- ump->um_btime[type] = MAX_DQ_TIME;
- ump->um_itime[type] = MAX_IQ_TIME;
- if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
- if (dq->dq_btime > 0)
- ump->um_btime[type] = dq->dq_btime;
- if (dq->dq_itime > 0)
- ump->um_itime[type] = dq->dq_itime;
- dqrele(NULLVP, dq);
- }
- /* Allocate a marker vnode. */
- if ((mvp = vnalloc(mp)) == NULL) {
+#ifdef QUOTA
+ if (ump->um_flags & UFS_QUOTA) {
+ if (!prop_dictionary_set_int8(data, "version", 1))
+ error = ENOMEM;
+ } else
+#endif
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2) {
+ if (!prop_dictionary_set_int8(data, "version", 2))
+ error = ENOMEM;
+ } else
+#endif
+ error = 0;
+ if (error)
+ prop_object_release(data);
+ else if (!prop_array_add_and_rel(replies, data))
+ error = ENOMEM;
+ if (error)
+ prop_object_release(replies);
+ else if (!prop_dictionary_set_and_rel(cmddict, "data", replies))
error = ENOMEM;
- goto out;
+ return error;
+}
+
+/* XXX shouldn't all this be in kauth ? */
+static int
+quota_get_auth(struct mount *mp, struct lwp *l, uid_t id) {
+ /* The user can always query about his own quota. */
+ if (id == kauth_cred_getuid(l->l_cred))
+ return 0;
+ return kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_GET, mp, KAUTH_ARG(id), NULL);
+}
+
+static int
+quota_handle_cmd_get(struct mount *mp, struct lwp *l,
+ prop_dictionary_t cmddict, int type, prop_array_t datas)
+{
+ prop_array_t replies;
+ prop_object_iterator_t iter;
+ prop_dictionary_t data;
+ uint32_t id;
+ struct ufsmount *ump = VFSTOUFS(mp);
+ int error, defaultq = 0;
+ const char *idstr;
+
+ if ((ump->um_flags & (UFS_QUOTA|UFS_QUOTA2)) == 0)
+ return EOPNOTSUPP;
+
+ replies = prop_array_create();
+ if (replies == NULL)
+ return ENOMEM;
+
+ iter = prop_array_iterator(datas);
+ if (iter == NULL) {
+ prop_object_release(replies);
+ return ENOMEM;
}
- /*
- * Search vnodes associated with this mount point,
- * adding references to quota file being opened.
- * NB: only need to add dquot's for inodes being modified.
- */
- mutex_enter(&mntvnode_lock);
-again:
- for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
- vmark(mvp, vp);
- mutex_enter(&vp->v_interlock);
- if (VTOI(vp) == NULL || vp->v_mount != mp || vismarker(vp) ||
- vp->v_type == VNON || vp->v_writecount == 0 ||
- (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0) {
- mutex_exit(&vp->v_interlock);
- continue;
- }
- mutex_exit(&mntvnode_lock);
- if (vget(vp, LK_EXCLUSIVE)) {
- mutex_enter(&mntvnode_lock);
- (void)vunmark(mvp);
- goto again;
- }
- if ((error = getinoquota(VTOI(vp))) != 0) {
- vput(vp);
- mutex_enter(&mntvnode_lock);
- (void)vunmark(mvp);
- break;
+ while ((data = prop_object_iterator_next(iter)) != NULL) {
+ if (!prop_dictionary_get_uint32(data, "id", &id)) {
+ if (!prop_dictionary_get_cstring_nocopy(data, "id",
+ &idstr))
+ continue;
+ if (strcmp(idstr, "default")) {
+ error = EINVAL;
+ goto err;
+ }
+ id = 0;
+ defaultq = 1;
+ } else {
+ defaultq = 0;
}
- vput(vp);
- mutex_enter(&mntvnode_lock);
+ error = quota_get_auth(mp, l, id);
+ if (error == EPERM)
+ continue;
+ if (error != 0)
+ goto err;
+#ifdef QUOTA
+ if (ump->um_flags & UFS_QUOTA)
+ error = quota1_handle_cmd_get(ump, type, id, defaultq,
+ replies);
+ else
+#endif
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2) {
+ error = quota2_handle_cmd_get(ump, type, id, defaultq,
+ replies);
+ } else
+#endif
+ panic("quota_handle_cmd_get: no support ?");
+
+ if (error == ENOENT)
+ continue;
+ if (error != 0)
+ goto err;
}
- mutex_exit(&mntvnode_lock);
- vnfree(mvp);
- out:
- mutex_enter(&dqlock);
- ump->um_qflags[type] &= ~QTF_OPENING;
- cv_broadcast(&dqcv);
- mutex_exit(&dqlock);
- if (error)
- quotaoff(l, mp, type);
- return (error);
+ prop_object_iterator_release(iter);
+ if (!prop_dictionary_set_and_rel(cmddict, "data", replies)) {
+ error = ENOMEM;
+ } else {
+ error = 0;
+ }
+ return error;
+err:
+ prop_object_iterator_release(iter);
+ prop_object_release(replies);
+ return error;
}
-/*
- * Q_QUOTAOFF - turn off disk quotas for a filesystem.
- */
-int
-quotaoff(struct lwp *l, struct mount *mp, int type)
+static int
+quota_handle_cmd_set(struct mount *mp, struct lwp *l,
+ prop_dictionary_t cmddict, int type, prop_array_t datas)
{
- struct vnode *vp;
- struct vnode *qvp, *mvp;
+ prop_array_t replies;
+ prop_object_iterator_t iter;
+ prop_dictionary_t data;
+ uint32_t id;
struct ufsmount *ump = VFSTOUFS(mp);
- struct dquot *dq;
- struct inode *ip;
- kauth_cred_t cred;
- int i, error;
-
- /* Allocate a marker vnode. */
- if ((mvp = vnalloc(mp)) == NULL)
+ int error, defaultq = 0;
+ const char *idstr;
+
+ if ((ump->um_flags & (UFS_QUOTA|UFS_QUOTA2)) == 0)
+ return EOPNOTSUPP;
+
+ replies = prop_array_create();
+ if (replies == NULL)
return ENOMEM;
- mutex_enter(&dqlock);
- while ((ump->um_qflags[type] & (QTF_CLOSING | QTF_OPENING)) != 0)
- cv_wait(&dqcv, &dqlock);
- if ((qvp = ump->um_quotas[type]) == NULLVP) {
- mutex_exit(&dqlock);
- vnfree(mvp);
- return (0);
+ iter = prop_array_iterator(datas);
+ if (iter == NULL) {
+ prop_object_release(replies);
+ return ENOMEM;
}
- ump->um_qflags[type] |= QTF_CLOSING;
- mutex_exit(&dqlock);
- /*
- * Search vnodes associated with this mount point,
- * deleting any references to quota file being closed.
- */
- mutex_enter(&mntvnode_lock);
-again:
- for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
- vmark(mvp, vp);
- mutex_enter(&vp->v_interlock);
- if (VTOI(vp) == NULL || vp->v_mount != mp || vismarker(vp) ||
- vp->v_type == VNON ||
- (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0) {
- mutex_exit(&vp->v_interlock);
- continue;
- }
- mutex_exit(&mntvnode_lock);
- if (vget(vp, LK_EXCLUSIVE)) {
- mutex_enter(&mntvnode_lock);
- (void)vunmark(mvp);
- goto again;
+ while ((data = prop_object_iterator_next(iter)) != NULL) {
+ if (!prop_dictionary_get_uint32(data, "id", &id)) {
+ if (!prop_dictionary_get_cstring_nocopy(data, "id",
+ &idstr))
+ continue;
+ if (strcmp(idstr, "default"))
+ continue;
+ id = 0;
+ defaultq = 1;
+ } else {
+ defaultq = 0;
}
- ip = VTOI(vp);
- dq = ip->i_dquot[type];
- ip->i_dquot[type] = NODQUOT;
- dqrele(vp, dq);
- vput(vp);
- mutex_enter(&mntvnode_lock);
- }
- mutex_exit(&mntvnode_lock);
-#ifdef DIAGNOSTIC
- dqflush(qvp);
+ error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_MANAGE, mp, KAUTH_ARG(id), NULL);
+ if (error != 0)
+ goto err;
+#ifdef QUOTA
+ if (ump->um_flags & UFS_QUOTA)
+ error = quota1_handle_cmd_set(ump, type, id, defaultq,
+ data);
+ else
#endif
- qvp->v_vflag &= ~VV_SYSTEM;
- error = vn_close(qvp, FREAD|FWRITE, l->l_cred);
- mutex_enter(&dqlock);
- ump->um_quotas[type] = NULLVP;
- cred = ump->um_cred[type];
- ump->um_cred[type] = NOCRED;
- for (i = 0; i < MAXQUOTAS; i++)
- if (ump->um_quotas[i] != NULLVP)
- break;
- ump->um_qflags[type] &= ~QTF_CLOSING;
- cv_broadcast(&dqcv);
- mutex_exit(&dqlock);
- kauth_cred_free(cred);
- if (i == MAXQUOTAS)
- mp->mnt_flag &= ~MNT_QUOTA;
- return (error);
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2) {
+ error = quota2_handle_cmd_set(ump, type, id, defaultq,
+ data);
+ } else
+#endif
+ panic("quota_handle_cmd_get: no support ?");
+
+ if (error && error != ENOENT)
+ goto err;
+ }
+ prop_object_iterator_release(iter);
+ if (!prop_dictionary_set_and_rel(cmddict, "data", replies)) {
+ error = ENOMEM;
+ } else {
+ error = 0;
+ }
+ return error;
+err:
+ prop_object_iterator_release(iter);
+ prop_object_release(replies);
+ return error;
}
-/*
- * Q_GETQUOTA - return current values in a dqblk structure.
- */
-int
-getquota(struct mount *mp, u_long id, int type, void *addr)
+static int
+quota_handle_cmd_clear(struct mount *mp, struct lwp *l,
+ prop_dictionary_t cmddict, int type, prop_array_t datas)
{
- struct dquot *dq;
- int error;
+ prop_array_t replies;
+ prop_object_iterator_t iter;
+ prop_dictionary_t data;
+ uint32_t id;
+ struct ufsmount *ump = VFSTOUFS(mp);
+ int error, defaultq = 0;
+ const char *idstr;
+
+ if ((ump->um_flags & UFS_QUOTA2) == 0)
+ return EOPNOTSUPP;
+
+ replies = prop_array_create();
+ if (replies == NULL)
+ return ENOMEM;
- if ((error = dqget(NULLVP, id, VFSTOUFS(mp), type, &dq)) != 0)
- return (error);
- error = copyout((void *)&dq->dq_dqb, addr, sizeof (struct dqblk));
- dqrele(NULLVP, dq);
- return (error);
+ iter = prop_array_iterator(datas);
+ if (iter == NULL) {
+ prop_object_release(replies);
+ return ENOMEM;
+ }
+ while ((data = prop_object_iterator_next(iter)) != NULL) {
+ if (!prop_dictionary_get_uint32(data, "id", &id)) {
+ if (!prop_dictionary_get_cstring_nocopy(data, "id",
+ &idstr))
+ continue;
+ if (strcmp(idstr, "default"))
+ continue;
+ id = 0;
+ defaultq = 1;
+ } else {
+ defaultq = 0;
+ }
+ error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_MANAGE, mp, KAUTH_ARG(id), NULL);
+ if (error != 0)
+ goto err;
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2) {
+ error = quota2_handle_cmd_clear(ump, type, id, defaultq,
+ data);
+ } else
+#endif
+ panic("quota_handle_cmd_get: no support ?");
+
+ if (error && error != ENOENT)
+ goto err;
+ }
+ prop_object_iterator_release(iter);
+ if (!prop_dictionary_set_and_rel(cmddict, "data", replies)) {
+ error = ENOMEM;
+ } else {
+ error = 0;
+ }
+ return error;
+err:
+ prop_object_iterator_release(iter);
+ prop_object_release(replies);
+ return error;
}
-/*
- * Q_SETQUOTA - assign an entire dqblk structure.
- */
-int
-setquota(struct mount *mp, u_long id, int type, void *addr)
+static int
+quota_handle_cmd_getall(struct mount *mp, struct lwp *l,
+ prop_dictionary_t cmddict, int type, prop_array_t datas)
{
- struct dquot *dq;
- struct dquot *ndq;
+ prop_array_t replies;
struct ufsmount *ump = VFSTOUFS(mp);
- struct dqblk newlim;
int error;
- error = copyin(addr, (void *)&newlim, sizeof (struct dqblk));
+ if ((ump->um_flags & UFS_QUOTA2) == 0)
+ return EOPNOTSUPP;
+
+ error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_GET, mp, NULL, NULL);
if (error)
- return (error);
- if ((error = dqget(NULLVP, id, ump, type, &ndq)) != 0)
- return (error);
- dq = ndq;
- mutex_enter(&dq->dq_interlock);
- /*
- * Copy all but the current values.
- * Reset time limit if previously had no soft limit or were
- * under it, but now have a soft limit and are over it.
- */
- newlim.dqb_curblocks = dq->dq_curblocks;
- newlim.dqb_curinodes = dq->dq_curinodes;
- if (dq->dq_id != 0) {
- newlim.dqb_btime = dq->dq_btime;
- newlim.dqb_itime = dq->dq_itime;
+ return error;
+
+ replies = prop_array_create();
+ if (replies == NULL)
+ return ENOMEM;
+
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2) {
+ error = quota2_handle_cmd_getall(ump, type, replies);
+ } else
+#endif
+ panic("quota_handle_cmd_getall: no support ?");
+ if (!prop_dictionary_set_and_rel(cmddict, "data", replies)) {
+ error = ENOMEM;
+ } else {
+ error = 0;
}
- if (newlim.dqb_bsoftlimit &&
- dq->dq_curblocks >= newlim.dqb_bsoftlimit &&
- (dq->dq_bsoftlimit == 0 || dq->dq_curblocks < dq->dq_bsoftlimit))
- newlim.dqb_btime = time_second + ump->um_btime[type];
- if (newlim.dqb_isoftlimit &&
- dq->dq_curinodes >= newlim.dqb_isoftlimit &&
- (dq->dq_isoftlimit == 0 || dq->dq_curinodes < dq->dq_isoftlimit))
- newlim.dqb_itime = time_second + ump->um_itime[type];
- dq->dq_dqb = newlim;
- if (dq->dq_curblocks < dq->dq_bsoftlimit)
- dq->dq_flags &= ~DQ_BLKS;
- if (dq->dq_curinodes < dq->dq_isoftlimit)
- dq->dq_flags &= ~DQ_INODS;
- if (dq->dq_isoftlimit == 0 && dq->dq_bsoftlimit == 0 &&
- dq->dq_ihardlimit == 0 && dq->dq_bhardlimit == 0)
- dq->dq_flags |= DQ_FAKE;
- else
- dq->dq_flags &= ~DQ_FAKE;
- dq->dq_flags |= DQ_MOD;
- mutex_exit(&dq->dq_interlock);
- dqrele(NULLVP, dq);
- return (0);
+ return error;
}
-/*
- * Q_SETUSE - set current inode and block usage.
- */
-int
-setuse(struct mount *mp, u_long id, int type, void *addr)
+static int
+quota_handle_cmd_quotaon(struct mount *mp, struct lwp *l,
+ prop_dictionary_t cmddict, int type, prop_array_t datas)
{
- struct dquot *dq;
+ prop_dictionary_t data;
struct ufsmount *ump = VFSTOUFS(mp);
- struct dquot *ndq;
- struct dqblk usage;
int error;
+ const char *qfile;
- error = copyin(addr, (void *)&usage, sizeof (struct dqblk));
- if (error)
- return (error);
- if ((error = dqget(NULLVP, id, ump, type, &ndq)) != 0)
- return (error);
- dq = ndq;
- mutex_enter(&dq->dq_interlock);
- /*
- * Reset time limit if have a soft limit and were
- * previously under it, but are now over it.
- */
- if (dq->dq_bsoftlimit && dq->dq_curblocks < dq->dq_bsoftlimit &&
- usage.dqb_curblocks >= dq->dq_bsoftlimit)
- dq->dq_btime = time_second + ump->um_btime[type];
- if (dq->dq_isoftlimit && dq->dq_curinodes < dq->dq_isoftlimit &&
- usage.dqb_curinodes >= dq->dq_isoftlimit)
- dq->dq_itime = time_second + ump->um_itime[type];
- dq->dq_curblocks = usage.dqb_curblocks;
- dq->dq_curinodes = usage.dqb_curinodes;
- if (dq->dq_curblocks < dq->dq_bsoftlimit)
- dq->dq_flags &= ~DQ_BLKS;
- if (dq->dq_curinodes < dq->dq_isoftlimit)
- dq->dq_flags &= ~DQ_INODS;
- dq->dq_flags |= DQ_MOD;
- mutex_exit(&dq->dq_interlock);
- dqrele(NULLVP, dq);
- return (0);
+ if ((ump->um_flags & UFS_QUOTA2) != 0)
+ return EBUSY;
+
+ if (prop_array_count(datas) != 1)
+ return EINVAL;
+
+ data = prop_array_get(datas, 0);
+ if (data == NULL)
+ return ENOMEM;
+ if (!prop_dictionary_get_cstring_nocopy(data, "quotafile",
+ &qfile))
+ return EINVAL;
+
+ error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_ONOFF, mp, NULL, NULL);
+ if (error != 0) {
+ return error;
+ }
+#ifdef QUOTA
+ error = quota1_handle_cmd_quotaon(l, ump, type, qfile);
+#else
+ error = EOPNOTSUPP;
+#endif
+
+ return error;
}
-/*
- * Q_SYNC - sync quota files to disk.
- */
-int
-qsync(struct mount *mp)
+static int
+quota_handle_cmd_quotaoff(struct mount *mp, struct lwp *l,
+ prop_dictionary_t cmddict, int type, prop_array_t datas)
{
struct ufsmount *ump = VFSTOUFS(mp);
- struct vnode *vp, *mvp;
- struct dquot *dq;
- int i, error;
-
- /*
- * Check if the mount point has any quotas.
- * If not, simply return.
- */
- for (i = 0; i < MAXQUOTAS; i++)
- if (ump->um_quotas[i] != NULLVP)
- break;
- if (i == MAXQUOTAS)
- return (0);
+ int error;
- /* Allocate a marker vnode. */
- if ((mvp = vnalloc(mp)) == NULL)
- return (ENOMEM);
+ if ((ump->um_flags & UFS_QUOTA2) != 0)
+ return EOPNOTSUPP;
+
+ if (prop_array_count(datas) != 0)
+ return EINVAL;
- /*
- * Search vnodes associated with this mount point,
- * synchronizing any modified dquot structures.
- */
- mutex_enter(&mntvnode_lock);
- again:
- for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
- vmark(mvp, vp);
- mutex_enter(&vp->v_interlock);
- if (VTOI(vp) == NULL || vp->v_mount != mp || vismarker(vp) ||
- vp->v_type == VNON ||
- (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0) {
- mutex_exit(&vp->v_interlock);
- continue;
- }
- mutex_exit(&mntvnode_lock);
- error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT);
- if (error) {
- mutex_enter(&mntvnode_lock);
- if (error == ENOENT) {
- (void)vunmark(mvp);
- goto again;
- }
- continue;
- }
- for (i = 0; i < MAXQUOTAS; i++) {
- dq = VTOI(vp)->i_dquot[i];
- if (dq == NODQUOT)
- continue;
- mutex_enter(&dq->dq_interlock);
- if (dq->dq_flags & DQ_MOD)
- dqsync(vp, dq);
- mutex_exit(&dq->dq_interlock);
- }
- vput(vp);
- mutex_enter(&mntvnode_lock);
+ error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_ONOFF, mp, NULL, NULL);
+ if (error != 0) {
+ return error;
}
- mutex_exit(&mntvnode_lock);
- vnfree(mvp);
- return (0);
+#ifdef QUOTA
+ error = quota1_handle_cmd_quotaoff(l, ump, type);
+#else
+ error = EOPNOTSUPP;
+#endif
+
+ return error;
}
/*
- * Code pertaining to management of the in-core dquot data structures.
- */
-#define DQHASH(dqvp, id) \
- (((((long)(dqvp)) >> 8) + id) & dqhash)
-static LIST_HEAD(dqhashhead, dquot) *dqhashtbl;
-static u_long dqhash;
-static pool_cache_t dquot_cache;
-
-/*
* Initialize the quota system.
*/
void
@@ -838,28 +633,91 @@ dqdone(void)
}
/*
+ * Set up the quotas for an inode.
+ *
+ * This routine completely defines the semantics of quotas.
+ * If other criterion want to be used to establish quotas, the
+ * MAXQUOTAS value in quotas.h should be increased, and the
+ * additional dquots set up here.
+ */
+int
+getinoquota(struct inode *ip)
+{
+ struct ufsmount *ump = ip->i_ump;
+ struct vnode *vp = ITOV(ip);
+ int i, error;
+ u_int32_t ino_ids[MAXQUOTAS];
+
+ /*
+ * To avoid deadlocks never update quotas for quota files
+ * on the same file system
+ */
+ for (i = 0; i < MAXQUOTAS; i++)
+ if (vp == ump->um_quotas[i])
+ return 0;
+
+ ino_ids[USRQUOTA] = ip->i_uid;
+ ino_ids[GRPQUOTA] = ip->i_gid;
+ for (i = 0; i < MAXQUOTAS; i++) {
+ /*
+ * If the file id changed the quota needs update.
+ */
+ if (ip->i_dquot[i] != NODQUOT &&
+ ip->i_dquot[i]->dq_id != ino_ids[i]) {
+ dqrele(ITOV(ip), ip->i_dquot[i]);
+ ip->i_dquot[i] = NODQUOT;
+ }
+ /*
+ * Set up the quota based on file id.
+ * ENODEV means that quotas are not enabled.
+ */
+ if (ip->i_dquot[i] == NODQUOT &&
+ (error = dqget(vp, ino_ids[i], ump, i, &ip->i_dquot[i])) &&
+ error != ENODEV)
+ return (error);
+ }
+ return 0;
+}
+
+/*
* Obtain a dquot structure for the specified identifier and quota file
* reading the information from the file if necessary.
*/
-static int
+int
dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type,
struct dquot **dqp)
{
struct dquot *dq, *ndq;
struct dqhashhead *dqh;
struct vnode *dqvp;
- struct iovec aiov;
- struct uio auio;
- int error;
+ int error = 0; /* XXX gcc */
/* Lock to see an up to date value for QTF_CLOSING. */
mutex_enter(&dqlock);
- dqvp = ump->um_quotas[type];
- if (dqvp == NULLVP || (ump->um_qflags[type] & QTF_CLOSING)) {
+ if ((ump->um_flags & (UFS_QUOTA|UFS_QUOTA2)) == 0) {
mutex_exit(&dqlock);
*dqp = NODQUOT;
- return (EINVAL);
+ return (ENODEV);
+ }
+ dqvp = ump->um_quotas[type];
+#ifdef QUOTA
+ if (ump->um_flags & UFS_QUOTA) {
+ if (dqvp == NULLVP || (ump->umq1_qflags[type] & QTF_CLOSING)) {
+ mutex_exit(&dqlock);
+ *dqp = NODQUOT;
+ return (ENODEV);
+ }
}
+#endif
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2) {
+ if (dqvp == NULLVP) {
+ mutex_exit(&dqlock);
+ *dqp = NODQUOT;
+ return (ENODEV);
+ }
+ }
+#endif
KASSERT(dqvp != vp);
/*
* Check the cache first.
@@ -911,19 +769,14 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type,
dqref(dq);
mutex_enter(&dq->dq_interlock);
mutex_exit(&dqlock);
- vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY);
- auio.uio_iov = &aiov;
- auio.uio_iovcnt = 1;
- aiov.iov_base = (void *)&dq->dq_dqb;
- aiov.iov_len = sizeof (struct dqblk);
- auio.uio_resid = sizeof (struct dqblk);
- auio.uio_offset = (off_t)(id * sizeof (struct dqblk));
- auio.uio_rw = UIO_READ;
- UIO_SETUP_SYSSPACE(&auio);
- error = VOP_READ(dqvp, &auio, 0, ump->um_cred[type]);
- if (auio.uio_resid == sizeof(struct dqblk) && error == 0)
- memset((void *)&dq->dq_dqb, 0, sizeof(struct dqblk));
- VOP_UNLOCK(dqvp);
+#ifdef QUOTA
+ if (ump->um_flags & UFS_QUOTA)
+ error = dq1get(dqvp, id, ump, type, dq);
+#endif
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2)
+ error = dq2get(dqvp, id, ump, type, dq);
+#endif
/*
* I/O error in reading quota file, release
* quota structure and reflect problem to caller.
@@ -937,19 +790,6 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type,
*dqp = NODQUOT;
return (error);
}
- /*
- * Check for no limit to enforce.
- * Initialize time values if necessary.
- */
- if (dq->dq_isoftlimit == 0 && dq->dq_bsoftlimit == 0 &&
- dq->dq_ihardlimit == 0 && dq->dq_bhardlimit == 0)
- dq->dq_flags |= DQ_FAKE;
- if (dq->dq_id != 0) {
- if (dq->dq_btime == 0)
- dq->dq_btime = time_second + ump->um_btime[type];
- if (dq->dq_itime == 0)
- dq->dq_itime = time_second + ump->um_itime[type];
- }
mutex_exit(&dq->dq_interlock);
*dqp = dq;
return (0);
@@ -958,7 +798,7 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type,
/*
* Obtain a reference to a dquot.
*/
-static void
+void
dqref(struct dquot *dq)
{
@@ -970,7 +810,7 @@ dqref(struct dquot *dq)
/*
* Release a reference to a dquot.
*/
-static void
+void
dqrele(struct vnode *vp, struct dquot *dq)
{
@@ -988,7 +828,14 @@ dqrele(struct vnode *vp, struct dquot *dq)
if ((dq->dq_flags & DQ_MOD) == 0)
break;
mutex_exit(&dqlock);
- (void) dqsync(vp, dq);
+#ifdef QUOTA
+ if (dq->dq_ump->um_flags & UFS_QUOTA)
+ (void) dq1sync(vp, dq);
+#endif
+#ifdef QUOTA2
+ if (dq->dq_ump->um_flags & UFS_QUOTA2)
+ (void) dq2sync(vp, dq);
+#endif
}
KASSERT(dq->dq_cnt == 1 && (dq->dq_flags & DQ_MOD) == 0);
LIST_REMOVE(dq, dq_hash);
@@ -998,47 +845,26 @@ dqrele(struct vnode *vp, struct dquot *dq)
pool_cache_put(dquot_cache, dq);
}
-/*
- * Update the disk quota in the quota file.
- */
-static int
-dqsync(struct vnode *vp, struct dquot *dq)
+int
+qsync(struct mount *mp)
{
- struct vnode *dqvp;
- struct iovec aiov;
- struct uio auio;
- int error;
-
- if (dq == NODQUOT)
- panic("dqsync: dquot");
- KASSERT(mutex_owned(&dq->dq_interlock));
- if ((dq->dq_flags & DQ_MOD) == 0)
- return (0);
- if ((dqvp = dq->dq_ump->um_quotas[dq->dq_type]) == NULLVP)
- panic("dqsync: file");
- KASSERT(dqvp != vp);
- vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY);
- auio.uio_iov = &aiov;
- auio.uio_iovcnt = 1;
- aiov.iov_base = (void *)&dq->dq_dqb;
- aiov.iov_len = sizeof (struct dqblk);
- auio.uio_resid = sizeof (struct dqblk);
- auio.uio_offset = (off_t)(dq->dq_id * sizeof (struct dqblk));
- auio.uio_rw = UIO_WRITE;
- UIO_SETUP_SYSSPACE(&auio);
- error = VOP_WRITE(dqvp, &auio, 0, dq->dq_ump->um_cred[dq->dq_type]);
- if (auio.uio_resid && error == 0)
- error = EIO;
- dq->dq_flags &= ~DQ_MOD;
- VOP_UNLOCK(dqvp);
- return (error);
+ struct ufsmount *ump = VFSTOUFS(mp);
+#ifdef QUOTA
+ if (ump->um_flags & UFS_QUOTA)
+ return q1sync(mp);
+#endif
+#ifdef QUOTA2
+ if (ump->um_flags & UFS_QUOTA2)
+ return q2sync(mp);
+#endif
+ return 0;
}
#ifdef DIAGNOSTIC
/*
* Check the hash chains for stray dquot's.
*/
-static void
+void
dqflush(struct vnode *vp)
{
struct dquot *dq;
diff --git a/sys/ufs/ufs/ufs_quota.h b/sys/ufs/ufs/ufs_quota.h
new file mode 100644
index 00000000000..efc87f1a888
--- /dev/null
+++ b/sys/ufs/ufs/ufs_quota.h
@@ -0,0 +1,130 @@
+/* $NetBSD: ufs_quota.h,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1990, 1993, 1995
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95
+ */
+#include <ufs/ufs/quota1.h>
+#include <ufs/ufs/quota2.h>
+
+/* link to this quota in the quota inode (for QUOTA2) */
+struct dq2_desc {
+ uint64_t dq2_lblkno; /* logical disk block holding this quota */
+ u_int dq2_blkoff; /* offset in disk block holding this quota */
+};
+
+/*
+ * The following structure records disk usage for a user or group on a
+ * filesystem. There is one allocated for each quota that exists on any
+ * filesystem for the current user or group. A cache is kept of recently
+ * used entries.
+ * Field markings and the corresponding locks:
+ * h: dqlock
+ * d: dq_interlock
+ *
+ * Lock order is: dq_interlock -> dqlock
+ * dq_interlock -> dqvp
+ */
+struct dquot {
+ LIST_ENTRY(dquot) dq_hash; /* h: hash list */
+ u_int16_t dq_flags; /* d: flags, see below */
+ u_int16_t dq_type; /* d: quota type of this dquot */
+ u_int32_t dq_cnt; /* h: count of active references */
+ u_int32_t dq_id; /* d: identifier this applies to */
+ struct ufsmount *dq_ump; /* d: filesystem this is taken from */
+ kmutex_t dq_interlock; /* d: lock this dquot */
+ union {
+ struct dqblk dq1_dqb; /* d: actual usage & quotas */
+ struct dq2_desc dq2_desc; /* d: pointer to quota data */
+ } dq_un;
+};
+
+/*
+ * Flag values.
+ */
+#define DQ_MOD 0x04 /* this quota modified since read */
+#define DQ_FAKE 0x08 /* no limits here, just usage */
+#define DQ_WARN(ltype) (0x10 << ltype) /* has been warned about "type" limit */
+/*
+ * Shorthand notation.
+ */
+#define dq_bhardlimit dq_un.dq1_dqb.dqb_bhardlimit
+#define dq_bsoftlimit dq_un.dq1_dqb.dqb_bsoftlimit
+#define dq_curblocks dq_un.dq1_dqb.dqb_curblocks
+#define dq_ihardlimit dq_un.dq1_dqb.dqb_ihardlimit
+#define dq_isoftlimit dq_un.dq1_dqb.dqb_isoftlimit
+#define dq_curinodes dq_un.dq1_dqb.dqb_curinodes
+#define dq_btime dq_un.dq1_dqb.dqb_btime
+#define dq_itime dq_un.dq1_dqb.dqb_itime
+
+#define dq2_lblkno dq_un.dq2_desc.dq2_lblkno
+#define dq2_blkoff dq_un.dq2_desc.dq2_blkoff
+/*
+ * If the system has never checked for a quota for this file, then it is
+ * set to NODQUOT. Once a write attempt is made the inode pointer is set
+ * to reference a dquot structure.
+ */
+#define NODQUOT NULL
+
+extern kmutex_t dqlock;
+extern kcondvar_t dqcv;
+/*
+ * Quota name to error message mapping.
+ */
+const char *quotatypes[MAXQUOTAS];
+
+int getinoquota(struct inode *);
+int dqget(struct vnode *, u_long, struct ufsmount *, int, struct dquot **);
+void dqref(struct dquot *);
+void dqrele(struct vnode *, struct dquot *);
+void dqflush(struct vnode *);
+
+int chkdq1(struct inode *, int64_t, kauth_cred_t, int);
+int chkiq1(struct inode *, int32_t, kauth_cred_t, int);
+int q1sync(struct mount *);
+int dq1get(struct vnode *, u_long, struct ufsmount *, int, struct dquot *);
+int dq1sync(struct vnode *, struct dquot *);
+int quota1_handle_cmd_get(struct ufsmount *, int, int, int, prop_array_t);
+int quota1_handle_cmd_set(struct ufsmount *, int, int, int, prop_dictionary_t);
+int quota1_handle_cmd_quotaon(struct lwp *, struct ufsmount *, int,
+ const char *);
+int quota1_handle_cmd_quotaoff(struct lwp *, struct ufsmount *, int);
+
+int chkdq2(struct inode *, int64_t, kauth_cred_t, int);
+int chkiq2(struct inode *, int32_t, kauth_cred_t, int);
+int quota2_handle_cmd_get(struct ufsmount *, int, int, int, prop_array_t);
+int quota2_handle_cmd_set(struct ufsmount *, int, int, int, prop_dictionary_t);
+int quota2_handle_cmd_clear(struct ufsmount *, int, int, int, prop_dictionary_t);
+int quota2_handle_cmd_getall(struct ufsmount *, int, prop_array_t);
+int q2sync(struct mount *);
+int dq2get(struct vnode *, u_long, struct ufsmount *, int, struct dquot *);
+int dq2sync(struct vnode *, struct dquot *);
diff --git a/sys/ufs/ufs/ufs_quota1.c b/sys/ufs/ufs/ufs_quota1.c
new file mode 100644
index 00000000000..f83af758f2b
--- /dev/null
+++ b/sys/ufs/ufs/ufs_quota1.c
@@ -0,0 +1,856 @@
+/* $NetBSD: ufs_quota1.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1990, 1993, 1995
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Robert Elz at The University of Melbourne.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota1.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/namei.h>
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/vnode.h>
+#include <sys/mount.h>
+#include <sys/kauth.h>
+
+#include <ufs/ufs/quota2_prop.h>
+#include <ufs/ufs/quota1.h>
+#include <ufs/ufs/inode.h>
+#include <ufs/ufs/ufsmount.h>
+#include <ufs/ufs/ufs_extern.h>
+#include <ufs/ufs/ufs_quota.h>
+
+static int chkdqchg(struct inode *, int64_t, kauth_cred_t, int);
+static int chkiqchg(struct inode *, int32_t, kauth_cred_t, int);
+
+/*
+ * Update disk usage, and take corrective action.
+ */
+int
+chkdq1(struct inode *ip, int64_t change, kauth_cred_t cred, int flags)
+{
+ struct dquot *dq;
+ int i;
+ int ncurblocks, error;
+
+ if ((error = getinoquota(ip)) != 0)
+ return error;
+ if (change == 0)
+ return (0);
+ if (change < 0) {
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = ip->i_dquot[i]) == NODQUOT)
+ continue;
+ mutex_enter(&dq->dq_interlock);
+ ncurblocks = dq->dq_curblocks + change;
+ if (ncurblocks >= 0)
+ dq->dq_curblocks = ncurblocks;
+ else
+ dq->dq_curblocks = 0;
+ dq->dq_flags &= ~DQ_WARN(QL_BLOCK);
+ dq->dq_flags |= DQ_MOD;
+ mutex_exit(&dq->dq_interlock);
+ }
+ return (0);
+ }
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = ip->i_dquot[i]) == NODQUOT)
+ continue;
+ if ((flags & FORCE) == 0 &&
+ kauth_authorize_system(cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_NOLIMIT, KAUTH_ARG(i),
+ KAUTH_ARG(QL_BLOCK), NULL) != 0) {
+ mutex_enter(&dq->dq_interlock);
+ error = chkdqchg(ip, change, cred, i);
+ mutex_exit(&dq->dq_interlock);
+ if (error != 0)
+ return (error);
+ }
+ }
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = ip->i_dquot[i]) == NODQUOT)
+ continue;
+ mutex_enter(&dq->dq_interlock);
+ dq->dq_curblocks += change;
+ dq->dq_flags |= DQ_MOD;
+ mutex_exit(&dq->dq_interlock);
+ }
+ return (0);
+}
+
+/*
+ * Check for a valid change to a users allocation.
+ * Issue an error message if appropriate.
+ */
+static int
+chkdqchg(struct inode *ip, int64_t change, kauth_cred_t cred, int type)
+{
+ struct dquot *dq = ip->i_dquot[type];
+ long ncurblocks = dq->dq_curblocks + change;
+
+ KASSERT(mutex_owned(&dq->dq_interlock));
+ /*
+ * If user would exceed their hard limit, disallow space allocation.
+ */
+ if (ncurblocks >= dq->dq_bhardlimit && dq->dq_bhardlimit) {
+ if ((dq->dq_flags & DQ_WARN(QL_BLOCK)) == 0 &&
+ ip->i_uid == kauth_cred_geteuid(cred)) {
+ uprintf("\n%s: write failed, %s disk limit reached\n",
+ ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ quotatypes[type]);
+ dq->dq_flags |= DQ_WARN(QL_BLOCK);
+ }
+ return (EDQUOT);
+ }
+ /*
+ * If user is over their soft limit for too long, disallow space
+ * allocation. Reset time limit as they cross their soft limit.
+ */
+ if (ncurblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) {
+ if (dq->dq_curblocks < dq->dq_bsoftlimit) {
+ dq->dq_btime =
+ time_second + ip->i_ump->umq1_btime[type];
+ if (ip->i_uid == kauth_cred_geteuid(cred))
+ uprintf("\n%s: warning, %s %s\n",
+ ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ quotatypes[type], "disk quota exceeded");
+ return (0);
+ }
+ if (time_second > dq->dq_btime) {
+ if ((dq->dq_flags & DQ_WARN(QL_BLOCK)) == 0 &&
+ ip->i_uid == kauth_cred_geteuid(cred)) {
+ uprintf("\n%s: write failed, %s %s\n",
+ ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ quotatypes[type],
+ "disk quota exceeded for too long");
+ dq->dq_flags |= DQ_WARN(QL_BLOCK);
+ }
+ return (EDQUOT);
+ }
+ }
+ return (0);
+}
+
+/*
+ * Check the inode limit, applying corrective action.
+ */
+int
+chkiq1(struct inode *ip, int32_t change, kauth_cred_t cred, int flags)
+{
+ struct dquot *dq;
+ int i;
+ int ncurinodes, error;
+
+ if ((error = getinoquota(ip)) != 0)
+ return error;
+ if (change == 0)
+ return (0);
+ if (change < 0) {
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = ip->i_dquot[i]) == NODQUOT)
+ continue;
+ mutex_enter(&dq->dq_interlock);
+ ncurinodes = dq->dq_curinodes + change;
+ if (ncurinodes >= 0)
+ dq->dq_curinodes = ncurinodes;
+ else
+ dq->dq_curinodes = 0;
+ dq->dq_flags &= ~DQ_WARN(QL_FILE);
+ dq->dq_flags |= DQ_MOD;
+ mutex_exit(&dq->dq_interlock);
+ }
+ return (0);
+ }
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = ip->i_dquot[i]) == NODQUOT)
+ continue;
+ if ((flags & FORCE) == 0 && kauth_authorize_system(cred,
+ KAUTH_SYSTEM_FS_QUOTA, KAUTH_REQ_SYSTEM_FS_QUOTA_NOLIMIT,
+ KAUTH_ARG(i), KAUTH_ARG(QL_FILE), NULL) != 0) {
+ mutex_enter(&dq->dq_interlock);
+ error = chkiqchg(ip, change, cred, i);
+ mutex_exit(&dq->dq_interlock);
+ if (error != 0)
+ return (error);
+ }
+ }
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = ip->i_dquot[i]) == NODQUOT)
+ continue;
+ mutex_enter(&dq->dq_interlock);
+ dq->dq_curinodes += change;
+ dq->dq_flags |= DQ_MOD;
+ mutex_exit(&dq->dq_interlock);
+ }
+ return (0);
+}
+
+/*
+ * Check for a valid change to a users allocation.
+ * Issue an error message if appropriate.
+ */
+static int
+chkiqchg(struct inode *ip, int32_t change, kauth_cred_t cred, int type)
+{
+ struct dquot *dq = ip->i_dquot[type];
+ long ncurinodes = dq->dq_curinodes + change;
+
+ KASSERT(mutex_owned(&dq->dq_interlock));
+ /*
+ * If user would exceed their hard limit, disallow inode allocation.
+ */
+ if (ncurinodes >= dq->dq_ihardlimit && dq->dq_ihardlimit) {
+ if ((dq->dq_flags & DQ_WARN(QL_FILE)) == 0 &&
+ ip->i_uid == kauth_cred_geteuid(cred)) {
+ uprintf("\n%s: write failed, %s inode limit reached\n",
+ ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ quotatypes[type]);
+ dq->dq_flags |= DQ_WARN(QL_FILE);
+ }
+ return (EDQUOT);
+ }
+ /*
+ * If user is over their soft limit for too long, disallow inode
+ * allocation. Reset time limit as they cross their soft limit.
+ */
+ if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) {
+ if (dq->dq_curinodes < dq->dq_isoftlimit) {
+ dq->dq_itime =
+ time_second + ip->i_ump->umq1_itime[type];
+ if (ip->i_uid == kauth_cred_geteuid(cred))
+ uprintf("\n%s: warning, %s %s\n",
+ ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ quotatypes[type], "inode quota exceeded");
+ return (0);
+ }
+ if (time_second > dq->dq_itime) {
+ if ((dq->dq_flags & DQ_WARN(QL_FILE)) == 0 &&
+ ip->i_uid == kauth_cred_geteuid(cred)) {
+ uprintf("\n%s: write failed, %s %s\n",
+ ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ quotatypes[type],
+ "inode quota exceeded for too long");
+ dq->dq_flags |= DQ_WARN(QL_FILE);
+ }
+ return (EDQUOT);
+ }
+ }
+ return (0);
+}
+
+int
+quota1_umount(struct mount *mp, int flags)
+{
+ int i, error;
+ struct ufsmount *ump = VFSTOUFS(mp);
+ struct lwp *l = curlwp;
+
+ if ((ump->um_flags & UFS_QUOTA) == 0)
+ return 0;
+
+ if ((error = vflush(mp, NULLVP, SKIPSYSTEM | flags)) != 0)
+ return (error);
+
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if (ump->um_quotas[i] != NULLVP) {
+ quota1_handle_cmd_quotaoff(l, ump, i);
+ }
+ }
+ return 0;
+}
+
+/*
+ * Code to process quotactl commands.
+ */
+
+/*
+ * set up a quota file for a particular file system.
+ */
+int
+quota1_handle_cmd_quotaon(struct lwp *l, struct ufsmount *ump, int type,
+ const char *fname)
+{
+ struct mount *mp = ump->um_mountp;
+ struct vnode *vp, **vpp, *mvp;
+ struct dquot *dq;
+ int error;
+ struct pathbuf *pb;
+ struct nameidata nd;
+
+ if (ump->um_flags & UFS_QUOTA2) {
+ uprintf("%s: quotas v2 already enabled\n",
+ mp->mnt_stat.f_mntonname);
+ return (EBUSY);
+ }
+
+ if (mp->mnt_wapbl != NULL) {
+ printf("%s: quota v1 cannot be used with -o log\n",
+ mp->mnt_stat.f_mntonname);
+ return (EOPNOTSUPP);
+ }
+
+ vpp = &ump->um_quotas[type];
+
+ pb = pathbuf_create(fname);
+ if (pb == NULL) {
+ return ENOMEM;
+ }
+ NDINIT(&nd, LOOKUP, FOLLOW, pb);
+ if ((error = vn_open(&nd, FREAD|FWRITE, 0)) != 0) {
+ pathbuf_destroy(pb);
+ return error;
+ }
+ vp = nd.ni_vp;
+ pathbuf_destroy(pb);
+
+ VOP_UNLOCK(vp);
+ if (vp->v_type != VREG) {
+ (void) vn_close(vp, FREAD|FWRITE, l->l_cred);
+ return (EACCES);
+ }
+ if (*vpp != vp)
+ quota1_handle_cmd_quotaoff(l, ump, type);
+ mutex_enter(&dqlock);
+ while ((ump->umq1_qflags[type] & (QTF_CLOSING | QTF_OPENING)) != 0)
+ cv_wait(&dqcv, &dqlock);
+ ump->umq1_qflags[type] |= QTF_OPENING;
+ mutex_exit(&dqlock);
+ mp->mnt_flag |= MNT_QUOTA;
+ vp->v_vflag |= VV_SYSTEM; /* XXXSMP */
+ *vpp = vp;
+ /*
+ * Save the credential of the process that turned on quotas.
+ * Set up the time limits for this quota.
+ */
+ kauth_cred_hold(l->l_cred);
+ ump->um_cred[type] = l->l_cred;
+ ump->umq1_btime[type] = MAX_DQ_TIME;
+ ump->umq1_itime[type] = MAX_IQ_TIME;
+ if (dqget(NULLVP, 0, ump, type, &dq) == 0) {
+ if (dq->dq_btime > 0)
+ ump->umq1_btime[type] = dq->dq_btime;
+ if (dq->dq_itime > 0)
+ ump->umq1_itime[type] = dq->dq_itime;
+ dqrele(NULLVP, dq);
+ }
+ /* Allocate a marker vnode. */
+ if ((mvp = vnalloc(mp)) == NULL) {
+ error = ENOMEM;
+ goto out;
+ }
+ /*
+ * Search vnodes associated with this mount point,
+ * adding references to quota file being opened.
+ * NB: only need to add dquot's for inodes being modified.
+ */
+ mutex_enter(&mntvnode_lock);
+again:
+ for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
+ vmark(mvp, vp);
+ mutex_enter(&vp->v_interlock);
+ if (VTOI(vp) == NULL || vp->v_mount != mp || vismarker(vp) ||
+ vp->v_type == VNON || vp->v_writecount == 0 ||
+ (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0) {
+ mutex_exit(&vp->v_interlock);
+ continue;
+ }
+ mutex_exit(&mntvnode_lock);
+ if (vget(vp, LK_EXCLUSIVE)) {
+ mutex_enter(&mntvnode_lock);
+ (void)vunmark(mvp);
+ goto again;
+ }
+ if ((error = getinoquota(VTOI(vp))) != 0) {
+ vput(vp);
+ mutex_enter(&mntvnode_lock);
+ (void)vunmark(mvp);
+ break;
+ }
+ vput(vp);
+ mutex_enter(&mntvnode_lock);
+ }
+ mutex_exit(&mntvnode_lock);
+ vnfree(mvp);
+ out:
+ mutex_enter(&dqlock);
+ ump->umq1_qflags[type] &= ~QTF_OPENING;
+ cv_broadcast(&dqcv);
+ if (error == 0)
+ ump->um_flags |= UFS_QUOTA;
+ mutex_exit(&dqlock);
+ if (error)
+ quota1_handle_cmd_quotaoff(l, ump, type);
+ return (error);
+}
+
+/*
+ * turn off disk quotas for a filesystem.
+ */
+int
+quota1_handle_cmd_quotaoff(struct lwp *l, struct ufsmount *ump, int type)
+{
+ struct mount *mp = ump->um_mountp;
+ struct vnode *vp;
+ struct vnode *qvp, *mvp;
+ struct dquot *dq;
+ struct inode *ip;
+ kauth_cred_t cred;
+ int i, error;
+
+ /* Allocate a marker vnode. */
+ if ((mvp = vnalloc(mp)) == NULL)
+ return ENOMEM;
+
+ mutex_enter(&dqlock);
+ while ((ump->umq1_qflags[type] & (QTF_CLOSING | QTF_OPENING)) != 0)
+ cv_wait(&dqcv, &dqlock);
+ if ((qvp = ump->um_quotas[type]) == NULLVP) {
+ mutex_exit(&dqlock);
+ vnfree(mvp);
+ return (0);
+ }
+ ump->umq1_qflags[type] |= QTF_CLOSING;
+ ump->um_flags &= ~UFS_QUOTA;
+ mutex_exit(&dqlock);
+ /*
+ * Search vnodes associated with this mount point,
+ * deleting any references to quota file being closed.
+ */
+ mutex_enter(&mntvnode_lock);
+again:
+ for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
+ vmark(mvp, vp);
+ mutex_enter(&vp->v_interlock);
+ if (VTOI(vp) == NULL || vp->v_mount != mp || vismarker(vp) ||
+ vp->v_type == VNON ||
+ (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0) {
+ mutex_exit(&vp->v_interlock);
+ continue;
+ }
+ mutex_exit(&mntvnode_lock);
+ if (vget(vp, LK_EXCLUSIVE)) {
+ mutex_enter(&mntvnode_lock);
+ (void)vunmark(mvp);
+ goto again;
+ }
+ ip = VTOI(vp);
+ dq = ip->i_dquot[type];
+ ip->i_dquot[type] = NODQUOT;
+ dqrele(vp, dq);
+ vput(vp);
+ mutex_enter(&mntvnode_lock);
+ }
+ mutex_exit(&mntvnode_lock);
+#ifdef DIAGNOSTIC
+ dqflush(qvp);
+#endif
+ qvp->v_vflag &= ~VV_SYSTEM;
+ error = vn_close(qvp, FREAD|FWRITE, l->l_cred);
+ mutex_enter(&dqlock);
+ ump->um_quotas[type] = NULLVP;
+ cred = ump->um_cred[type];
+ ump->um_cred[type] = NOCRED;
+ for (i = 0; i < MAXQUOTAS; i++)
+ if (ump->um_quotas[i] != NULLVP)
+ break;
+ ump->umq1_qflags[type] &= ~QTF_CLOSING;
+ cv_broadcast(&dqcv);
+ mutex_exit(&dqlock);
+ kauth_cred_free(cred);
+ if (i == MAXQUOTAS)
+ mp->mnt_flag &= ~MNT_QUOTA;
+ return (error);
+}
+
+int
+quota1_handle_cmd_get(struct ufsmount *ump, int type, int id,
+ int defaultq, prop_array_t replies)
+{
+ struct dquot *dq;
+ struct quota2_entry q2e;
+ prop_dictionary_t dict;
+ int error;
+
+ if (ump->um_quotas[type] == NULLVP)
+ return ENODEV;
+
+ if (defaultq) { /* we want the grace period of id 0 */
+ if ((error = dqget(NULLVP, 0, ump, type, &dq)) != 0)
+ return error;
+ } else {
+ if ((error = dqget(NULLVP, id, ump, type, &dq)) != 0)
+ return error;
+ }
+ dqblk2q2e(&dq->dq_un.dq1_dqb, &q2e);
+ dqrele(NULLVP, dq);
+ if (defaultq) {
+ if (q2e.q2e_val[QL_BLOCK].q2v_time > 0)
+ q2e.q2e_val[QL_BLOCK].q2v_grace =
+ q2e.q2e_val[QL_BLOCK].q2v_time;
+ else
+ q2e.q2e_val[QL_BLOCK].q2v_grace = MAX_DQ_TIME;
+ if (q2e.q2e_val[QL_FILE].q2v_time > 0)
+ q2e.q2e_val[QL_FILE].q2v_grace =
+ q2e.q2e_val[QL_FILE].q2v_time;
+ else
+ q2e.q2e_val[QL_FILE].q2v_grace = MAX_DQ_TIME;
+ }
+ dict = q2etoprop(&q2e, defaultq);
+ if (dict == NULL)
+ return ENOMEM;
+ if (!prop_array_add_and_rel(replies, dict))
+ return ENOMEM;
+ return 0;
+}
+
+int
+quota1_handle_cmd_set(struct ufsmount *ump, int type, int id,
+ int defaultq, prop_dictionary_t data)
+{
+ struct dquot *dq;
+ struct quota2_entry q2e;
+ struct dqblk dqb;
+ int error;
+
+ if (ump->um_quotas[type] == NULLVP)
+ return ENODEV;
+
+ error = quota2_dict_update_q2e_limits(data, &q2e);
+ if (error)
+ return error;
+
+ if (defaultq) {
+ /* just update grace times */
+ if ((error = dqget(NULLVP, id, ump, type, &dq)) != 0)
+ return error;
+ mutex_enter(&dq->dq_interlock);
+ if (q2e.q2e_val[QL_BLOCK].q2v_grace > 0)
+ ump->umq1_btime[type] = dq->dq_btime =
+ q2e.q2e_val[QL_BLOCK].q2v_grace;
+ if (q2e.q2e_val[QL_FILE].q2v_grace > 0)
+ ump->umq1_itime[type] = dq->dq_itime =
+ q2e.q2e_val[QL_FILE].q2v_grace;
+ mutex_exit(&dq->dq_interlock);
+ dq->dq_flags |= DQ_MOD;
+ dqrele(NULLVP, dq);
+ return 0;
+ }
+
+ q2e2dqblk(&q2e, &dqb);
+
+ if ((error = dqget(NULLVP, id, ump, type, &dq)) != 0)
+ return (error);
+ mutex_enter(&dq->dq_interlock);
+ /*
+ * Copy all but the current values.
+ * Reset time limit if previously had no soft limit or were
+ * under it, but now have a soft limit and are over it.
+ */
+ dqb.dqb_curblocks = dq->dq_curblocks;
+ dqb.dqb_curinodes = dq->dq_curinodes;
+ if (dq->dq_id != 0) {
+ dqb.dqb_btime = dq->dq_btime;
+ dqb.dqb_itime = dq->dq_itime;
+ }
+ if (dqb.dqb_bsoftlimit &&
+ dq->dq_curblocks >= dqb.dqb_bsoftlimit &&
+ (dq->dq_bsoftlimit == 0 || dq->dq_curblocks < dq->dq_bsoftlimit))
+ dqb.dqb_btime = time_second + ump->umq1_btime[type];
+ if (dqb.dqb_isoftlimit &&
+ dq->dq_curinodes >= dqb.dqb_isoftlimit &&
+ (dq->dq_isoftlimit == 0 || dq->dq_curinodes < dq->dq_isoftlimit))
+ dqb.dqb_itime = time_second + ump->umq1_itime[type];
+ dq->dq_un.dq1_dqb = dqb;
+ if (dq->dq_curblocks < dq->dq_bsoftlimit)
+ dq->dq_flags &= ~DQ_WARN(QL_BLOCK);
+ if (dq->dq_curinodes < dq->dq_isoftlimit)
+ dq->dq_flags &= ~DQ_WARN(QL_FILE);
+ if (dq->dq_isoftlimit == 0 && dq->dq_bsoftlimit == 0 &&
+ dq->dq_ihardlimit == 0 && dq->dq_bhardlimit == 0)
+ dq->dq_flags |= DQ_FAKE;
+ else
+ dq->dq_flags &= ~DQ_FAKE;
+ dq->dq_flags |= DQ_MOD;
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+ return (0);
+}
+
+
+#if 0
+/*
+ * Q_SETQUOTA - assign an entire dqblk structure.
+ */
+int
+setquota1(struct mount *mp, u_long id, int type, struct dqblk *dqb)
+{
+ struct dquot *dq;
+ struct dquot *ndq;
+ struct ufsmount *ump = VFSTOUFS(mp);
+
+
+ if ((error = dqget(NULLVP, id, ump, type, &ndq)) != 0)
+ return (error);
+ dq = ndq;
+ mutex_enter(&dq->dq_interlock);
+ /*
+ * Copy all but the current values.
+ * Reset time limit if previously had no soft limit or were
+ * under it, but now have a soft limit and are over it.
+ */
+ dqb->dqb_curblocks = dq->dq_curblocks;
+ dqb->dqb_curinodes = dq->dq_curinodes;
+ if (dq->dq_id != 0) {
+ dqb->dqb_btime = dq->dq_btime;
+ dqb->dqb_itime = dq->dq_itime;
+ }
+ if (dqb->dqb_bsoftlimit &&
+ dq->dq_curblocks >= dqb->dqb_bsoftlimit &&
+ (dq->dq_bsoftlimit == 0 || dq->dq_curblocks < dq->dq_bsoftlimit))
+ dqb->dqb_btime = time_second + ump->umq1_btime[type];
+ if (dqb->dqb_isoftlimit &&
+ dq->dq_curinodes >= dqb->dqb_isoftlimit &&
+ (dq->dq_isoftlimit == 0 || dq->dq_curinodes < dq->dq_isoftlimit))
+ dqb->dqb_itime = time_second + ump->umq1_itime[type];
+ dq->dq_un.dq1_dqb = *dqb;
+ if (dq->dq_curblocks < dq->dq_bsoftlimit)
+ dq->dq_flags &= ~DQ_WARN(QL_BLOCK);
+ if (dq->dq_curinodes < dq->dq_isoftlimit)
+ dq->dq_flags &= ~DQ_WARN(QL_FILE);
+ if (dq->dq_isoftlimit == 0 && dq->dq_bsoftlimit == 0 &&
+ dq->dq_ihardlimit == 0 && dq->dq_bhardlimit == 0)
+ dq->dq_flags |= DQ_FAKE;
+ else
+ dq->dq_flags &= ~DQ_FAKE;
+ dq->dq_flags |= DQ_MOD;
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+ return (0);
+}
+
+/*
+ * Q_SETUSE - set current inode and block usage.
+ */
+int
+setuse(struct mount *mp, u_long id, int type, void *addr)
+{
+ struct dquot *dq;
+ struct ufsmount *ump = VFSTOUFS(mp);
+ struct dquot *ndq;
+ struct dqblk usage;
+ int error;
+
+ error = copyin(addr, (void *)&usage, sizeof (struct dqblk));
+ if (error)
+ return (error);
+ if ((error = dqget(NULLVP, id, ump, type, &ndq)) != 0)
+ return (error);
+ dq = ndq;
+ mutex_enter(&dq->dq_interlock);
+ /*
+ * Reset time limit if have a soft limit and were
+ * previously under it, but are now over it.
+ */
+ if (dq->dq_bsoftlimit && dq->dq_curblocks < dq->dq_bsoftlimit &&
+ usage.dqb_curblocks >= dq->dq_bsoftlimit)
+ dq->dq_btime = time_second + ump->umq1_btime[type];
+ if (dq->dq_isoftlimit && dq->dq_curinodes < dq->dq_isoftlimit &&
+ usage.dqb_curinodes >= dq->dq_isoftlimit)
+ dq->dq_itime = time_second + ump->umq1_itime[type];
+ dq->dq_curblocks = usage.dqb_curblocks;
+ dq->dq_curinodes = usage.dqb_curinodes;
+ if (dq->dq_curblocks < dq->dq_bsoftlimit)
+ dq->dq_flags &= ~DQ_WARN(QL_BLOCK);
+ if (dq->dq_curinodes < dq->dq_isoftlimit)
+ dq->dq_flags &= ~DQ_WARN(QL_FILE);
+ dq->dq_flags |= DQ_MOD;
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+ return (0);
+}
+#endif
+
+/*
+ * Q_SYNC - sync quota files to disk.
+ */
+int
+q1sync(struct mount *mp)
+{
+ struct ufsmount *ump = VFSTOUFS(mp);
+ struct vnode *vp, *mvp;
+ struct dquot *dq;
+ int i, error;
+
+ /*
+ * Check if the mount point has any quotas.
+ * If not, simply return.
+ */
+ for (i = 0; i < MAXQUOTAS; i++)
+ if (ump->um_quotas[i] != NULLVP)
+ break;
+ if (i == MAXQUOTAS)
+ return (0);
+
+ /* Allocate a marker vnode. */
+ if ((mvp = vnalloc(mp)) == NULL)
+ return (ENOMEM);
+
+ /*
+ * Search vnodes associated with this mount point,
+ * synchronizing any modified dquot structures.
+ */
+ mutex_enter(&mntvnode_lock);
+ again:
+ for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
+ vmark(mvp, vp);
+ mutex_enter(&vp->v_interlock);
+ if (VTOI(vp) == NULL || vp->v_mount != mp || vismarker(vp) ||
+ vp->v_type == VNON ||
+ (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0) {
+ mutex_exit(&vp->v_interlock);
+ continue;
+ }
+ mutex_exit(&mntvnode_lock);
+ error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT);
+ if (error) {
+ mutex_enter(&mntvnode_lock);
+ if (error == ENOENT) {
+ (void)vunmark(mvp);
+ goto again;
+ }
+ continue;
+ }
+ for (i = 0; i < MAXQUOTAS; i++) {
+ dq = VTOI(vp)->i_dquot[i];
+ if (dq == NODQUOT)
+ continue;
+ mutex_enter(&dq->dq_interlock);
+ if (dq->dq_flags & DQ_MOD)
+ dq1sync(vp, dq);
+ mutex_exit(&dq->dq_interlock);
+ }
+ vput(vp);
+ mutex_enter(&mntvnode_lock);
+ }
+ mutex_exit(&mntvnode_lock);
+ vnfree(mvp);
+ return (0);
+}
+
+/*
+ * Obtain a dquot structure for the specified identifier and quota file
+ * reading the information from the file if necessary.
+ */
+int
+dq1get(struct vnode *dqvp, u_long id, struct ufsmount *ump, int type,
+ struct dquot *dq)
+{
+ struct iovec aiov;
+ struct uio auio;
+ int error;
+
+ KASSERT(mutex_owned(&dq->dq_interlock));
+ vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY);
+ auio.uio_iov = &aiov;
+ auio.uio_iovcnt = 1;
+ aiov.iov_base = (void *)&dq->dq_un.dq1_dqb;
+ aiov.iov_len = sizeof (struct dqblk);
+ auio.uio_resid = sizeof (struct dqblk);
+ auio.uio_offset = (off_t)(id * sizeof (struct dqblk));
+ auio.uio_rw = UIO_READ;
+ UIO_SETUP_SYSSPACE(&auio);
+ error = VOP_READ(dqvp, &auio, 0, ump->um_cred[type]);
+ if (auio.uio_resid == sizeof(struct dqblk) && error == 0)
+ memset((void *)&dq->dq_un.dq1_dqb, 0, sizeof(struct dqblk));
+ VOP_UNLOCK(dqvp);
+ /*
+ * I/O error in reading quota file, release
+ * quota structure and reflect problem to caller.
+ */
+ if (error)
+ return (error);
+ /*
+ * Check for no limit to enforce.
+ * Initialize time values if necessary.
+ */
+ if (dq->dq_isoftlimit == 0 && dq->dq_bsoftlimit == 0 &&
+ dq->dq_ihardlimit == 0 && dq->dq_bhardlimit == 0)
+ dq->dq_flags |= DQ_FAKE;
+ if (dq->dq_id != 0) {
+ if (dq->dq_btime == 0)
+ dq->dq_btime = time_second + ump->umq1_btime[type];
+ if (dq->dq_itime == 0)
+ dq->dq_itime = time_second + ump->umq1_itime[type];
+ }
+ return (0);
+}
+
+/*
+ * Update the disk quota in the quota file.
+ */
+int
+dq1sync(struct vnode *vp, struct dquot *dq)
+{
+ struct vnode *dqvp;
+ struct iovec aiov;
+ struct uio auio;
+ int error;
+
+ if (dq == NODQUOT)
+ panic("dq1sync: dquot");
+ KASSERT(mutex_owned(&dq->dq_interlock));
+ if ((dq->dq_flags & DQ_MOD) == 0)
+ return (0);
+ if ((dqvp = dq->dq_ump->um_quotas[dq->dq_type]) == NULLVP)
+ panic("dq1sync: file");
+ KASSERT(dqvp != vp);
+ vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY);
+ auio.uio_iov = &aiov;
+ auio.uio_iovcnt = 1;
+ aiov.iov_base = (void *)&dq->dq_un.dq1_dqb;
+ aiov.iov_len = sizeof (struct dqblk);
+ auio.uio_resid = sizeof (struct dqblk);
+ auio.uio_offset = (off_t)(dq->dq_id * sizeof (struct dqblk));
+ auio.uio_rw = UIO_WRITE;
+ UIO_SETUP_SYSSPACE(&auio);
+ error = VOP_WRITE(dqvp, &auio, 0, dq->dq_ump->um_cred[dq->dq_type]);
+ if (auio.uio_resid && error == 0)
+ error = EIO;
+ dq->dq_flags &= ~DQ_MOD;
+ VOP_UNLOCK(dqvp);
+ return (error);
+}
diff --git a/sys/ufs/ufs/ufs_quota2.c b/sys/ufs/ufs/ufs_quota2.c
new file mode 100644
index 00000000000..d8724427b53
--- /dev/null
+++ b/sys/ufs/ufs/ufs_quota2.c
@@ -0,0 +1,953 @@
+/* $NetBSD: ufs_quota2.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $ */
+/*-
+ * Copyright (c) 2010 Manuel Bouyer
+ * All rights reserved.
+ * This software is distributed under the following condiions
+ * compliant with the NetBSD foundation policy.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota2.c,v 1.2 2011/03/06 17:08:39 bouyer Exp $");
+
+#include <sys/buf.h>
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/namei.h>
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/vnode.h>
+#include <sys/mount.h>
+#include <sys/fstrans.h>
+#include <sys/kauth.h>
+#include <sys/wapbl.h>
+
+#include <ufs/ufs/quota2.h>
+#include <ufs/ufs/inode.h>
+#include <ufs/ufs/ufsmount.h>
+#include <ufs/ufs/ufs_bswap.h>
+#include <ufs/ufs/ufs_extern.h>
+#include <ufs/ufs/ufs_quota.h>
+#include <ufs/ufs/ufs_wapbl.h>
+#include <ufs/ufs/quota2_prop.h>
+
+/*
+ * LOCKING:
+ * Data in the entries are protected by the associated struct dquot's
+ * dq_interlock (this means we can't read or change a quota entry without
+ * grabing a dquot for it).
+ * The header and lists (including pointers in the data entries, and q2e_uid)
+ * are protected by the global dqlock.
+ * the locking order is dq_interlock -> dqlock
+ */
+
+static int quota2_bwrite(struct mount *, struct buf *);
+static int getinoquota2(struct inode *, bool, bool, struct buf **,
+ struct quota2_entry **);
+static int getq2h(struct ufsmount *, int, struct buf **,
+ struct quota2_header **, int);
+static int getq2e(struct ufsmount *, int, daddr_t, int, struct buf **,
+ struct quota2_entry **, int);
+static int quota2_walk_list(struct ufsmount *, struct buf *, int,
+ uint64_t *, int, void *,
+ int (*func)(struct ufsmount *, uint64_t *, struct quota2_entry *,
+ uint64_t, void *));
+
+static const char *valtypes[] = INITQLNAMES;
+
+static int
+quota2_bwrite(struct mount *mp, struct buf *bp)
+{
+ if (mp->mnt_flag & MNT_SYNCHRONOUS)
+ return bwrite(bp);
+ else {
+ bdwrite(bp);
+ return 0;
+ }
+}
+
+static int
+getq2h(struct ufsmount *ump, int type,
+ struct buf **bpp, struct quota2_header **q2hp, int flags)
+{
+#ifdef FFS_EI
+ const int needswap = UFS_MPNEEDSWAP(ump);
+#endif
+ int error;
+ struct buf *bp;
+ struct quota2_header *q2h;
+
+ KASSERT(mutex_owned(&dqlock));
+ error = bread(ump->um_quotas[type], 0, ump->umq2_bsize,
+ ump->um_cred[type], flags, &bp);
+ if (error)
+ return error;
+ if (bp->b_resid != 0)
+ panic("dq2get: %s quota file truncated", quotatypes[type]);
+
+ q2h = (void *)bp->b_data;
+ if (ufs_rw32(q2h->q2h_magic_number, needswap) != Q2_HEAD_MAGIC ||
+ q2h->q2h_type != type)
+ panic("dq2get: corrupted %s quota header", quotatypes[type]);
+ *bpp = bp;
+ *q2hp = q2h;
+ return 0;
+}
+
+static int
+getq2e(struct ufsmount *ump, int type, daddr_t lblkno, int blkoffset,
+ struct buf **bpp, struct quota2_entry **q2ep, int flags)
+{
+ int error;
+ struct buf *bp;
+
+ if (blkoffset & (sizeof(uint64_t) - 1)) {
+ panic("dq2get: %s quota file corrupted",
+ quotatypes[type]);
+ }
+ error = bread(ump->um_quotas[type], lblkno, ump->umq2_bsize,
+ ump->um_cred[type], flags, &bp);
+ if (error)
+ return error;
+ if (bp->b_resid != 0) {
+ panic("dq2get: %s quota file corrupted",
+ quotatypes[type]);
+ }
+ *q2ep = (void *)((char *)bp->b_data + blkoffset);
+ *bpp = bp;
+ return 0;
+}
+
+/* walk a quota entry list, calling the callback for each entry */
+#define Q2WL_ABORT 0x10000000
+
+static int
+quota2_walk_list(struct ufsmount *ump, struct buf *hbp, int type,
+ uint64_t *offp, int flags, void *a,
+ int (*func)(struct ufsmount *, uint64_t *, struct quota2_entry *, uint64_t, void *))
+{
+#ifdef FFS_EI
+ const int needswap = UFS_MPNEEDSWAP(ump);
+#endif
+ daddr_t off = ufs_rw64(*offp, needswap);
+ struct buf *bp, *obp = hbp;
+ int ret = 0, ret2 = 0;
+ struct quota2_entry *q2e;
+ daddr_t lblkno, blkoff, olblkno = 0;
+
+ KASSERT(mutex_owner(&dqlock));
+
+ while (off != 0) {
+ lblkno = (off >> ump->um_mountp->mnt_fs_bshift);
+ blkoff = (off & ump->umq2_bmask);
+ if (lblkno == 0) {
+ /* in the header block */
+ bp = hbp;
+ } else if (lblkno == olblkno) {
+ /* still in the same buf */
+ bp = obp;
+ } else {
+ ret = bread(ump->um_quotas[type], lblkno,
+ ump->umq2_bsize,
+ ump->um_cred[type], flags, &bp);
+ if (ret)
+ return ret;
+ if (bp->b_resid != 0) {
+ panic("quota2_walk_list: %s quota file corrupted",
+ quotatypes[type]);
+ }
+ }
+ q2e = (void *)((char *)(bp->b_data) + blkoff);
+ ret = (*func)(ump, offp, q2e, off, a);
+ if (off != ufs_rw64(*offp, needswap)) {
+ /* callback changed parent's pointer, redo */
+ off = ufs_rw64(*offp, needswap);
+ if (bp != hbp && bp != obp)
+ ret2 = bwrite(bp);
+ } else {
+ /* parent if now current */
+ if (obp != bp && obp != hbp) {
+ if (flags & B_MODIFY)
+ ret2 = bwrite(obp);
+ else
+ brelse(obp, 0);
+ }
+ obp = bp;
+ olblkno = lblkno;
+ offp = &(q2e->q2e_next);
+ off = ufs_rw64(*offp, needswap);
+ }
+ if (ret)
+ break;
+ if (ret2) {
+ ret = ret2;
+ break;
+ }
+ }
+ if (obp != hbp) {
+ if (flags & B_MODIFY)
+ ret2 = bwrite(obp);
+ else
+ brelse(obp, 0);
+ }
+ if (ret & Q2WL_ABORT)
+ return 0;
+ if (ret == 0)
+ return ret2;
+ return ret;
+}
+
+int
+quota2_umount(struct mount *mp, int flags)
+{
+ int i, error;
+ struct ufsmount *ump = VFSTOUFS(mp);
+
+ if ((ump->um_flags & UFS_QUOTA2) == 0)
+ return 0;
+
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if (ump->um_quotas[i] != NULLVP) {
+ error = vn_close(ump->um_quotas[i], FREAD|FWRITE,
+ ump->um_cred[i]);
+ if (error) {
+ printf("quota2_umount failed: close(%p) %d\n",
+ ump->um_quotas[i], error);
+ return error;
+ }
+ }
+ ump->um_quotas[i] = NULLVP;
+ }
+ return 0;
+}
+
+static int
+quota2_q2ealloc(struct ufsmount *ump, int type, uid_t uid, struct dquot *dq,
+ struct buf **bpp, struct quota2_entry **q2ep)
+{
+ int error, error2;
+ struct buf *hbp, *bp;
+ struct quota2_header *q2h;
+ struct quota2_entry *q2e;
+ daddr_t offset;
+ u_long hash_mask;
+ const int needswap = UFS_MPNEEDSWAP(ump);
+
+ KASSERT(mutex_owned(&dq->dq_interlock));
+ KASSERT(mutex_owned(&dqlock));
+ error = getq2h(ump, type, &hbp, &q2h, B_MODIFY);
+ if (error)
+ return error;
+ offset = ufs_rw64(q2h->q2h_free, needswap);
+ if (offset == 0) {
+ struct vnode *vp = ump->um_quotas[type];
+ struct inode *ip = VTOI(vp);
+ uint64_t size = ip->i_size;
+ /* need to alocate a new disk block */
+ error = UFS_BALLOC(vp, size, ump->umq2_bsize,
+ ump->um_cred[type], B_CLRBUF | B_SYNC, &bp);
+ if (error) {
+ brelse(hbp, 0);
+ return error;
+ }
+ KASSERT((ip->i_size % ump->umq2_bsize) == 0);
+ ip->i_size += ump->umq2_bsize;
+ DIP_ASSIGN(ip, size, ip->i_size);
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ uvm_vnp_setsize(vp, ip->i_size);
+ quota2_addfreeq2e(q2h, bp->b_data, size, ump->umq2_bsize,
+ needswap);
+ error = bwrite(bp);
+ error2 = UFS_UPDATE(vp, NULL, NULL, UPDATE_WAIT);
+ if (error || error2) {
+ brelse(hbp, 0);
+ if (error)
+ return error;
+ return error2;
+ }
+ offset = ufs_rw64(q2h->q2h_free, needswap);
+ KASSERT(offset != 0);
+ }
+ dq->dq2_lblkno = (offset >> ump->um_mountp->mnt_fs_bshift);
+ dq->dq2_blkoff = (offset & ump->umq2_bmask);
+ if (dq->dq2_lblkno == 0) {
+ bp = hbp;
+ q2e = (void *)((char *)bp->b_data + dq->dq2_blkoff);
+ } else {
+ error = getq2e(ump, type, dq->dq2_lblkno,
+ dq->dq2_blkoff, &bp, &q2e, B_MODIFY);
+ if (error) {
+ brelse(hbp, 0);
+ return error;
+ }
+ }
+ hash_mask = ((1 << q2h->q2h_hash_shift) - 1);
+ /* remove from free list */
+ q2h->q2h_free = q2e->q2e_next;
+
+ memcpy(q2e, &q2h->q2h_defentry, sizeof(*q2e));
+ q2e->q2e_uid = ufs_rw32(uid, needswap);
+ /* insert in hash list */
+ q2e->q2e_next = q2h->q2h_entries[uid & hash_mask];
+ q2h->q2h_entries[uid & hash_mask] = ufs_rw64(offset, needswap);
+ if (hbp != bp) {
+ bwrite(hbp);
+ }
+ *q2ep = q2e;
+ *bpp = bp;
+ return 0;
+}
+
+static int
+getinoquota2(struct inode *ip, bool alloc, bool modify, struct buf **bpp,
+ struct quota2_entry **q2ep)
+{
+ int error;
+ int i;
+ struct dquot *dq;
+ struct ufsmount *ump = ip->i_ump;
+ u_int32_t ino_ids[MAXQUOTAS];
+
+ error = getinoquota(ip);
+ if (error)
+ return error;
+
+ if (alloc) {
+ UFS_WAPBL_JLOCK_ASSERT(ump->um_mountp);
+ }
+ ino_ids[USRQUOTA] = ip->i_uid;
+ ino_ids[GRPQUOTA] = ip->i_gid;
+ /* first get the interlock for all dquot */
+ for (i = 0; i < MAXQUOTAS; i++) {
+ dq = ip->i_dquot[i];
+ if (dq == NODQUOT)
+ continue;
+ mutex_enter(&dq->dq_interlock);
+ }
+ /* now get the corresponding quota entry */
+ for (i = 0; i < MAXQUOTAS; i++) {
+ bpp[i] = NULL;
+ q2ep[i] = NULL;
+ dq = ip->i_dquot[i];
+ if (dq == NODQUOT)
+ continue;
+ if (__predict_false(ump->um_quotas[i] == NULL)) {
+ /*
+ * quotas have been turned off. This can happen
+ * at umount time.
+ */
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+ ip->i_dquot[i] = NULL;
+ continue;
+ }
+
+ if ((dq->dq2_lblkno | dq->dq2_blkoff) == 0) {
+ if (!alloc) {
+ continue;
+ }
+ /* need to alloc a new on-disk quot */
+ mutex_enter(&dqlock);
+ error = quota2_q2ealloc(ump, i, ino_ids[i], dq,
+ &bpp[i], &q2ep[i]);
+ mutex_exit(&dqlock);
+ if (error)
+ return error;
+ } else {
+ error = getq2e(ump, i, dq->dq2_lblkno,
+ dq->dq2_blkoff, &bpp[i], &q2ep[i],
+ modify ? B_MODIFY : 0);
+ if (error)
+ return error;
+ }
+ }
+ return 0;
+}
+
+static int
+quota2_check(struct inode *ip, int vtype, int64_t change, kauth_cred_t cred,
+ int flags)
+{
+ int error;
+ struct buf *bp[MAXQUOTAS];
+ struct quota2_entry *q2e[MAXQUOTAS];
+ struct quota2_val *q2vp;
+ struct dquot *dq;
+ uint64_t ncurblks;
+ struct ufsmount *ump = ip->i_ump;
+ struct mount *mp = ump->um_mountp;
+ const int needswap = UFS_MPNEEDSWAP(ump);
+ int i;
+
+ if ((error = getinoquota2(ip, change > 0, change != 0, bp, q2e)) != 0)
+ return error;
+ if (change == 0) {
+ for (i = 0; i < MAXQUOTAS; i++) {
+ dq = ip->i_dquot[i];
+ if (dq == NODQUOT)
+ continue;
+ if (bp[i])
+ brelse(bp[i], 0);
+ mutex_exit(&dq->dq_interlock);
+ }
+ return 0;
+ }
+ if (change < 0) {
+ for (i = 0; i < MAXQUOTAS; i++) {
+ dq = ip->i_dquot[i];
+ if (dq == NODQUOT)
+ continue;
+ if (q2e[i] == NULL) {
+ mutex_exit(&dq->dq_interlock);
+ continue;
+ }
+ q2vp = &q2e[i]->q2e_val[vtype];
+ ncurblks = ufs_rw64(q2vp->q2v_cur, needswap);
+ if (ncurblks < -change)
+ ncurblks = 0;
+ else
+ ncurblks += change;
+ q2vp->q2v_cur = ufs_rw64(ncurblks, needswap);
+ quota2_bwrite(mp, bp[i]);
+ mutex_exit(&dq->dq_interlock);
+ }
+ return 0;
+ }
+ /* see if the allocation is allowed */
+ for (i = 0; i < MAXQUOTAS; i++) {
+ struct quota2_val q2v;
+ int ql_stat;
+ dq = ip->i_dquot[i];
+ if (dq == NODQUOT)
+ continue;
+ KASSERT(q2e[i] != NULL);
+ quota2_ufs_rwq2v(&q2e[i]->q2e_val[vtype], &q2v, needswap);
+ ql_stat = quota2_check_limit(&q2v, change, time_second);
+
+ if ((flags & FORCE) == 0 &&
+ kauth_authorize_system(cred, KAUTH_SYSTEM_FS_QUOTA,
+ KAUTH_REQ_SYSTEM_FS_QUOTA_NOLIMIT,
+ KAUTH_ARG(i), KAUTH_ARG(vtype), NULL) != 0) {
+ /* enforce this limit */
+ switch(QL_STATUS(ql_stat)) {
+ case QL_S_DENY_HARD:
+ if ((dq->dq_flags & DQ_WARN(vtype)) == 0) {
+ uprintf("\n%s: write failed, %s %s "
+ "limit reached\n",
+ mp->mnt_stat.f_mntonname,
+ quotatypes[i], valtypes[vtype]);
+ dq->dq_flags |= DQ_WARN(vtype);
+ }
+ error = EDQUOT;
+ break;
+ case QL_S_DENY_GRACE:
+ if ((dq->dq_flags & DQ_WARN(vtype)) == 0) {
+ uprintf("\n%s: write failed, %s %s "
+ "limit reached\n",
+ mp->mnt_stat.f_mntonname,
+ quotatypes[i], valtypes[vtype]);
+ dq->dq_flags |= DQ_WARN(vtype);
+ }
+ error = EDQUOT;
+ break;
+ case QL_S_ALLOW_SOFT:
+ if ((dq->dq_flags & DQ_WARN(vtype)) == 0) {
+ uprintf("\n%s: warning, %s %s "
+ "quota exceeded\n",
+ mp->mnt_stat.f_mntonname,
+ quotatypes[i], valtypes[vtype]);
+ dq->dq_flags |= DQ_WARN(vtype);
+ }
+ break;
+ }
+ }
+ /*
+ * always do this; we don't know if the allocation will
+ * succed or not in the end. if we don't do the allocation
+ * q2v_time will be ignored anyway
+ */
+ if (ql_stat & QL_F_CROSS) {
+ q2v.q2v_time = time_second + q2v.q2v_grace;
+ quota2_ufs_rwq2v(&q2v, &q2e[i]->q2e_val[vtype],
+ needswap);
+ }
+ }
+
+ /* now do the allocation if allowed */
+ for (i = 0; i < MAXQUOTAS; i++) {
+ dq = ip->i_dquot[i];
+ if (dq == NODQUOT)
+ continue;
+ KASSERT(q2e[i] != NULL);
+ if (error == 0) {
+ q2vp = &q2e[i]->q2e_val[vtype];
+ ncurblks = ufs_rw64(q2vp->q2v_cur, needswap);
+ q2vp->q2v_cur = ufs_rw64(ncurblks + change, needswap);
+ quota2_bwrite(mp, bp[i]);
+ } else
+ brelse(bp[i], 0);
+ mutex_exit(&dq->dq_interlock);
+ }
+ return error;
+}
+
+int
+chkdq2(struct inode *ip, int64_t change, kauth_cred_t cred, int flags)
+{
+ return quota2_check(ip, QL_BLOCK, change, cred, flags);
+}
+
+int
+chkiq2(struct inode *ip, int32_t change, kauth_cred_t cred, int flags)
+{
+ return quota2_check(ip, QL_FILE, change, cred, flags);
+}
+
+int
+quota2_handle_cmd_set(struct ufsmount *ump, int type, int id,
+ int defaultq, prop_dictionary_t data)
+{
+ int error;
+ struct dquot *dq;
+ struct quota2_header *q2h;
+ struct quota2_entry q2e, *q2ep;
+ struct buf *bp;
+ const int needswap = UFS_MPNEEDSWAP(ump);
+
+ if (ump->um_quotas[type] == NULLVP)
+ return ENODEV;
+ error = UFS_WAPBL_BEGIN(ump->um_mountp);
+ if (error)
+ return error;
+
+ if (defaultq) {
+ mutex_enter(&dqlock);
+ error = getq2h(ump, type, &bp, &q2h, B_MODIFY);
+ if (error) {
+ mutex_exit(&dqlock);
+ goto out_wapbl;
+ }
+ quota2_ufs_rwq2e(&q2h->q2h_defentry, &q2e, needswap);
+ error = quota2_dict_update_q2e_limits(data, &q2e);
+ if (error) {
+ mutex_exit(&dqlock);
+ brelse(bp, 0);
+ goto out_wapbl;
+ }
+ quota2_ufs_rwq2e(&q2e, &q2h->q2h_defentry, needswap);
+ mutex_exit(&dqlock);
+ quota2_bwrite(ump->um_mountp, bp);
+ goto out_wapbl;
+ }
+
+ error = dqget(NULLVP, id, ump, type, &dq);
+ if (error)
+ goto out_wapbl;
+
+ mutex_enter(&dq->dq_interlock);
+ if (dq->dq2_lblkno == 0 && dq->dq2_blkoff == 0) {
+ /* need to alloc a new on-disk quot */
+ mutex_enter(&dqlock);
+ error = quota2_q2ealloc(ump, type, id, dq, &bp, &q2ep);
+ mutex_exit(&dqlock);
+ } else {
+ error = getq2e(ump, type, dq->dq2_lblkno, dq->dq2_blkoff,
+ &bp, &q2ep, B_MODIFY);
+ }
+ if (error)
+ goto out_il;
+
+ quota2_ufs_rwq2e(q2ep, &q2e, needswap);
+ error = quota2_dict_update_q2e_limits(data, &q2e);
+ if (error) {
+ brelse(bp, 0);
+ goto out_il;
+ }
+ quota2_ufs_rwq2e(&q2e, q2ep, needswap);
+ quota2_bwrite(ump->um_mountp, bp);
+
+out_il:
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+out_wapbl:
+ UFS_WAPBL_END(ump->um_mountp);
+ return error;
+}
+
+struct dq2clear_callback {
+ uid_t id;
+ struct dquot *dq;
+ struct quota2_header *q2h;
+};
+
+static int
+dq2clear_callback(struct ufsmount *ump, uint64_t *offp, struct quota2_entry *q2e,
+ uint64_t off, void *v)
+{
+ struct dq2clear_callback *c = v;
+#ifdef FFS_EI
+ const int needswap = UFS_MPNEEDSWAP(ump);
+#endif
+ uint64_t myoff;
+
+ if (ufs_rw32(q2e->q2e_uid, needswap) == c->id) {
+ KASSERT(mutex_owned(&c->dq->dq_interlock));
+ c->dq->dq2_lblkno = 0;
+ c->dq->dq2_blkoff = 0;
+ myoff = *offp;
+ /* remove from hash list */
+ *offp = q2e->q2e_next;
+ /* add to free list */
+ q2e->q2e_next = c->q2h->q2h_free;
+ c->q2h->q2h_free = myoff;
+ return Q2WL_ABORT;
+ }
+ return 0;
+}
+int
+quota2_handle_cmd_clear(struct ufsmount *ump, int type, int id,
+ int defaultq, prop_dictionary_t data)
+{
+ int error, i;
+ struct dquot *dq;
+ struct quota2_header *q2h;
+ struct quota2_entry q2e, *q2ep;
+ struct buf *hbp, *bp;
+ u_long hash_mask;
+ struct dq2clear_callback c;
+
+ if (ump->um_quotas[type] == NULLVP)
+ return ENODEV;
+ if (defaultq)
+ return EOPNOTSUPP;
+
+ /* get the default entry before locking the entry's buffer */
+ mutex_enter(&dqlock);
+ error = getq2h(ump, type, &hbp, &q2h, 0);
+ if (error) {
+ mutex_exit(&dqlock);
+ return error;
+ }
+ /* we'll copy to another disk entry, so no need to swap */
+ memcpy(&q2e, &q2h->q2h_defentry, sizeof(q2e));
+ mutex_exit(&dqlock);
+ brelse(hbp, 0);
+
+ error = dqget(NULLVP, id, ump, type, &dq);
+ if (error)
+ return error;
+
+ mutex_enter(&dq->dq_interlock);
+ if (dq->dq2_lblkno == 0 && dq->dq2_blkoff == 0) {
+ /* already clear, nothing to do */
+ error = ENOENT;
+ goto out_il;
+ }
+ error = UFS_WAPBL_BEGIN(ump->um_mountp);
+ if (error)
+ goto out_dq;
+
+ error = getq2e(ump, type, dq->dq2_lblkno, dq->dq2_blkoff,
+ &bp, &q2ep, B_MODIFY);
+ if (error)
+ goto out_wapbl;
+
+ if (q2ep->q2e_val[QL_BLOCK].q2v_cur != 0 ||
+ q2ep->q2e_val[QL_FILE].q2v_cur != 0) {
+ /* can't free this entry; revert to default */
+ for (i = 0; i < N_QL; i++) {
+ q2ep->q2e_val[i].q2v_softlimit =
+ q2e.q2e_val[i].q2v_softlimit;
+ q2ep->q2e_val[i].q2v_hardlimit =
+ q2e.q2e_val[i].q2v_hardlimit;
+ q2ep->q2e_val[i].q2v_grace =
+ q2e.q2e_val[i].q2v_grace;
+ q2ep->q2e_val[i].q2v_time = 0;
+ }
+ quota2_bwrite(ump->um_mountp, bp);
+ goto out_wapbl;
+ }
+ /* we can free it. release bp so we can walk the list */
+ brelse(bp, 0);
+ mutex_enter(&dqlock);
+ error = getq2h(ump, type, &hbp, &q2h, 0);
+ if (error)
+ goto out_dqlock;
+
+ hash_mask = ((1 << q2h->q2h_hash_shift) - 1);
+ c.dq = dq;
+ c.id = id;
+ c.q2h = q2h;
+ error = quota2_walk_list(ump, hbp, type,
+ &q2h->q2h_entries[id & hash_mask], B_MODIFY, &c,
+ dq2clear_callback);
+
+ bwrite(hbp);
+
+out_dqlock:
+ mutex_exit(&dqlock);
+out_wapbl:
+ UFS_WAPBL_END(ump->um_mountp);
+out_il:
+ mutex_exit(&dq->dq_interlock);
+out_dq:
+ dqrele(NULLVP, dq);
+ return error;
+}
+
+static int
+quota2_array_add_q2e(struct ufsmount *ump, int type,
+ int id, prop_array_t replies)
+{
+ struct dquot *dq;
+ int error;
+ struct quota2_entry *q2ep, q2e;
+ struct buf *bp;
+ const int needswap = UFS_MPNEEDSWAP(ump);
+ prop_dictionary_t dict;
+
+ error = dqget(NULLVP, id, ump, type, &dq);
+ if (error)
+ return error;
+
+ mutex_enter(&dq->dq_interlock);
+ if (dq->dq2_lblkno == 0 && dq->dq2_blkoff == 0) {
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+ return ENOENT;
+ }
+ error = getq2e(ump, type, dq->dq2_lblkno, dq->dq2_blkoff,
+ &bp, &q2ep, 0);
+ if (error) {
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+ return error;
+ }
+ quota2_ufs_rwq2e(q2ep, &q2e, needswap);
+ brelse(bp, 0);
+ mutex_exit(&dq->dq_interlock);
+ dqrele(NULLVP, dq);
+ dict = q2etoprop(&q2e, 0);
+ if (dict == NULL)
+ return ENOMEM;
+ if (!prop_array_add_and_rel(replies, dict))
+ return ENOMEM;
+ return 0;
+}
+
+int
+quota2_handle_cmd_get(struct ufsmount *ump, int type, int id,
+ int defaultq, prop_array_t replies)
+{
+ int error;
+ struct quota2_header *q2h;
+ struct quota2_entry q2e;
+ struct buf *bp;
+ prop_dictionary_t dict;
+ const int needswap = UFS_MPNEEDSWAP(ump);
+
+ if (ump->um_quotas[type] == NULLVP)
+ return ENODEV;
+ if (defaultq) {
+ mutex_enter(&dqlock);
+ error = getq2h(ump, type, &bp, &q2h, 0);
+ if (error) {
+ mutex_exit(&dqlock);
+ return error;
+ }
+ quota2_ufs_rwq2e(&q2h->q2h_defentry, &q2e, needswap);
+ mutex_exit(&dqlock);
+ brelse(bp, 0);
+ dict = q2etoprop(&q2e, defaultq);
+ if (dict == NULL)
+ return ENOMEM;
+ if (!prop_array_add_and_rel(replies, dict))
+ return ENOMEM;
+ } else
+ error = quota2_array_add_q2e(ump, type, id, replies);
+
+ return error;
+}
+
+struct getuids {
+ long nuids; /* number of uids in array */
+ long size; /* size of array */
+ uid_t *uids; /* array of uids, dynamically allocated */
+};
+
+static int
+quota2_getuids_callback(struct ufsmount *ump, uint64_t *offp,
+ struct quota2_entry *q2ep, uint64_t off, void *v)
+{
+ struct getuids *gu = v;
+ uid_t *newuids;
+#ifdef FFS_EI
+ const int needswap = UFS_MPNEEDSWAP(ump);
+#endif
+
+ if (gu->nuids == gu->size) {
+ newuids = realloc(gu->uids, gu->size + PAGE_SIZE, M_TEMP,
+ M_WAITOK);
+ if (newuids == NULL) {
+ free(gu->uids, M_TEMP);
+ return ENOMEM;
+ }
+ gu->uids = newuids;
+ gu->size += (PAGE_SIZE / sizeof(uid_t));
+ }
+ gu->uids[gu->nuids] = ufs_rw32(q2ep->q2e_uid, needswap);
+ gu->nuids++;
+ return 0;
+}
+
+int
+quota2_handle_cmd_getall(struct ufsmount *ump, int type, prop_array_t replies)
+{
+ int error;
+ struct quota2_header *q2h;
+ struct quota2_entry q2e;
+ struct buf *hbp;
+ prop_dictionary_t dict;
+ uint64_t offset;
+ int i, j;
+ int quota2_hash_size;
+ const int needswap = UFS_MPNEEDSWAP(ump);
+ struct getuids gu;
+
+ if (ump->um_quotas[type] == NULLVP)
+ return ENODEV;
+ mutex_enter(&dqlock);
+ error = getq2h(ump, type, &hbp, &q2h, 0);
+ if (error) {
+ mutex_exit(&dqlock);
+ return error;
+ }
+ quota2_ufs_rwq2e(&q2h->q2h_defentry, &q2e, needswap);
+ dict = q2etoprop(&q2e, 1);
+ if (!prop_array_add_and_rel(replies, dict)) {
+ error = ENOMEM;
+ goto error_bp;
+ }
+ /*
+ * we can't directly get entries as we can't walk the list
+ * with qdlock and grab dq_interlock to read the entries
+ * at the same time. So just walk the lists to build a list of uid,
+ * and then read entries for these uids
+ */
+ memset(&gu, 0, sizeof(gu));
+ quota2_hash_size = ufs_rw16(q2h->q2h_hash_size, needswap);
+ for (i = 0; i < quota2_hash_size ; i++) {
+ offset = q2h->q2h_entries[i];
+ error = quota2_walk_list(ump, hbp, type, &offset, 0, &gu,
+ quota2_getuids_callback);
+ if (error) {
+ if (gu.uids != NULL)
+ free(gu.uids, M_TEMP);
+ break;
+ }
+ }
+error_bp:
+ mutex_exit(&dqlock);
+ brelse(hbp, 0);
+ if (error)
+ return error;
+ for (j = 0; j < gu.nuids; j++) {
+ error = quota2_array_add_q2e(ump, type,
+ gu.uids[j], replies);
+ if (error && error != ENOENT)
+ break;
+ }
+ free(gu.uids, M_TEMP);
+ return error;
+}
+
+int
+q2sync(struct mount *mp)
+{
+ return 0;
+}
+
+struct dq2get_callback {
+ uid_t id;
+ struct dquot *dq;
+};
+
+static int
+dq2get_callback(struct ufsmount *ump, uint64_t *offp, struct quota2_entry *q2e,
+ uint64_t off, void *v)
+{
+ struct dq2get_callback *c = v;
+ daddr_t lblkno;
+ int blkoff;
+#ifdef FFS_EI
+ const int needswap = UFS_MPNEEDSWAP(ump);
+#endif
+
+ if (ufs_rw32(q2e->q2e_uid, needswap) == c->id) {
+ KASSERT(mutex_owned(&c->dq->dq_interlock));
+ lblkno = (off >> ump->um_mountp->mnt_fs_bshift);
+ blkoff = (off & ump->umq2_bmask);
+ c->dq->dq2_lblkno = lblkno;
+ c->dq->dq2_blkoff = blkoff;
+ return Q2WL_ABORT;
+ }
+ return 0;
+}
+
+int
+dq2get(struct vnode *dqvp, u_long id, struct ufsmount *ump, int type,
+ struct dquot *dq)
+{
+ struct buf *bp;
+ struct quota2_header *q2h;
+ int error;
+ daddr_t offset;
+ u_long hash_mask;
+ struct dq2get_callback c = {
+ .id = id,
+ .dq = dq
+ };
+
+ KASSERT(mutex_owned(&dq->dq_interlock));
+ mutex_enter(&dqlock);
+ error = getq2h(ump, type, &bp, &q2h, 0);
+ if (error)
+ goto out_mutex;
+ /* look for our entry */
+ hash_mask = ((1 << q2h->q2h_hash_shift) - 1);
+ offset = q2h->q2h_entries[id & hash_mask];
+ error = quota2_walk_list(ump, bp, type, &offset, 0, (void *)&c,
+ dq2get_callback);
+ brelse(bp, 0);
+out_mutex:
+ mutex_exit(&dqlock);
+ return error;
+}
+
+int
+dq2sync(struct vnode *vp, struct dquot *dq)
+{
+ return 0;
+}
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index 783d03c2764..4a2d8d2b5b2 100644
--- a/sys/ufs/ufs/ufs_readwrite.c
+++ b/sys/ufs/ufs/ufs_readwrite.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_readwrite.c,v 1.95 2010/04/23 15:38:46 pooka Exp $ */
+/* $NetBSD: ufs_readwrite.c,v 1.96 2011/03/06 17:08:39 bouyer Exp $ */
/*-
* Copyright (c) 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.95 2010/04/23 15:38:46 pooka Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.96 2011/03/06 17:08:39 bouyer Exp $");
#ifdef LFS_READWRITE
#define FS struct lfs
@@ -106,7 +106,7 @@ READ(void *v)
return (0);
#ifndef LFS_READWRITE
- if ((ip->i_flags & SF_SNAPSHOT))
+ if ((ip->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL)) == SF_SNAPSHOT)
return ffs_snapshot_read(vp, uio, ioflag);
#endif /* !LFS_READWRITE */
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index 44b223021c1..134f5a9be70 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_vfsops.c,v 1.40 2009/05/07 19:26:09 elad Exp $ */
+/* $NetBSD: ufs_vfsops.c,v 1.41 2011/03/06 17:08:39 bouyer Exp $ */
/*
* Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vfsops.c,v 1.40 2009/05/07 19:26:09 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vfsops.c,v 1.41 2011/03/06 17:08:39 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -62,6 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: ufs_vfsops.c,v 1.40 2009/05/07 19:26:09 elad Exp $")
#ifdef UFS_DIRHASH
#include <ufs/ufs/dirhash.h>
#endif
+#include <ufs/ufs/quota2_prop.h>
/* how many times ufs_init() was called */
static int ufs_initcount = 0;
@@ -99,29 +100,53 @@ ufs_root(struct mount *mp, struct vnode **vpp)
* Do operations associated with quotas
*/
int
-ufs_quotactl(struct mount *mp, int cmds, uid_t uid, void *arg)
+ufs_quotactl(struct mount *mp, prop_dictionary_t dict)
{
struct lwp *l = curlwp;
-#ifndef QUOTA
+#if !defined(QUOTA) && !defined(QUOTA2)
(void) mp;
- (void) cmds;
- (void) uid;
- (void) arg;
+ (void) dict;
(void) l;
return (EOPNOTSUPP);
#else
- int cmd, type, error;
-
- if (uid == -1)
- uid = kauth_cred_getuid(l->l_cred);
- cmd = cmds >> SUBCMDSHIFT;
+ int error;
+ prop_dictionary_t cmddict;
+ prop_array_t commands;
+ prop_object_iterator_t iter;
/* Mark the mount busy, as we're passing it to kauth(9). */
error = vfs_busy(mp, NULL);
if (error)
return (error);
+ error = quota2_get_cmds(dict, &commands);
+ if (error)
+ goto out_vfs;
+ iter = prop_array_iterator(commands);
+ if (iter == NULL) {
+ error = ENOMEM;
+ goto out_vfs;
+ }
+
+
+ mutex_enter(&mp->mnt_updating);
+ while ((cmddict = prop_object_iterator_next(iter)) != NULL) {
+ if (prop_object_type(cmddict) != PROP_TYPE_DICTIONARY)
+ continue;
+ error = quota_handle_cmd(mp, l, cmddict);
+ if (error)
+ break;
+ }
+ prop_object_iterator_release(iter);
+ mutex_exit(&mp->mnt_updating);
+out_vfs:
+ vfs_unbusy(mp, false, NULL);
+ return (error);
+#endif
+}
+
+#if 0
switch (cmd) {
case Q_SYNC:
break;
@@ -201,7 +226,6 @@ ufs_quotactl(struct mount *mp, int cmds, uid_t uid, void *arg)
vfs_unbusy(mp, false, NULL);
return (error);
#endif
-}
/*
* This is the generic part of fhtovp called after the underlying
@@ -241,7 +265,7 @@ ufs_init(void)
"ufsdir", NULL, IPL_NONE, NULL, NULL, NULL);
ufs_ihashinit();
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
dqinit();
#endif
#ifdef UFS_DIRHASH
@@ -256,7 +280,7 @@ void
ufs_reinit(void)
{
ufs_ihashreinit();
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
dqreinit();
#endif
}
@@ -271,7 +295,7 @@ ufs_done(void)
return;
ufs_ihashdone();
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
dqdone();
#endif
pool_cache_destroy(ufs_direct_cache);
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index f7049f2c892..e092b45ca85 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_vnops.c,v 1.186 2011/01/02 05:09:32 dholland Exp $ */
+/* $NetBSD: ufs_vnops.c,v 1.187 2011/03/06 17:08:39 bouyer Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.186 2011/01/02 05:09:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.187 2011/03/06 17:08:39 bouyer Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -275,11 +275,12 @@ ufs_close(void *v)
}
static int
-ufs_check_possible(struct vnode *vp, struct inode *ip, mode_t mode)
+ufs_check_possible(struct vnode *vp, struct inode *ip, mode_t mode,
+ kauth_cred_t cred)
{
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
int error;
-#endif /* QUOTA */
+#endif
/*
* Disallow write attempts on read-only file systems;
@@ -293,9 +294,9 @@ ufs_check_possible(struct vnode *vp, struct inode *ip, mode_t mode)
case VREG:
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
fstrans_start(vp->v_mount, FSTRANS_SHARED);
- error = getinoquota(ip);
+ error = chkdq(ip, 0, cred, 0);
fstrans_done(vp->v_mount);
if (error != 0)
return error;
@@ -348,7 +349,7 @@ ufs_access(void *v)
ip = VTOI(vp);
mode = ap->a_mode;
- error = ufs_check_possible(vp, ip, mode);
+ error = ufs_check_possible(vp, ip, mode, ap->a_cred);
if (error)
return error;
@@ -481,8 +482,8 @@ ufs_setattr(void *v)
goto out;
}
/* Snapshot flag cannot be set or cleared */
- if ((vap->va_flags & SF_SNAPSHOT) !=
- (ip->i_flags & SF_SNAPSHOT)) {
+ if ((vap->va_flags & (SF_SNAPSHOT | SF_SNAPINVAL)) !=
+ (ip->i_flags & (SF_SNAPSHOT | SF_SNAPINVAL))) {
error = EPERM;
goto out;
}
@@ -695,7 +696,7 @@ ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, kauth_cred_t cred,
{
struct inode *ip;
int error = 0;
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
uid_t ouid;
gid_t ogid;
int64_t change;
@@ -713,7 +714,7 @@ ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, kauth_cred_t cred,
return (error);
fstrans_start(vp->v_mount, FSTRANS_SHARED);
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
ogid = ip->i_gid;
ouid = ip->i_uid;
change = DIP(ip, blocks);
@@ -724,7 +725,7 @@ ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, kauth_cred_t cred,
DIP_ASSIGN(ip, gid, gid);
ip->i_uid = uid;
DIP_ASSIGN(ip, uid, uid);
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
if ((error = chkdq(ip, change, cred, 0)) == 0) {
if ((error = chkiq(ip, 1, cred, 0)) == 0)
goto good;
@@ -740,7 +741,7 @@ ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, kauth_cred_t cred,
fstrans_done(vp->v_mount);
return (error);
good:
-#endif /* QUOTA */
+#endif /* QUOTA || QUOTA2 */
ip->i_flag |= IN_CHANGE;
UFS_WAPBL_UPDATE(vp, NULL, NULL, 0);
fstrans_done(vp->v_mount);
@@ -1377,7 +1378,7 @@ ufs_mkdir(void *v)
DIP_ASSIGN(ip, uid, ip->i_uid);
ip->i_gid = dp->i_gid;
DIP_ASSIGN(ip, gid, ip->i_gid);
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
if ((error = chkiq(ip, 1, cnp->cn_cred, 0))) {
UFS_VFREE(tvp, ip->i_number, dmode);
UFS_WAPBL_END(dvp->v_mount);
@@ -2187,7 +2188,7 @@ ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp,
vput(dvp);
return (error);
}
-#ifdef QUOTA
+#if defined(QUOTA) || defined(QUOTA2)
if ((error = chkiq(ip, 1, cnp->cn_cred, 0))) {
UFS_VFREE(tvp, ip->i_number, mode);
UFS_WAPBL_END1(dvp->v_mount, dvp);
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index 724e76d47df..13baef86a22 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ufsmount.h,v 1.35 2008/11/13 11:09:45 ad Exp $ */
+/* $NetBSD: ufsmount.h,v 1.36 2011/03/06 17:08:39 bouyer Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -98,9 +98,23 @@ struct ufsmount {
u_long um_bptrtodb; /* indir ptr to disk block */
u_long um_seqinc; /* inc between seq blocks */
kmutex_t um_lock; /* lock on global data */
- time_t um_btime[MAXQUOTAS]; /* block quota time limit */
- time_t um_itime[MAXQUOTAS]; /* inode quota time limit */
- char um_qflags[MAXQUOTAS]; /* quota specific flags */
+ union {
+ struct um_q1 {
+ time_t q1_btime[MAXQUOTAS]; /* block quota time limit */
+ time_t q1_itime[MAXQUOTAS]; /* inode quota time limit */
+ char q1_qflags[MAXQUOTAS]; /* quota specific flags */
+ } um_q1;
+ struct um_q2 {
+ uint64_t q2_bsize; /* block size of quota file */
+ uint64_t q2_bmask; /* mask for above */
+ } um_q2;
+ } um_q;
+#define umq1_btime um_q.um_q1.q1_btime
+#define umq1_itime um_q.um_q1.q1_itime
+#define umq1_qflags um_q.um_q1.q1_qflags
+#define umq2_bsize um_q.um_q2.q2_bsize
+#define umq2_bmask um_q.um_q2.q2_bmask
+
void *um_oldfscompat; /* save 4.2 rotbl */
int um_maxsymlinklen;
int um_dirblksiz;
@@ -143,6 +157,8 @@ struct ufs_ops {
/* UFS-specific flags */
#define UFS_NEEDSWAP 0x01 /* filesystem metadata need byte-swapping */
#define UFS_ISAPPLEUFS 0x02 /* filesystem is Apple UFS */
+#define UFS_QUOTA 0x04 /* filesystem has QUOTA (v1) */
+#define UFS_QUOTA2 0x08 /* filesystem has QUOTA2 */
/*
* Filesystem types