svn commit: r340427 - in projects/clang700-import: . lib lib/csu/common lib/libc lib/libcasper/services lib/libcasper/services/cap_fileargs lib/libnv lib/libnv/tests lib/libufs release/scripts sbin...
Dimitry Andric
dim at FreeBSD.org
Wed Nov 14 06:46:50 UTC 2018
Author: dim
Date: Wed Nov 14 06:46:44 2018
New Revision: 340427
URL: https://svnweb.freebsd.org/changeset/base/340427
Log:
Merge ^/head r340368 through r340426.
Added:
projects/clang700-import/lib/libcasper/services/cap_fileargs/
- copied from r340426, head/lib/libcasper/services/cap_fileargs/
projects/clang700-import/lib/libufs/getinode.3
- copied unchanged from r340426, head/lib/libufs/getinode.3
projects/clang700-import/sys/dts/arm/Makefile.inc
- copied unchanged from r340426, head/sys/dts/arm/Makefile.inc
projects/clang700-import/sys/dts/arm64/Makefile.inc
- copied unchanged from r340426, head/sys/dts/arm64/Makefile.inc
Deleted:
projects/clang700-import/sys/compat/freebsd32/capabilities.conf
projects/clang700-import/sys/sys/epoch_private.h
Modified:
projects/clang700-import/Makefile.inc1
projects/clang700-import/Makefile.libcompat
projects/clang700-import/lib/Makefile
projects/clang700-import/lib/csu/common/crtbegin.c
projects/clang700-import/lib/libc/Versions.def
projects/clang700-import/lib/libcasper/services/Makefile
projects/clang700-import/lib/libnv/common_impl.h
projects/clang700-import/lib/libnv/msgio.c
projects/clang700-import/lib/libnv/tests/nvlist_send_recv_test.c
projects/clang700-import/lib/libufs/Makefile
projects/clang700-import/lib/libufs/inode.c
projects/clang700-import/lib/libufs/libufs.h
projects/clang700-import/release/scripts/make-manifest.sh
projects/clang700-import/sbin/clri/clri.c
projects/clang700-import/sbin/dump/dump.h
projects/clang700-import/sbin/dump/main.c
projects/clang700-import/sbin/dump/traverse.c
projects/clang700-import/sbin/ffsinfo/ffsinfo.c
projects/clang700-import/sbin/fsck_ffs/dir.c
projects/clang700-import/sbin/fsck_ffs/fsck.h
projects/clang700-import/sbin/fsck_ffs/gjournal.c
projects/clang700-import/sbin/fsck_ffs/inode.c
projects/clang700-import/sbin/fsck_ffs/main.c
projects/clang700-import/sbin/fsck_ffs/pass5.c
projects/clang700-import/sbin/fsirand/fsirand.c
projects/clang700-import/sbin/growfs/growfs.c
projects/clang700-import/sbin/ipfw/ipfw.8
projects/clang700-import/sbin/newfs/mkfs.c
projects/clang700-import/sbin/tunefs/tunefs.c
projects/clang700-import/share/mk/bsd.linker.mk
projects/clang700-import/share/mk/src.libnames.mk
projects/clang700-import/sys/amd64/amd64/machdep.c
projects/clang700-import/sys/amd64/conf/GENERIC
projects/clang700-import/sys/amd64/conf/MINIMAL
projects/clang700-import/sys/amd64/conf/NOTES
projects/clang700-import/sys/compat/freebsd32/Makefile
projects/clang700-import/sys/compat/freebsd32/syscalls.conf
projects/clang700-import/sys/conf/dtb.mk
projects/clang700-import/sys/contrib/libnv/nvpair.c
projects/clang700-import/sys/dev/amdsmn/amdsmn.c
projects/clang700-import/sys/dev/amdtemp/amdtemp.c
projects/clang700-import/sys/dev/cxgbe/t4_netmap.c
projects/clang700-import/sys/dev/nvme/nvme_ns.c
projects/clang700-import/sys/dev/tws/tws.c
projects/clang700-import/sys/dev/tws/tws_cam.c
projects/clang700-import/sys/dev/tws/tws_services.h
projects/clang700-import/sys/dts/Makefile.inc
projects/clang700-import/sys/dts/arm/Makefile
projects/clang700-import/sys/dts/arm/overlays/Makefile
projects/clang700-import/sys/dts/arm64/Makefile
projects/clang700-import/sys/dts/arm64/overlays/Makefile
projects/clang700-import/sys/dts/mips/Makefile
projects/clang700-import/sys/dts/powerpc/Makefile
projects/clang700-import/sys/i386/conf/GENERIC
projects/clang700-import/sys/i386/conf/MINIMAL
projects/clang700-import/sys/kern/genoffset.c
projects/clang700-import/sys/kern/kern_environment.c
projects/clang700-import/sys/kern/kern_mutex.c
projects/clang700-import/sys/kern/kern_rmlock.c
projects/clang700-import/sys/kern/kern_rwlock.c
projects/clang700-import/sys/kern/kern_sx.c
projects/clang700-import/sys/kern/kern_thread.c
projects/clang700-import/sys/kern/makesyscalls.sh
projects/clang700-import/sys/kern/subr_blist.c
projects/clang700-import/sys/kern/subr_epoch.c
projects/clang700-import/sys/net/if.c
projects/clang700-import/sys/net/if_var.h
projects/clang700-import/sys/powerpc/conf/GENERIC64
projects/clang700-import/sys/riscv/include/cpu.h
projects/clang700-import/sys/riscv/include/cpufunc.h
projects/clang700-import/sys/riscv/include/riscvreg.h
projects/clang700-import/sys/sys/blist.h
projects/clang700-import/sys/sys/epoch.h
projects/clang700-import/sys/sys/proc.h
projects/clang700-import/sys/ufs/ffs/ffs_extern.h
projects/clang700-import/sys/ufs/ffs/ffs_inode.c
projects/clang700-import/sys/ufs/ffs/ffs_snapshot.c
projects/clang700-import/sys/ufs/ffs/ffs_softdep.c
projects/clang700-import/sys/ufs/ffs/ffs_subr.c
projects/clang700-import/sys/ufs/ffs/ffs_vfsops.c
projects/clang700-import/sys/vm/uma_core.c
projects/clang700-import/sys/vm/uma_int.h
projects/clang700-import/sys/x86/include/x86_var.h
projects/clang700-import/sys/x86/x86/identcpu.c
projects/clang700-import/targets/pseudo/userland/lib/Makefile.depend
projects/clang700-import/tools/diag/prtblknos/main.c
projects/clang700-import/usr.bin/head/Makefile
projects/clang700-import/usr.bin/head/head.c
projects/clang700-import/usr.bin/wc/Makefile
projects/clang700-import/usr.bin/wc/wc.c
projects/clang700-import/usr.sbin/cpucontrol/amd.c
projects/clang700-import/usr.sbin/cpucontrol/amd10h.c
projects/clang700-import/usr.sbin/cpucontrol/cpucontrol.c
projects/clang700-import/usr.sbin/cpucontrol/cpucontrol.h
projects/clang700-import/usr.sbin/cpucontrol/intel.c
projects/clang700-import/usr.sbin/cpucontrol/via.c
Directory Properties:
projects/clang700-import/ (props changed)
Modified: projects/clang700-import/Makefile.inc1
==============================================================================
--- projects/clang700-import/Makefile.inc1 Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/Makefile.inc1 Wed Nov 14 06:46:44 2018 (r340427)
@@ -1287,7 +1287,7 @@ ITOOLS+=makewhatis
#
# Non-base distributions produced by the base system
-EXTRA_DISTRIBUTIONS= doc
+EXTRA_DISTRIBUTIONS=
.if defined(LIBCOMPAT)
EXTRA_DISTRIBUTIONS+= lib${libcompat}
.endif
@@ -1297,7 +1297,7 @@ EXTRA_DISTRIBUTIONS+= tests
DEBUG_DISTRIBUTIONS=
.if ${MK_DEBUG_FILES} != "no"
-DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,doc,,:S,tests,,}
+DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,tests,,}
.endif
MTREE_MAGIC?= mtree 2.0
Modified: projects/clang700-import/Makefile.libcompat
==============================================================================
--- projects/clang700-import/Makefile.libcompat Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/Makefile.libcompat Wed Nov 14 06:46:44 2018 (r340427)
@@ -17,7 +17,7 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
.if ${WANT_COMPILER_TYPE} == gcc || \
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
.else
-LIB32CPUFLAGS+= -target x86_64-unknown-freebsd12.0
+LIB32CPUFLAGS+= -target x86_64-unknown-freebsd13.0
.endif
LIB32CPUFLAGS+= -m32
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
@@ -49,9 +49,9 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
.endif
.else
.if ${TARGET_ARCH:Mmips64el*} != ""
-LIB32CPUFLAGS= -target mipsel-unknown-freebsd12.0
+LIB32CPUFLAGS= -target mipsel-unknown-freebsd13.0
.else
-LIB32CPUFLAGS= -target mips-unknown-freebsd12.0
+LIB32CPUFLAGS= -target mips-unknown-freebsd13.0
.endif
.endif
LIB32CPUFLAGS+= -mabi=32
Modified: projects/clang700-import/lib/Makefile
==============================================================================
--- projects/clang700-import/lib/Makefile Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/Makefile Wed Nov 14 06:46:44 2018 (r340427)
@@ -42,7 +42,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libdevctl \
libdevinfo \
libdevstat \
- ${_libdl} \
+ libdl \
libdwarf \
libedit \
libelftc \
@@ -191,10 +191,6 @@ SUBDIR.${MK_BHYVE}+= libvmmapi
.if ${MACHINE_CPUARCH} != "sparc64"
_libproc= libproc
_librtld_db= librtld_db
-.endif
-
-.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter}
-_libdl= libdl
.endif
SUBDIR.${MK_OPENSSL}+= libmp
Modified: projects/clang700-import/lib/csu/common/crtbegin.c
==============================================================================
--- projects/clang700-import/lib/csu/common/crtbegin.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/csu/common/crtbegin.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -32,12 +32,29 @@ typedef void (*crt_func)(void);
extern void *__dso_handle __hidden;
-#ifdef SHARED
-void *__dso_handle = &__dso_handle;
-#else
+#ifndef SHARED
void *__dso_handle = 0;
+#else
+void *__dso_handle = &__dso_handle;
+void __cxa_finalize(void *) __weak_symbol;
+
+/*
+ * Call __cxa_finalize with the dso handle in shared objects.
+ * When we have ctors/dtors call from the dtor handler before calling
+ * any dtors, otherwise use a destructor.
+ */
+#ifndef HAVE_CTORS
+__attribute__((destructor))
#endif
+static void
+run_cxa_finalize(void)
+{
+ if (__cxa_finalize != NULL)
+ __cxa_finalize(__dso_handle);
+}
+#endif
+
/*
* On some architectures and toolchains we may need to call the .dtors.
* These are called in the order they are in the ELF file.
@@ -57,6 +74,10 @@ __do_global_dtors_aux(void)
{
crt_func fn;
int n;
+
+#ifdef SHARED
+ run_cxa_finalize();
+#endif
for (n = 1;; n++) {
fn = __DTOR_LIST__[n];
Modified: projects/clang700-import/lib/libc/Versions.def
==============================================================================
--- projects/clang700-import/lib/libc/Versions.def Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libc/Versions.def Wed Nov 14 06:46:44 2018 (r340427)
@@ -31,6 +31,9 @@ FBSD_1.4 {
FBSD_1.5 {
} FBSD_1.4;
+# This version was first added to 13.0-current.
+FBSD_1.6 {
+} FBSD_1.5;
# This is our private namespace. Any global interfaces that are
# strictly for use only by other FreeBSD applications and libraries
@@ -39,4 +42,4 @@ FBSD_1.5 {
#
# Please do NOT increment the version of this namespace.
FBSDprivate_1.0 {
-} FBSD_1.5;
+} FBSD_1.6;
Modified: projects/clang700-import/lib/libcasper/services/Makefile
==============================================================================
--- projects/clang700-import/lib/libcasper/services/Makefile Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libcasper/services/Makefile Wed Nov 14 06:46:44 2018 (r340427)
@@ -3,6 +3,7 @@
.include <src.opts.mk>
SUBDIR= cap_dns
+SUBDIR+= cap_fileargs
SUBDIR+= cap_grp
SUBDIR+= cap_pwd
SUBDIR+= cap_random
Modified: projects/clang700-import/lib/libnv/common_impl.h
==============================================================================
--- projects/clang700-import/lib/libnv/common_impl.h Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libnv/common_impl.h Wed Nov 14 06:46:44 2018 (r340427)
@@ -34,6 +34,15 @@
#ifndef _COMMON_IMPL_H_
#define _COMMON_IMPL_H_
-#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF)
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+
+static inline bool
+fd_is_valid(int fd)
+{
+
+ return (fcntl(fd, F_GETFD) != -1 || errno != EBADF);
+}
#endif /* !_COMMON_IMPL_H_ */
Modified: projects/clang700-import/lib/libnv/msgio.c
==============================================================================
--- projects/clang700-import/lib/libnv/msgio.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libnv/msgio.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -66,11 +66,6 @@ msghdr_add_fd(struct cmsghdr *cmsg, int fd)
PJDLOG_ASSERT(fd >= 0);
- if (!fd_is_valid(fd)) {
- errno = EBADF;
- return (-1);
- }
-
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
Modified: projects/clang700-import/lib/libnv/tests/nvlist_send_recv_test.c
==============================================================================
--- projects/clang700-import/lib/libnv/tests/nvlist_send_recv_test.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libnv/tests/nvlist_send_recv_test.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -306,15 +306,12 @@ parent(int sock)
CHECK(name == NULL);
}
-int
-main(void)
+static void
+send_nvlist(void)
{
int status, socks[2];
pid_t pid;
- printf("1..134\n");
- fflush(stdout);
-
if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0)
err(1, "socketpair() failed");
pid = fork();
@@ -326,7 +323,7 @@ main(void)
/* Child. */
close(socks[0]);
child(socks[1]);
- return (0);
+ _exit(0);
default:
/* Parent. */
close(socks[1]);
@@ -336,6 +333,35 @@ main(void)
if (waitpid(pid, &status, 0) < 0)
err(1, "waitpid() failed");
+}
+
+static void
+send_closed_fd(void)
+{
+ nvlist_t *nvl;
+ int error, socks[2];
+
+ if (socketpair(PF_UNIX, SOCK_STREAM, 0, socks) < 0)
+ err(1, "socketpair() failed");
+
+ nvl = nvlist_create(0);
+ nvlist_add_descriptor(nvl, "fd", 12345);
+ error = nvlist_error(nvl);
+ CHECK(error == EBADF);
+
+ error = nvlist_send(socks[1], nvl);
+ CHECK(error != 0 && errno == EBADF);
+}
+
+int
+main(void)
+{
+
+ printf("1..136\n");
+ fflush(stdout);
+
+ send_nvlist();
+ send_closed_fd();
return (0);
}
Modified: projects/clang700-import/lib/libufs/Makefile
==============================================================================
--- projects/clang700-import/lib/libufs/Makefile Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libufs/Makefile Wed Nov 14 06:46:44 2018 (r340427)
@@ -3,12 +3,12 @@
PACKAGE=lib${LIB}
LIB= ufs
SHLIBDIR?= /lib
-SHLIB_MAJOR= 6
+SHLIB_MAJOR= 7
SRCS= block.c cgroup.c crc32.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c
INCS= libufs.h
-MAN= bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3
+MAN= bread.3 cgread.3 getinode.3 libufs.3 sbread.3 ufs_disk_close.3
MLINKS+= bread.3 bwrite.3
MLINKS+= bread.3 berase.3
MLINKS+= cgread.3 cgread1.3
@@ -16,6 +16,7 @@ MLINKS+= cgread.3 cgget.3
MLINKS+= cgread.3 cgwrite.3
MLINKS+= cgread.3 cgwrite1.3
MLINKS+= cgread.3 cgput.3
+MLINKS+= getinode.3 putinode.3
MLINKS+= sbread.3 sbwrite.3
MLINKS+= sbread.3 sbget.3
MLINKS+= sbread.3 sbput.3
Copied: projects/clang700-import/lib/libufs/getinode.3 (from r340426, head/lib/libufs/getinode.3)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/clang700-import/lib/libufs/getinode.3 Wed Nov 14 06:46:44 2018 (r340427, copy of r340426, head/lib/libufs/getinode.3)
@@ -0,0 +1,131 @@
+.\" Author: Marshall Kirk McKusick <mckusick at freebsd.org>
+.\" Date: January 19, 2018
+.\" Description:
+.\" Manual page for libufs functions:
+.\" getinode(3)
+.\" putinode(3)
+.\"
+.\" This file is in the public domain.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd November 10, 2018
+.Dt GETINODE 3
+.Os
+.Sh NAME
+.Nm getinode , putinode
+.Nd fetch and store inodes on a UFS file system
+.Sh LIBRARY
+.Lb libufs
+.Sh SYNOPSIS
+.In ufs/ufs/dinode.h
+.In ufs/ffs/fs.h
+.In libufs.h
+.Ft int
+.Fn getinode "struct uufsd *disk" "union dinodep *dp" "ino_t inumber"
+.Ft int
+.Fn putinode "struct uufsd *disk"
+.Sh DESCRIPTION
+The
+.Fn getinode
+and
+.Fn putinode
+functions provide an inode fetch and store API for
+.Xr libufs 3
+consumers.
+They operate on a userland UFS disk structure.
+The
+.Fn getinode
+function fetches the specified inode from the filesystem.
+The
+.Fn putinode
+function stores the most recently fetched inode to the filesystem.
+.Pp
+The
+.Va dinodep
+union is defined as:
+.Bd -literal -offset indent
+union dinodep {
+ struct ufs1_dinode *dp1;
+ struct ufs2_dinode *dp2;
+};
+.Ed
+.Pp
+Sample code to clear write permissions for inode number
+.Fa inumber
+stored on the filesystem described by
+.Fa diskp .
+.Bd -literal -offset indent
+#include <sys/stat.h>
+#include <err.h>
+
+#include <ufs/ufs/dinode.h>
+#include <ufs/ffs/fs.h>
+#include <libufs.h>
+
+void
+clearwrite(struct uufsd *diskp, ino_t inumber)
+{
+ union dinodep dp;
+
+ if (getinode(diskp, &dp, inumber) == -1)
+ err(1, "getinode: %s", diskp->d_error);
+ switch (diskp->d_ufs) {
+ case 1: /* UFS 1 filesystem */
+ dp.dp1->di_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
+ break;
+ case 2: /* UFS 2 filesystem */
+ dp.dp2->di_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
+ break;
+ default:
+ errx(1, "unknown filesystem type");
+ }
+ if (putinode(diskp) == -1)
+ err(1, "putinode: %s", diskp->d_error);
+}
+.Ed
+.Sh RETURN VALUES
+The
+.Fn getinode
+and
+.Fn putinode
+functions return 0 on success, or \-1 in case of any error.
+A string describing the error is stored in
+.Fa diskp->d_error .
+The global
+.Fa errno
+often provides additional information.
+.Sh ERRORS
+The function
+.Fn getinode
+may fail and set
+.Va errno
+for any of the errors specified for the library function
+.Xr pread 2 .
+It can also fail if the inode number is out of the range of inodes
+in the filesystem.
+.Pp
+The function
+.Fn putinode
+may fail and set
+.Va errno
+for any of the errors specified for the library functions
+.Xr ufs_disk_write 3
+or
+.Xr pwrite 2 .
+.Pp
+Additionally both functions may follow the
+.Xr libufs 3
+error methodologies in case of a device error.
+.Sh SEE ALSO
+.Xr pread 2 ,
+.Xr pwrite 2 ,
+.Xr libufs 3 ,
+.Xr ufs_disk_write 3
+.Sh HISTORY
+These functions first appeared as part of
+.Xr libufs 3
+in
+.Fx 13.0 .
+.Sh AUTHORS
+.An Marshall Kirk McKusick Aq Mt mckusick at freebsd.org
Modified: projects/clang700-import/lib/libufs/inode.c
==============================================================================
--- projects/clang700-import/lib/libufs/inode.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libufs/inode.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -49,18 +49,16 @@ __FBSDID("$FreeBSD$");
#include <libufs.h>
int
-getino(struct uufsd *disk, void **dino, ino_t inode, int *mode)
+getinode(struct uufsd *disk, union dinodep *dp, ino_t inum)
{
ino_t min, max;
caddr_t inoblock;
- struct ufs1_dinode *dp1;
- struct ufs2_dinode *dp2;
struct fs *fs;
ERROR(disk, NULL);
fs = &disk->d_fs;
- if (inode >= (ino_t)fs->fs_ipg * fs->fs_ncg) {
+ if (inum >= (ino_t)fs->fs_ipg * fs->fs_ncg) {
ERROR(disk, "inode number out of range");
return (-1);
}
@@ -76,26 +74,22 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i
}
disk->d_inoblock = inoblock;
}
- if (inode >= min && inode < max)
+ if (inum >= min && inum < max)
goto gotit;
- bread(disk, fsbtodb(fs, ino_to_fsba(fs, inode)), inoblock,
+ bread(disk, fsbtodb(fs, ino_to_fsba(fs, inum)), inoblock,
fs->fs_bsize);
- disk->d_inomin = min = inode - (inode % INOPB(fs));
+ disk->d_inomin = min = inum - (inum % INOPB(fs));
disk->d_inomax = max = min + INOPB(fs);
gotit: switch (disk->d_ufs) {
case 1:
- dp1 = &((struct ufs1_dinode *)inoblock)[inode - min];
- if (mode != NULL)
- *mode = dp1->di_mode & IFMT;
- if (dino != NULL)
- *dino = dp1;
+ disk->d_dp.dp1 = &((struct ufs1_dinode *)inoblock)[inum - min];
+ if (dp != NULL)
+ *dp = disk->d_dp;
return (0);
case 2:
- dp2 = &((struct ufs2_dinode *)inoblock)[inode - min];
- if (mode != NULL)
- *mode = dp2->di_mode & IFMT;
- if (dino != NULL)
- *dino = dp2;
+ disk->d_dp.dp2 = &((struct ufs2_dinode *)inoblock)[inum - min];
+ if (dp != NULL)
+ *dp = disk->d_dp;
return (0);
default:
break;
@@ -105,7 +99,7 @@ gotit: switch (disk->d_ufs) {
}
int
-putino(struct uufsd *disk)
+putinode(struct uufsd *disk)
{
struct fs *fs;
Modified: projects/clang700-import/lib/libufs/libufs.h
==============================================================================
--- projects/clang700-import/lib/libufs/libufs.h Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/lib/libufs/libufs.h Wed Nov 14 06:46:44 2018 (r340427)
@@ -35,6 +35,10 @@
/*
* libufs structures.
*/
+union dinodep {
+ struct ufs1_dinode *dp1;
+ struct ufs2_dinode *dp2;
+};
/*
* userland ufs disk.
@@ -49,6 +53,7 @@ struct uufsd {
caddr_t d_inoblock; /* inode block */
uint32_t d_inomin; /* low inode (not ino_t for ABI compat) */
uint32_t d_inomax; /* high inode (not ino_t for ABI compat) */
+ union dinodep d_dp; /* pointer to currently active inode */
union {
struct fs d_fs; /* filesystem information */
char d_sb[MAXBSIZE];
@@ -135,8 +140,8 @@ int cgwrite1(struct uufsd *, int);
/*
* inode.c
*/
-int getino(struct uufsd *, void **, ino_t, int *);
-int putino(struct uufsd *);
+int getinode(struct uufsd *, union dinodep *, ino_t);
+int putinode(struct uufsd *);
/*
* sblock.c
Modified: projects/clang700-import/release/scripts/make-manifest.sh
==============================================================================
--- projects/clang700-import/release/scripts/make-manifest.sh Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/release/scripts/make-manifest.sh Wed Nov 14 06:46:44 2018 (r340427)
@@ -10,7 +10,6 @@
# $FreeBSD$
base="Base system"
-doc="Additional Documentation"
kernel="Kernel"
ports="Ports tree"
src="System source tree"
@@ -19,7 +18,6 @@ tests="Test suite"
desc_base="${base} (MANDATORY)"
desc_base_dbg="${base} (Debugging)"
-desc_doc="${doc}"
desc_kernel="${kernel} (MANDATORY)"
desc_kernel_dbg="${kernel} (Debugging)"
desc_kernel_alt="Alternate ${kernel}"
@@ -30,7 +28,6 @@ desc_ports="${ports}"
desc_src="${src}"
desc_tests="${tests}"
-default_doc=off
default_src=off
default_ports=off
default_tests=off
@@ -51,6 +48,9 @@ for i in ${*}; do
desc="$(eval echo \"\${desc_${distname}}\")"
case ${i} in
+ doc.txz)
+ continue
+ ;;
kernel-dbg.txz)
desc="${desc_kernel_dbg}"
;;
Modified: projects/clang700-import/sbin/clri/clri.c
==============================================================================
--- projects/clang700-import/sbin/clri/clri.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/clri/clri.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -62,11 +62,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <unistd.h>
-union dinodep {
- struct ufs1_dinode *dp1;
- struct ufs2_dinode *dp2;
-};
-
static void
usage(void)
{
@@ -104,8 +99,8 @@ main(int argc, char *argv[])
}
(void)printf("clearing %d\n", inonum);
- if (getino(&disk, (void **)&dp, inonum, NULL) == -1) {
- printf("getino: %s\n", disk.d_error);
+ if (getinode(&disk, &dp, inonum) == -1) {
+ printf("getinode: %s\n", disk.d_error);
exitval = 1;
continue;
}
@@ -119,7 +114,7 @@ main(int argc, char *argv[])
memset(dp.dp2, 0, sizeof(*dp.dp2));
dp.dp2->di_gen = generation;
}
- putino(&disk);
+ putinode(&disk);
(void)fsync(disk.d_fd);
}
(void)ufs_disk_close(&disk);
Modified: projects/clang700-import/sbin/dump/dump.h
==============================================================================
--- projects/clang700-import/sbin/dump/dump.h Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/dump/dump.h Wed Nov 14 06:46:44 2018 (r340427)
@@ -126,7 +126,7 @@ void dumpabort(int signo) __dead2;
void dump_getfstab(void);
char *rawname(char *cp);
-union dinode *getinode(ino_t inum, int *mode);
+union dinode *getino(ino_t inum, int *mode);
/* rdump routines */
#ifdef RDUMP
Modified: projects/clang700-import/sbin/dump/main.c
==============================================================================
--- projects/clang700-import/sbin/dump/main.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/dump/main.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -549,7 +549,7 @@ main(int argc, char *argv[])
/*
* Skip directory inodes deleted and maybe reallocated
*/
- dp = getinode(ino, &mode);
+ dp = getino(ino, &mode);
if (mode != IFDIR)
continue;
(void)dumpino(dp, ino);
@@ -568,7 +568,7 @@ main(int argc, char *argv[])
/*
* Skip inodes deleted and reallocated as directories.
*/
- dp = getinode(ino, &mode);
+ dp = getino(ino, &mode);
if (mode == IFDIR)
continue;
(void)dumpino(dp, ino);
Modified: projects/clang700-import/sbin/dump/traverse.c
==============================================================================
--- projects/clang700-import/sbin/dump/traverse.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/dump/traverse.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -195,7 +195,7 @@ mapfiles(ino_t maxino, long *tapesize)
}
for (i = 0; i < inosused; i++, ino++) {
if (ino < UFS_ROOTINO ||
- (dp = getinode(ino, &mode)) == NULL ||
+ (dp = getino(ino, &mode)) == NULL ||
(mode & IFMT) == 0)
continue;
if (ino >= maxino) {
@@ -277,7 +277,7 @@ mapdirs(ino_t maxino, long *tapesize)
nodump = !nonodump && (TSTINO(ino, usedinomap) == 0);
if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump))
continue;
- dp = getinode(ino, &i);
+ dp = getino(ino, &i);
/*
* inode buf may change in searchdir().
*/
@@ -421,7 +421,7 @@ searchdir(
continue;
}
if (nodump) {
- ip = getinode(dp->d_ino, &mode);
+ ip = getino(dp->d_ino, &mode);
if (TSTINO(dp->d_ino, dumpinomap)) {
CLRINO(dp->d_ino, dumpinomap);
*tapesize -= blockest(ip);
@@ -875,7 +875,7 @@ writeheader(ino_t ino)
}
union dinode *
-getinode(ino_t inum, int *modep)
+getino(ino_t inum, int *modep)
{
static ino_t minino, maxino;
static caddr_t inoblock;
Modified: projects/clang700-import/sbin/ffsinfo/ffsinfo.c
==============================================================================
--- projects/clang700-import/sbin/ffsinfo/ffsinfo.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/ffsinfo/ffsinfo.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -262,7 +262,7 @@ main(int argc, char **argv)
dbg_csp = fscs;
/* ... and dump it */
- for(dbg_csc=0; dbg_csc<sblock.fs_ncg; dbg_csc++) {
+ for (dbg_csc = 0; dbg_csc < sblock.fs_ncg; dbg_csc++) {
snprintf(dbg_line, sizeof(dbg_line),
"%d. csum in fscs", dbg_csc);
DBG_DUMP_CSUM(&sblock,
@@ -342,8 +342,8 @@ void
dump_whole_ufs1_inode(ino_t inode, int level)
{
DBG_FUNC("dump_whole_ufs1_inode")
- struct ufs1_dinode *ino;
- int rb, mode;
+ union dinodep dp;
+ int rb;
unsigned int ind2ctr, ind3ctr;
ufs1_daddr_t *ind2ptr, *ind3ptr;
char comment[80];
@@ -353,10 +353,10 @@ dump_whole_ufs1_inode(ino_t inode, int level)
/*
* Read the inode from disk/cache.
*/
- if (getino(&disk, (void **)&ino, inode, &mode) == -1)
- err(1, "getino: %s", disk.d_error);
+ if (getinode(&disk, &dp, inode) == -1)
+ err(1, "getinode: %s", disk.d_error);
- if(ino->di_nlink==0) {
+ if (dp.dp1->di_nlink == 0) {
DBG_LEAVE;
return; /* inode not in use */
}
@@ -368,7 +368,7 @@ dump_whole_ufs1_inode(ino_t inode, int level)
if (level & 0x100) {
DBG_DUMP_INO(&sblock,
comment,
- ino);
+ dp.dp1);
}
if (!(level & 0x200)) {
@@ -379,13 +379,13 @@ dump_whole_ufs1_inode(ino_t inode, int level)
/*
* Ok, now prepare for dumping all direct and indirect pointers.
*/
- rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR;
- if(rb>0) {
+ rb = howmany(dp.dp1->di_size, sblock.fs_bsize) - UFS_NDADDR;
+ if (rb > 0) {
/*
* Dump single indirect block.
*/
- if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, dp.dp1->di_ib[0]),
+ (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 0",
@@ -394,14 +394,14 @@ dump_whole_ufs1_inode(ino_t inode, int level)
comment,
i1blk,
(size_t)rb);
- rb-=howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t));
+ rb -= howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t));
}
- if(rb>0) {
+ if (rb > 0) {
/*
* Dump double indirect blocks.
*/
- if (bread(&disk, fsbtodb(&sblock, ino->di_ib[1]), (void *)&i2blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, dp.dp1->di_ib[1]),
+ (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 1",
@@ -410,12 +410,12 @@ dump_whole_ufs1_inode(ino_t inode, int level)
comment,
i2blk,
howmany(rb, howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t))));
- for(ind2ctr=0; ((ind2ctr < howmany(sblock.fs_bsize,
- sizeof(ufs1_daddr_t))) && (rb>0)); ind2ctr++) {
- ind2ptr=&((ufs1_daddr_t *)(void *)&i2blk)[ind2ctr];
+ for (ind2ctr = 0; ((ind2ctr < howmany(sblock.fs_bsize,
+ sizeof(ufs1_daddr_t))) && (rb > 0)); ind2ctr++) {
+ ind2ptr = &((ufs1_daddr_t *)(void *)&i2blk)[ind2ctr];
- if (bread(&disk, fsbtodb(&sblock, *ind2ptr), (void *)&i1blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, *ind2ptr),
+ (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment),
@@ -425,15 +425,15 @@ dump_whole_ufs1_inode(ino_t inode, int level)
comment,
i1blk,
(size_t)rb);
- rb-=howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t));
+ rb -= howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t));
}
}
- if(rb>0) {
+ if (rb > 0) {
/*
* Dump triple indirect blocks.
*/
- if (bread(&disk, fsbtodb(&sblock, ino->di_ib[2]), (void *)&i3blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, dp.dp1->di_ib[2]),
+ (void *)&i3blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 2",
@@ -445,12 +445,12 @@ dump_whole_ufs1_inode(ino_t inode, int level)
howmany(rb,
SQUARE(howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t)))));
#undef SQUARE
- for(ind3ctr=0; ((ind3ctr<howmany(sblock.fs_bsize,
- sizeof(ufs1_daddr_t)))&&(rb>0)); ind3ctr++) {
- ind3ptr=&((ufs1_daddr_t *)(void *)&i3blk)[ind3ctr];
+ for (ind3ctr = 0; ((ind3ctr < howmany(sblock.fs_bsize,
+ sizeof(ufs1_daddr_t))) && (rb > 0)); ind3ctr++) {
+ ind3ptr = &((ufs1_daddr_t *)(void *)&i3blk)[ind3ctr];
- if (bread(&disk, fsbtodb(&sblock, *ind3ptr), (void *)&i2blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, *ind3ptr),
+ (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment),
@@ -461,8 +461,8 @@ dump_whole_ufs1_inode(ino_t inode, int level)
i2blk,
howmany(rb,
howmany(sblock.fs_bsize, sizeof(ufs1_daddr_t))));
- for(ind2ctr=0; ((ind2ctr < howmany(sblock.fs_bsize,
- sizeof(ufs1_daddr_t)))&&(rb>0)); ind2ctr++) {
+ for (ind2ctr = 0; ((ind2ctr < howmany(sblock.fs_bsize,
+ sizeof(ufs1_daddr_t))) && (rb > 0)); ind2ctr++) {
ind2ptr=&((ufs1_daddr_t *)(void *)&i2blk)
[ind2ctr];
if (bread(&disk, fsbtodb(&sblock, *ind2ptr),
@@ -477,7 +477,7 @@ dump_whole_ufs1_inode(ino_t inode, int level)
comment,
i1blk,
(size_t)rb);
- rb-=howmany(sblock.fs_bsize,
+ rb -= howmany(sblock.fs_bsize,
sizeof(ufs1_daddr_t));
}
}
@@ -496,8 +496,8 @@ void
dump_whole_ufs2_inode(ino_t inode, int level)
{
DBG_FUNC("dump_whole_ufs2_inode")
- struct ufs2_dinode *ino;
- int rb, mode;
+ union dinodep dp;
+ int rb;
unsigned int ind2ctr, ind3ctr;
ufs2_daddr_t *ind2ptr, *ind3ptr;
char comment[80];
@@ -507,10 +507,10 @@ dump_whole_ufs2_inode(ino_t inode, int level)
/*
* Read the inode from disk/cache.
*/
- if (getino(&disk, (void **)&ino, inode, &mode) == -1)
- err(1, "getino: %s", disk.d_error);
+ if (getinode(&disk, &dp, inode) == -1)
+ err(1, "getinode: %s", disk.d_error);
- if (ino->di_nlink == 0) {
+ if (dp.dp2->di_nlink == 0) {
DBG_LEAVE;
return; /* inode not in use */
}
@@ -520,7 +520,7 @@ dump_whole_ufs2_inode(ino_t inode, int level)
*/
snprintf(comment, sizeof(comment), "Inode 0x%08jx", (uintmax_t)inode);
if (level & 0x100) {
- DBG_DUMP_INO(&sblock, comment, ino);
+ DBG_DUMP_INO(&sblock, comment, dp.dp2);
}
if (!(level & 0x200)) {
@@ -531,13 +531,13 @@ dump_whole_ufs2_inode(ino_t inode, int level)
/*
* Ok, now prepare for dumping all direct and indirect pointers.
*/
- rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR;
+ rb = howmany(dp.dp2->di_size, sblock.fs_bsize) - UFS_NDADDR;
if (rb > 0) {
/*
* Dump single indirect block.
*/
- if (bread(&disk, fsbtodb(&sblock, ino->di_ib[0]), (void *)&i1blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, dp.dp2->di_ib[0]),
+ (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 0",
@@ -549,8 +549,8 @@ dump_whole_ufs2_inode(ino_t inode, int level)
/*
* Dump double indirect blocks.
*/
- if (bread(&disk, fsbtodb(&sblock, ino->di_ib[1]), (void *)&i2blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, dp.dp2->di_ib[1]),
+ (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 1",
@@ -563,8 +563,8 @@ dump_whole_ufs2_inode(ino_t inode, int level)
sizeof(ufs2_daddr_t))) && (rb>0)); ind2ctr++) {
ind2ptr = &((ufs2_daddr_t *)(void *)&i2blk)[ind2ctr];
- if (bread(&disk, fsbtodb(&sblock, *ind2ptr), (void *)&i1blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, *ind2ptr),
+ (void *)&i1blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment),
@@ -578,8 +578,8 @@ dump_whole_ufs2_inode(ino_t inode, int level)
/*
* Dump triple indirect blocks.
*/
- if (bread(&disk, fsbtodb(&sblock, ino->di_ib[2]), (void *)&i3blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, dp.dp2->di_ib[2]),
+ (void *)&i3blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment), "Inode 0x%08jx: indirect 2",
@@ -595,8 +595,8 @@ dump_whole_ufs2_inode(ino_t inode, int level)
sizeof(ufs2_daddr_t))) && (rb > 0)); ind3ctr++) {
ind3ptr = &((ufs2_daddr_t *)(void *)&i3blk)[ind3ctr];
- if (bread(&disk, fsbtodb(&sblock, *ind3ptr), (void *)&i2blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, *ind3ptr),
+ (void *)&i2blk, (size_t)sblock.fs_bsize) == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment),
@@ -610,8 +610,9 @@ dump_whole_ufs2_inode(ino_t inode, int level)
for (ind2ctr = 0; ((ind2ctr < howmany(sblock.fs_bsize,
sizeof(ufs2_daddr_t))) && (rb > 0)); ind2ctr++) {
ind2ptr = &((ufs2_daddr_t *)(void *)&i2blk) [ind2ctr];
- if (bread(&disk, fsbtodb(&sblock, *ind2ptr), (void *)&i1blk,
- (size_t)sblock.fs_bsize) == -1) {
+ if (bread(&disk, fsbtodb(&sblock, *ind2ptr),
+ (void *)&i1blk, (size_t)sblock.fs_bsize)
+ == -1) {
err(1, "bread: %s", disk.d_error);
}
snprintf(comment, sizeof(comment),
Modified: projects/clang700-import/sbin/fsck_ffs/dir.c
==============================================================================
--- projects/clang700-import/sbin/fsck_ffs/dir.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/fsck_ffs/dir.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -254,14 +254,14 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg)
char pathbuf[MAXPATHLEN + 1];
pwarn("%s ", errmesg);
- pinode(ino);
- printf("\n");
- getpathname(pathbuf, cwd, ino);
if (ino < UFS_ROOTINO || ino > maxino) {
- pfatal("NAME=%s\n", pathbuf);
+ pfatal("out-of-range inode number %ju", (uintmax_t)ino);
return;
}
dp = ginode(ino);
+ prtinode(ino, dp);
+ printf("\n");
+ getpathname(pathbuf, cwd, ino);
if (ftypeok(dp))
pfatal("%s=%s\n",
(DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE",
@@ -309,7 +309,7 @@ adjust(struct inodesc *idesc, int lcnt)
if (lcnt != 0) {
pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname :
((DIP(dp, di_mode) & IFMT) == IFDIR ? "DIR" : "FILE"));
- pinode(idesc->id_number);
+ prtinode(idesc->id_number, dp);
printf(" COUNT %d SHOULD BE %d",
DIP(dp, di_nlink), DIP(dp, di_nlink) - lcnt);
if (preen || usedsoftdep) {
@@ -390,7 +390,8 @@ linkup(ino_t orphan, ino_t parentdir, char *name)
dp = ginode(orphan);
lostdir = (DIP(dp, di_mode) & IFMT) == IFDIR;
pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");
- pinode(orphan);
+ prtinode(orphan, dp);
+ printf("\n");
if (preen && DIP(dp, di_size) == 0)
return (0);
if (cursnapshot != 0) {
Modified: projects/clang700-import/sbin/fsck_ffs/fsck.h
==============================================================================
--- projects/clang700-import/sbin/fsck_ffs/fsck.h Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/fsck_ffs/fsck.h Wed Nov 14 06:46:44 2018 (r340427)
@@ -463,8 +463,8 @@ void pass4(void);
int pass4check(struct inodesc *);
void pass5(void);
void pfatal(const char *fmt, ...) __printflike(1, 2);
-void pinode(ino_t ino);
void propagate(void);
+void prtinode(ino_t ino, union dinode *dp);
void pwarn(const char *fmt, ...) __printflike(1, 2);
int readsb(int listerr);
int reply(const char *question);
Modified: projects/clang700-import/sbin/fsck_ffs/gjournal.c
==============================================================================
--- projects/clang700-import/sbin/fsck_ffs/gjournal.c Wed Nov 14 04:50:29 2018 (r340426)
+++ projects/clang700-import/sbin/fsck_ffs/gjournal.c Wed Nov 14 06:46:44 2018 (r340427)
@@ -392,13 +392,12 @@ clear_inode(struct ufs2_dinode *dino)
void
gjournal_check(const char *filesys)
{
- struct ufs2_dinode *dino;
- void *p;
+ union dinodep dp;
struct cgchain *cgc;
struct cg *cgp;
uint8_t *inosused;
ino_t cino, ino;
- int cg, mode;
+ int cg;
devnam = filesys;
opendisk();
@@ -444,19 +443,20 @@ gjournal_check(const char *filesys)
/* Unallocated? Skip it. */
if (isclr(inosused, cino))
continue;
- if (getino(diskp, &p, ino, &mode) == -1)
- err(1, "getino(cg=%d ino=%ju)",
- cg, (uintmax_t)ino);
- dino = p;
+ if (getinode(diskp, &dp, ino) == -1)
+ err(1, "getinode (cg=%d ino=%ju) %s",
+ cg, (uintmax_t)ino, diskp->d_error);
/* Not a regular file nor directory? Skip it. */
- if (!S_ISREG(dino->di_mode) && !S_ISDIR(dino->di_mode))
+ if (!S_ISREG(dp.dp2->di_mode) &&
+ !S_ISDIR(dp.dp2->di_mode))
continue;
/* Has reference(s)? Skip it. */
- if (dino->di_nlink > 0)
+ if (dp.dp2->di_nlink > 0)
continue;
- //printf("Clearing inode=%d (size=%jd)\n", ino, (intmax_t)dino->di_size);
+ /* printf("Clearing inode=%d (size=%jd)\n", ino,
+ (intmax_t)dp.dp2->di_size); */
/* Free inode's blocks. */
- clear_inode(dino);
+ clear_inode(dp.dp2);
/* Deallocate it. */
clrbit(inosused, cino);
/* Update position of last used inode. */
@@ -469,17 +469,17 @@ gjournal_check(const char *filesys)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list