Source-Changes-HG archive

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

[src/trunk]: src 7th Edition(V7) File System support. and NetBSD symbolic-lin...



details:   https://anonhg.NetBSD.org/src/rev/5bf4413334aa
branches:  trunk
changeset: 766550:5bf4413334aa
user:      uch <uch%NetBSD.org@localhost>
date:      Mon Jun 27 11:52:22 2011 +0000

description:
7th Edition(V7) File System support. and NetBSD symbolic-link, socket, FIFO extension. see newfs_v7fs(8).

diffstat:

 distrib/sets/lists/base/mi         |     6 +-
 distrib/sets/lists/comp/mi         |     4 +-
 distrib/sets/lists/man/mi          |    11 +-
 sbin/Makefile                      |     4 +-
 sbin/fsck_v7fs/Makefile            |    20 +
 sbin/fsck_v7fs/datablock.c         |   403 +++++++++++
 sbin/fsck_v7fs/freeblock.c         |   294 ++++++++
 sbin/fsck_v7fs/fsck_v7fs.8         |    94 ++
 sbin/fsck_v7fs/fsck_v7fs.c         |   223 ++++++
 sbin/fsck_v7fs/fsck_v7fs.h         |    82 ++
 sbin/fsck_v7fs/inode.c             |   160 ++++
 sbin/fsck_v7fs/main.c              |   263 +++++++
 sbin/fsck_v7fs/pathname.c          |   349 +++++++++
 sbin/mount_v7fs/Makefile           |    16 +
 sbin/mount_v7fs/mount_v7fs.8       |   112 +++
 sbin/mount_v7fs/mount_v7fs.c       |   191 +++++
 sbin/mount_v7fs/mount_v7fs.h       |    38 +
 sbin/newfs_v7fs/Makefile           |    23 +
 sbin/newfs_v7fs/main.c             |   277 +++++++
 sbin/newfs_v7fs/newfs_v7fs.8       |   117 +++
 sbin/newfs_v7fs/newfs_v7fs.c       |   242 ++++++
 sbin/newfs_v7fs/newfs_v7fs.h       |    48 +
 sys/conf/files                     |     3 +-
 sys/fs/Makefile                    |     4 +-
 sys/fs/v7fs/Makefile               |     7 +
 sys/fs/v7fs/files.v7fs             |    22 +
 sys/fs/v7fs/v7fs.h                 |   180 +++++
 sys/fs/v7fs/v7fs_args.h            |    40 +
 sys/fs/v7fs/v7fs_datablock.c       |   721 ++++++++++++++++++++
 sys/fs/v7fs/v7fs_datablock.h       |    46 +
 sys/fs/v7fs/v7fs_dirent.c          |    85 ++
 sys/fs/v7fs/v7fs_dirent.h          |    38 +
 sys/fs/v7fs/v7fs_endian.c          |   227 ++++++
 sys/fs/v7fs/v7fs_endian.h          |    52 +
 sys/fs/v7fs/v7fs_extern.c          |   262 +++++++
 sys/fs/v7fs/v7fs_extern.h          |   116 +++
 sys/fs/v7fs/v7fs_file.c            |   411 +++++++++++
 sys/fs/v7fs/v7fs_file.h            |    64 +
 sys/fs/v7fs/v7fs_file_util.c       |   223 ++++++
 sys/fs/v7fs/v7fs_impl.h            |   154 ++++
 sys/fs/v7fs/v7fs_inode.c           |   297 ++++++++
 sys/fs/v7fs/v7fs_inode.h           |    91 ++
 sys/fs/v7fs/v7fs_inode_util.c      |   124 +++
 sys/fs/v7fs/v7fs_io.c              |   136 +++
 sys/fs/v7fs/v7fs_io_kern.c         |   250 +++++++
 sys/fs/v7fs/v7fs_io_user.c         |   169 ++++
 sys/fs/v7fs/v7fs_superblock.c      |   259 +++++++
 sys/fs/v7fs/v7fs_superblock.h      |    48 +
 sys/fs/v7fs/v7fs_superblock_util.c |    97 ++
 sys/fs/v7fs/v7fs_vfsops.c          |   602 ++++++++++++++++
 sys/fs/v7fs/v7fs_vnops.c           |  1281 ++++++++++++++++++++++++++++++++++++
 sys/sys/disklabel.h                |     5 +-
 sys/sys/mount.h                    |     3 +-
 sys/sys/vnode.h                    |     6 +-
 54 files changed, 8987 insertions(+), 13 deletions(-)

diffs (truncated from 9398 to 300 lines):

diff -r 37eb81bdc48d -r 5bf4413334aa distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi        Mon Jun 27 08:21:07 2011 +0000
+++ b/distrib/sets/lists/base/mi        Mon Jun 27 11:52:22 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.939 2011/05/20 01:59:14 msaitoh Exp $
+# $NetBSD: mi,v 1.940 2011/06/27 11:52:22 uch Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -239,6 +239,7 @@
 ./sbin/fsck_ffs                                        base-sysutil-root
 ./sbin/fsck_lfs                                        base-sysutil-root
 ./sbin/fsck_msdos                              base-sysutil-root
+./sbin/fsck_v7fs                               base-sysutil-root
 ./sbin/fsdb                                    base-sysutil-root
 ./sbin/fsirand                                 base-sysutil-root
 ./sbin/gpt                                     base-sysutil-root
@@ -289,6 +290,7 @@
 ./sbin/mount_ufs                               base-sysutil-root
 ./sbin/mount_umap                              base-miscfs-root
 ./sbin/mount_union                             base-miscfs-root
+./sbin/mount_v7fs                              base-sysutil-root
 ./sbin/mountd                                  base-obsolete           obsolete
 ./sbin/newbtconf                               base-sysutil-root
 ./sbin/newfs                                   base-sysutil-root
@@ -297,6 +299,7 @@
 ./sbin/newfs_msdos                             base-sysutil-root
 ./sbin/newfs_sysvbfs                           base-sysutil-root
 ./sbin/newfs_udf                               base-sysutil-root
+./sbin/newfs_v7fs                              base-sysutil-root
 ./sbin/newlfs                                  base-obsolete           obsolete
 ./sbin/nfsd                                    base-obsolete           obsolete
 ./sbin/nfsiod                                  base-obsolete           obsolete
@@ -796,6 +799,7 @@
 ./usr/include/fs/sysvbfs                       base-c-usr
 ./usr/include/fs/tmpfs                         base-c-usr
 ./usr/include/fs/udf                           base-c-usr
+./usr/include/fs/v7fs                          base-c-usr
 ./usr/include/g++                              base-cxx-usr
 ./usr/include/g++/backward                     base-cxx-usr
 ./usr/include/g++/bits                         base-cxx-usr
diff -r 37eb81bdc48d -r 5bf4413334aa distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Mon Jun 27 08:21:07 2011 +0000
+++ b/distrib/sets/lists/comp/mi        Mon Jun 27 11:52:22 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.1632 2011/06/26 16:42:40 christos Exp $
+#      $NetBSD: mi,v 1.1633 2011/06/27 11:52:22 uch Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -663,6 +663,8 @@
 ./usr/include/fs/tmpfs/tmpfs_args.h            comp-c-include
 ./usr/include/fs/udf/ecma167-udf.h             comp-c-include
 ./usr/include/fs/udf/udf_mount.h               comp-c-include
+./usr/include/fs/v7fs/v7fs.h                   comp-c-include
+./usr/include/fs/v7fs/v7fs_args.h              comp-c-include
 ./usr/include/fstab.h                          comp-c-include
 ./usr/include/fts.h                            comp-c-include
 ./usr/include/ftw.h                            comp-c-include
diff -r 37eb81bdc48d -r 5bf4413334aa distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Mon Jun 27 08:21:07 2011 +0000
+++ b/distrib/sets/lists/man/mi Mon Jun 27 11:52:22 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1321 2011/06/22 20:29:38 jruoho Exp $
+# $NetBSD: mi,v 1.1322 2011/06/27 11:52:23 uch Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2245,6 +2245,7 @@
 ./usr/share/man/cat8/fsck_ffs.0                        man-sysutil-catman      .cat
 ./usr/share/man/cat8/fsck_lfs.0                        man-sysutil-catman      .cat
 ./usr/share/man/cat8/fsck_msdos.0              man-sysutil-catman      .cat
+./usr/share/man/cat8/fsck_v7fs.0               man-sysutil-catman      .cat
 ./usr/share/man/cat8/fsdb.0                    man-sysutil-catman      .cat
 ./usr/share/man/cat8/fsinfo.0                  man-sysutil-catman      .cat
 ./usr/share/man/cat8/fsirand.0                 man-sysutil-catman      .cat
@@ -2471,6 +2472,7 @@
 ./usr/share/man/cat8/mount_ufs.0               man-sysutil-catman      .cat
 ./usr/share/man/cat8/mount_umap.0              man-miscfs-catman       .cat
 ./usr/share/man/cat8/mount_union.0             man-miscfs-catman       .cat
+./usr/share/man/cat8/mount_v7fs.0              man-sysutil-catman      .cat
 ./usr/share/man/cat8/mountd.0                  man-nfsserver-catman    .cat
 ./usr/share/man/cat8/moused.0                  man-sysutil-catman      .cat
 ./usr/share/man/cat8/mrinfo.0                  man-netutil-catman      .cat
@@ -2509,6 +2511,7 @@
 ./usr/share/man/cat8/newfs_msdos.0             man-sysutil-catman      .cat
 ./usr/share/man/cat8/newfs_sysvbfs.0           man-sysutil-catman      .cat
 ./usr/share/man/cat8/newfs_udf.0               man-sysutil-catman      .cat
+./usr/share/man/cat8/newfs_v7fs.0              man-sysutil-catman      .cat
 ./usr/share/man/cat8/newlfs.0                  man-obsolete            obsolete
 ./usr/share/man/cat8/news68k/MAKEDEV.0         man-obsolete            obsolete
 ./usr/share/man/cat8/news68k/makedev.0         man-obsolete            obsolete
@@ -4877,6 +4880,7 @@
 ./usr/share/man/html8/fsck_ffs.html            man-sysutil-htmlman     html
 ./usr/share/man/html8/fsck_lfs.html            man-sysutil-htmlman     html
 ./usr/share/man/html8/fsck_msdos.html          man-sysutil-htmlman     html
+./usr/share/man/html8/fsck_v7fs.html           man-sysutil-htmlman     html
 ./usr/share/man/html8/fsdb.html                        man-sysutil-htmlman     html
 ./usr/share/man/html8/fsinfo.html              man-sysutil-htmlman     html
 ./usr/share/man/html8/fsirand.html             man-sysutil-htmlman     html
@@ -5057,6 +5061,7 @@
 ./usr/share/man/html8/mount_ufs.html           man-sysutil-htmlman     html
 ./usr/share/man/html8/mount_umap.html          man-miscfs-htmlman      html
 ./usr/share/man/html8/mount_union.html         man-miscfs-htmlman      html
+./usr/share/man/html8/mount_v7fs.html          man-sysutil-htmlman     html
 ./usr/share/man/html8/mountd.html              man-nfsserver-htmlman   html
 ./usr/share/man/html8/moused.html              man-sysutil-htmlman     html
 ./usr/share/man/html8/mrinfo.html              man-netutil-htmlman     html
@@ -5083,6 +5088,7 @@
 ./usr/share/man/html8/newfs_msdos.html         man-sysutil-htmlman     html
 ./usr/share/man/html8/newfs_sysvbfs.html       man-sysutil-htmlman     html
 ./usr/share/man/html8/newfs_udf.html           man-sysutil-htmlman     html
+./usr/share/man/html8/newfs_v7fs.html          man-sysutil-htmlman     html
 ./usr/share/man/html8/newsyslog.html           man-sysutil-htmlman     html
 ./usr/share/man/html8/next68k/boot.html                man-sys-htmlman         html
 ./usr/share/man/html8/nfsd.html                        man-nfsserver-htmlman   html
@@ -7601,6 +7607,7 @@
 ./usr/share/man/man8/fsck_ffs.8                        man-sysutil-man         .man
 ./usr/share/man/man8/fsck_lfs.8                        man-sysutil-man         .man
 ./usr/share/man/man8/fsck_msdos.8              man-sysutil-man         .man
+./usr/share/man/man8/fsck_v7fs.8               man-sysutil-man         .man
 ./usr/share/man/man8/fsdb.8                    man-sysutil-man         .man
 ./usr/share/man/man8/fsinfo.8                  man-sysutil-man         .man
 ./usr/share/man/man8/fsirand.8                 man-sysutil-man         .man
@@ -7828,6 +7835,7 @@
 ./usr/share/man/man8/mount_ufs.8               man-sysutil-man         .man
 ./usr/share/man/man8/mount_umap.8              man-miscfs-man          .man
 ./usr/share/man/man8/mount_union.8             man-miscfs-man          .man
+./usr/share/man/man8/mount_v7fs.8              man-sysutil-man         .man
 ./usr/share/man/man8/mountd.8                  man-nfsserver-man       .man
 ./usr/share/man/man8/moused.8                  man-sysutil-man         .man
 ./usr/share/man/man8/mrinfo.8                  man-netutil-man         .man
@@ -7866,6 +7874,7 @@
 ./usr/share/man/man8/newfs_msdos.8             man-sysutil-man         .man
 ./usr/share/man/man8/newfs_sysvbfs.8           man-sysutil-man         .man
 ./usr/share/man/man8/newfs_udf.8               man-sysutil-man         .man
+./usr/share/man/man8/newfs_v7fs.8              man-sysutil-man         .man
 ./usr/share/man/man8/newlfs.8                  man-obsolete            obsolete
 ./usr/share/man/man8/news68k/MAKEDEV.8         man-obsolete            obsolete
 ./usr/share/man/man8/news68k/makedev.8         man-obsolete            obsolete
diff -r 37eb81bdc48d -r 5bf4413334aa sbin/Makefile
--- a/sbin/Makefile     Mon Jun 27 08:21:07 2011 +0000
+++ b/sbin/Makefile     Mon Jun 27 11:52:22 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.119 2011/02/08 03:20:15 haad Exp $
+#      $NetBSD: Makefile,v 1.120 2011/06/27 11:52:23 uch Exp $
 #      @(#)Makefile    8.5 (Berkeley) 3/31/94
 
 # Not ported: XNSrouted enpload scsiformat startslip
@@ -21,6 +21,7 @@
 SUBDIR+= newfs_msdos fsck_msdos
 SUBDIR+= newfs_sysvbfs
 SUBDIR+= newfs_udf
+SUBDIR+= newfs_v7fs fsck_v7fs
 SUBDIR+= mount_ados
 SUBDIR+= mount_cd9660
 SUBDIR+= mount_efs
@@ -47,6 +48,7 @@
 SUBDIR+= mount_tmpfs
 SUBDIR+= mount_umap
 SUBDIR+= mount_union
+SUBDIR+= mount_v7fs
 
 .if (${MKCRYPTO} != "no")
 SUBDIR+= cgdconfig
diff -r 37eb81bdc48d -r 5bf4413334aa sbin/fsck_v7fs/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/fsck_v7fs/Makefile   Mon Jun 27 11:52:22 2011 +0000
@@ -0,0 +1,20 @@
+#      $NetBSD: Makefile,v 1.1 2011/06/27 11:52:58 uch Exp $
+
+.include <bsd.own.mk>
+
+PROG=  fsck_v7fs
+MAN=   fsck_v7fs.8
+SRCS= fsck_v7fs.c main.c pathname.c inode.c datablock.c freeblock.c    \
+v7fs_datablock.c v7fs_io.c v7fs_superblock.c v7fs_inode.c v7fs_file.c  \
+v7fs_dirent.c v7fs_endian.c v7fs_io_user.c v7fs_inode_util.c           \
+v7fs_file_util.c v7fs_superblock_util.c fsutil.c progress.c
+
+FSCK=  ${NETBSDSRCDIR}/sbin/fsck
+V7FS=  ${NETBSDSRCDIR}/sys/fs/v7fs
+CPPFLAGS+= -I${FSCK} -I${V7FS} -DV7FS_EI -g
+.PATH: ${FSCK} ${V7FS}
+
+LDADD+=-lutil
+DPADD+=${LIBUTIL}
+
+.include <bsd.prog.mk>
diff -r 37eb81bdc48d -r 5bf4413334aa sbin/fsck_v7fs/datablock.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/fsck_v7fs/datablock.c        Mon Jun 27 11:52:22 2011 +0000
@@ -0,0 +1,403 @@
+/*     $NetBSD: datablock.c,v 1.1 2011/06/27 11:52:58 uch Exp $        */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by UCHIYAMA Yasushi.
+ *
+ * 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>
+#ifndef lint
+__RCSID("$NetBSD: datablock.c,v 1.1 2011/06/27 11:52:58 uch Exp $");
+#endif /* not lint */
+
+#include <stdio.h>
+#include <stdbool.h>
+
+#include "v7fs.h"
+#include "v7fs_endian.h"
+#include "v7fs_superblock.h"
+#include "v7fs_inode.h"
+#include "v7fs_impl.h"
+#include "v7fs_datablock.h"
+#include "v7fs_file.h"
+#include "fsck_v7fs.h"
+
+static void datablock_dup_remove(struct v7fs_self *, v7fs_ino_t, v7fs_ino_t,
+    v7fs_daddr_t);
+
+struct loop_context {
+       v7fs_ino_t i;
+       v7fs_ino_t j;
+       v7fs_daddr_t blk;
+};
+
+/*
+ * datablock vs freeblock
+ */
+static int
+freeblock_subr(struct v7fs_self *fs, void *ctx, v7fs_daddr_t freeblk)
+{
+       struct loop_context *arg = (struct loop_context *)ctx;
+
+       progress(0);
+       if (arg->blk == freeblk) {
+               pwarn("*** ino%d(%s) data block %d found at freeblock",
+                   arg->i, filename(fs, arg->i), freeblk);
+               if (reply("CORRECT?")) {
+                       freeblock_dup_remove(fs, freeblk);
+                       return V7FS_ITERATOR_ERROR; /* Rescan needed. */
+               }
+       }
+
+       return 0;
+}
+
+static int
+datablock_subr(struct v7fs_self *fs, void *ctx, v7fs_daddr_t blk,
+    size_t sz __unused)
+{
+       struct loop_context *arg = (struct loop_context *)ctx;
+       int ret;
+
+       arg->blk = blk;
+       if ((ret = v7fs_freeblock_foreach(fs, freeblock_subr, ctx)) ==
+           V7FS_ITERATOR_ERROR)
+               return ret;
+
+       return 0;
+}
+
+static int
+inode_subr(struct v7fs_self *fs, void *ctx, struct v7fs_inode *p,
+    v7fs_ino_t ino)
+{
+       struct loop_context *arg = (struct loop_context *)ctx;
+       int ret;
+
+       arg->i = ino;
+
+       if ((ret = v7fs_datablock_foreach(fs, p, datablock_subr, ctx)) ==
+           V7FS_ITERATOR_ERROR)
+               return ret;
+
+       return 0;



Home | Main Index | Thread Index | Old Index