netbsd fsck driver import

. fsck driver parses /etc/fstab and invokes sub-fscks
	. further simplifies fs handling in rc
This commit is contained in:
Ben Gras
2011-12-22 23:07:15 +01:00
parent 6b6d114a21
commit 4d4057d8a2
46 changed files with 5470 additions and 66 deletions
+3
View File
@@ -66,6 +66,9 @@
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
/*
* Mach derived conversion macros
*/
+2 -1
View File
@@ -5,6 +5,7 @@ INCSDIR=/usr/include/x86
INCS= float.h \
ieee.h \
ieeefp.h \
math.h
math.h \
mutex.h
.include <bsd.kinc.mk>
+80
View File
@@ -0,0 +1,80 @@
/* $NetBSD: mutex.h,v 1.6 2009/04/24 17:49:51 ad Exp $ */
/*-
* Copyright (c) 2002, 2006, 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe and Andrew Doran.
*
* 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 _X86_MUTEX_H_
#define _X86_MUTEX_H_
struct kmutex {
union {
volatile uintptr_t mtxa_owner;
#ifdef __MUTEX_PRIVATE
struct {
volatile uint8_t mtxs_dummy;
ipl_cookie_t mtxs_ipl;
__cpu_simple_lock_t mtxs_lock;
volatile uint8_t mtxs_unused;
} s;
#endif
} u;
};
#ifdef __MUTEX_PRIVATE
#define mtx_owner u.mtxa_owner
#define mtx_ipl u.s.mtxs_ipl
#define mtx_lock u.s.mtxs_lock
#define __HAVE_MUTEX_STUBS 1
#define __HAVE_SPIN_MUTEX_STUBS 1
#define __HAVE_SIMPLE_MUTEXES 1
/*
* MUTEX_RECEIVE: technically, no memory barrier is required
* as 'ret' implies a load fence. However we need this to
* handle a bug with some Opteron revisions. See patch.c,
* lock_stubs.S.
*/
#define MUTEX_RECEIVE(mtx) membar_consumer()
/*
* MUTEX_GIVE: no memory barrier required, as _lock_cas() will take care of it.
*/
#define MUTEX_GIVE(mtx) /* nothing */
#define MUTEX_CAS(p, o, n) \
(_atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
unsigned long _atomic_cas_ulong(volatile unsigned long *,
unsigned long, unsigned long);
#endif /* __MUTEX_PRIVATE */
#endif /* _X86_MUTEX_H_ */
+37
View File
@@ -1,6 +1,43 @@
#ifndef _SYS_MOUNT_H
#define _SYS_MOUNT_H_
/*
* File system types.
*/
#define MOUNT_FFS "ffs" /* UNIX "Fast" Filesystem */
#define MOUNT_UFS MOUNT_FFS /* for compatibility */
#define MOUNT_NFS "nfs" /* Network Filesystem */
#define MOUNT_MFS "mfs" /* Memory Filesystem */
#define MOUNT_MSDOS "msdos" /* MSDOS Filesystem */
#define MOUNT_LFS "lfs" /* Log-based Filesystem */
#define MOUNT_FDESC "fdesc" /* File Descriptor Filesystem */
#define MOUNT_NULL "null" /* Minimal Filesystem Layer */
#define MOUNT_OVERLAY "overlay" /* Minimal Overlay Filesystem Layer */
#define MOUNT_UMAP "umap" /* User/Group Identifier Remapping Filesystem */
#define MOUNT_KERNFS "kernfs" /* Kernel Information Filesystem */
#define MOUNT_PROCFS "procfs" /* /proc Filesystem */
#define MOUNT_AFS "afs" /* Andrew Filesystem */
#define MOUNT_CD9660 "cd9660" /* ISO9660 (aka CDROM) Filesystem */
#define MOUNT_UNION "union" /* Union (translucent) Filesystem */
#define MOUNT_ADOSFS "adosfs" /* AmigaDOS Filesystem */
#define MOUNT_EXT2FS "ext2fs" /* Second Extended Filesystem */
#define MOUNT_CFS "coda" /* Coda Filesystem */
#define MOUNT_CODA MOUNT_CFS /* Coda Filesystem */
#define MOUNT_FILECORE "filecore" /* Acorn Filecore Filesystem */
#define MOUNT_NTFS "ntfs" /* Windows/NT Filesystem */
#define MOUNT_SMBFS "smbfs" /* CIFS (SMB) */
#define MOUNT_PTYFS "ptyfs" /* Pseudo tty filesystem */
#define MOUNT_TMPFS "tmpfs" /* Efficient memory file-system */
#define MOUNT_UDF "udf" /* UDF CD/DVD filesystem */
#define MOUNT_SYSVBFS "sysvbfs" /* System V Boot Filesystem */
#define MOUNT_PUFFS "puffs" /* Pass-to-Userspace filesystem */
#define MOUNT_HFS "hfs" /* Apple HFS+ Filesystem */
#define MOUNT_EFS "efs" /* SGI's Extent Filesystem */
#define MOUNT_ZFS "zfs" /* Sun ZFS */
#define MOUNT_NILFS "nilfs" /* NTT's NiLFS(2) logging file system */
#define MOUNT_RUMPFS "rumpfs" /* rump virtual file system */
#define MOUNT_V7FS "v7fs" /* 7th Edition of Unix Filesystem */
#include <sys/statvfs.h>
#include <minix/mount.h>