From: Joerg Sonnenberger Date: Tue, 2 Aug 2005 13:03:55 +0000 (+0000) Subject: Make nlink_t 32bit and ino_t 64bit. Implement the old syscall numbers X-Git-Tag: v2.0.1~6403 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/f91a71dd15504ebdb04387d0822771ef145b25f9 Make nlink_t 32bit and ino_t 64bit. Implement the old syscall numbers for *stat by wrapping the new syscalls and truncation of the values. Add a hack for boot2 to keep ino_t 32bit, otherwise we would have to link the 64bit math code in and that would most likely overflow boot2. Bump libc major to annotate changed ABI and work around a problem with strip during installworld. strip is dynamically linked and doesn't play well with the new libc otherwise. Support for 64bit inode numbers is still incomplete, because the dirent limited to 32bit. The checks for nlink_t have to be redone too. --- diff --git a/lib/libc/Makefile b/lib/libc/Makefile index bbc9068c27..1cfa1cfa6e 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # $FreeBSD: src/lib/libc/Makefile,v 1.24 1999/09/29 15:18:29 marcel Exp $ -# $DragonFly: src/lib/libc/Makefile,v 1.11 2005/05/03 15:49:17 joerg Exp $ +# $DragonFly: src/lib/libc/Makefile,v 1.12 2005/08/02 13:03:54 joerg Exp $ # # All library objects contain rcsid strings by default; they may be # excluded as a space-saving measure. To produce a library that does @@ -8,7 +8,7 @@ # from CFLAGS below. To remove these strings from just the system call # stubs, remove just -DSYSLIBC_RCS from CFLAGS. LIB=c -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/include AINC= -I${.CURDIR}/${MACHINE_ARCH} CLEANFILES+=tags diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index 820ef35d00..cea7606227 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.47 2003/06/26 03:51:57 peter Exp $ -# $DragonFly: src/sys/boot/i386/boot2/Attic/Makefile,v 1.14 2005/07/07 11:49:56 corecode Exp $ +# $DragonFly: src/sys/boot/i386/boot2/Attic/Makefile,v 1.15 2005/08/02 13:03:54 joerg Exp $ PROG= boot2 NOMAN= @@ -58,7 +58,8 @@ CFLAGS= -elf -ffreestanding -Os -fno-builtin \ -I${.CURDIR}/../btx/lib -I. \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -D__BOOT2_HACK # -mrtd will produce bad code (missing stack pops) when combined with # gcc-3.4's (default on) unit-at-a-time optimization. See the code diff --git a/sys/boot/pc32/boot2/Makefile b/sys/boot/pc32/boot2/Makefile index 6a26bf6a79..60b4688036 100644 --- a/sys/boot/pc32/boot2/Makefile +++ b/sys/boot/pc32/boot2/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.47 2003/06/26 03:51:57 peter Exp $ -# $DragonFly: src/sys/boot/pc32/boot2/Makefile,v 1.14 2005/07/07 11:49:56 corecode Exp $ +# $DragonFly: src/sys/boot/pc32/boot2/Makefile,v 1.15 2005/08/02 13:03:54 joerg Exp $ PROG= boot2 NOMAN= @@ -58,7 +58,8 @@ CFLAGS= -elf -ffreestanding -Os -fno-builtin \ -I${.CURDIR}/../btx/lib -I. \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ + -D__BOOT2_HACK # -mrtd will produce bad code (missing stack pops) when combined with # gcc-3.4's (default on) unit-at-a-time optimization. See the code diff --git a/sys/conf/files b/sys/conf/files index 0983f72875..b294ce12b5 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/conf/files,v 1.340.2.137 2003/06/04 17:10:30 sam Exp $ -# $DragonFly: src/sys/conf/files,v 1.99 2005/07/23 07:33:43 dillon Exp $ +# $DragonFly: src/sys/conf/files,v 1.100 2005/08/02 13:03:54 joerg Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1451,3 +1451,4 @@ emulation/43bsd/43bsd_exit.c optional compat_43 emulation/43bsd/43bsd_resource.c optional compat_43 emulation/43bsd/43bsd_hostinfo.c optional compat_43 emulation/43bsd/43bsd_vm.c optional compat_43 +emulation/dragonfly12/dfbsd12_stat.c optional compat_43 diff --git a/sys/emulation/43bsd/stat.h b/sys/emulation/43bsd/stat.h index d0e87e30b5..9cae008ebc 100644 --- a/sys/emulation/43bsd/stat.h +++ b/sys/emulation/43bsd/stat.h @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/emulation/43bsd/stat.h,v 1.2 2005/07/30 21:52:28 joerg Exp $ + * $DragonFly: src/sys/emulation/43bsd/stat.h,v 1.3 2005/08/02 13:03:54 joerg Exp $ */ #ifndef _EMULATION_43BSD_STAT_H_ @@ -42,9 +42,9 @@ struct ostat { u_int16_t st_dev; /* inode's device */ - ino_t st_ino; /* inode's number */ + u_int32_t st_ino; /* inode's number */ mode_t st_mode; /* inode protection mode */ - nlink_t st_nlink; /* number of hard links */ + u_int16_t st_nlink; /* number of hard links */ u_int16_t st_uid; /* user ID of the file's owner */ u_int16_t st_gid; /* group ID of the file's group */ u_int16_t st_rdev; /* device type */ diff --git a/sys/emulation/dragonfly12/dfbsd12_stat.c b/sys/emulation/dragonfly12/dfbsd12_stat.c new file mode 100644 index 0000000000..220ec69a85 --- /dev/null +++ b/sys/emulation/dragonfly12/dfbsd12_stat.c @@ -0,0 +1,178 @@ +/*- + * Copyright (c) 2005 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Joerg Sonnenberger . + * + * 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 DragonFly Project 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 COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDERS 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. + * + * $DragonFly: src/sys/emulation/dragonfly12/dfbsd12_stat.c,v 1.1 2005/08/02 13:03:54 joerg Exp $ + */ + +#include "opt_compatdf12.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void +cvtstat(struct dfbsd12_stat *oldstat, struct stat *newstat) +{ + bzero(oldstat, sizeof(oldstat)); + + oldstat->st_dev = newstat->st_dev; + oldstat->st_ino = newstat->st_ino; /* truncation */ + oldstat->st_mode = newstat->st_mode; + oldstat->st_nlink = newstat->st_nlink; /* truncation */ + oldstat->st_uid = newstat->st_uid; + oldstat->st_gid = newstat->st_gid; + oldstat->st_rdev = newstat->st_rdev; + oldstat->st_atimespec = newstat->st_atimespec; + oldstat->st_mtimespec = newstat->st_mtimespec; + oldstat->st_ctimespec = newstat->st_ctimespec; + oldstat->st_size = newstat->st_size; + oldstat->st_blocks = newstat->st_blocks; + oldstat->st_blksize = newstat->st_blksize; + oldstat->st_flags = newstat->st_flags; + oldstat->st_gen = newstat->st_gen; +} + +/* + * stat_args(char *path, struct dfbsd12_stat *ub) + * + * Get file status; this version follows links. + */ +int +dfbsd12_stat(struct dfbsd12_stat_args *uap) +{ + struct nlookupdata nd; + struct dfbsd12_stat ost; + struct stat st; + int error; + + error = nlookup_init(&nd, uap->path, UIO_USERSPACE, NLC_FOLLOW); + if (error == 0) { + error = kern_stat(&nd, &st); + if (error == 0) { + cvtstat(&ost, &st); + error = copyout(&ost, uap->ub, sizeof(ost)); + } + } + nlookup_done(&nd); + return (error); +} + +/* + * lstat_args(char *path, struct dfbsd12_stat *ub) + * + * Get file status; this version does not follow links. + */ +int +dfbsd12_lstat(struct dfbsd12_lstat_args *uap) +{ + struct nlookupdata nd; + struct dfbsd12_stat ost; + struct stat st; + int error; + + error = nlookup_init(&nd, uap->path, UIO_USERSPACE, 0); + if (error == 0) { + error = kern_stat(&nd, &st); + if (error == 0) { + cvtstat(&ost, &st); + error = copyout(&ost, uap->ub, sizeof(ost)); + } + } + nlookup_done(&nd); + return (error); +} + +/* + * fhstat_args(struct fhandle *u_fhp, struct dfbsd12_stat *sb) + */ +int +dfbsd12_fhstat(struct dfbsd12_fhstat_args *uap) +{ + struct thread *td = curthread; + struct dfbsd12_stat osb; + struct stat sb; + fhandle_t fh; + struct mount *mp; + struct vnode *vp; + int error; + + /* + * Must be super user + */ + error = suser(td); + if (error) + return (error); + + error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); + if (error) + return (error); + + if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL) + return (ESTALE); + if ((error = VFS_FHTOVP(mp, &fh.fh_fid, &vp))) + return (error); + error = vn_stat(vp, &sb, td); + vput(vp); + if (error) + return (error); + cvtstat(&osb, &sb); + error = copyout(&osb, uap->sb, sizeof(osb)); + return (error); +} + +/* + * dfbsd12_fstat_args(int fd, struct dfbsd12_stat *sb) + */ +int +dfbsd12_fstat(struct dfbsd12_fstat_args *uap) +{ + struct dfbsd12_stat ost; + struct stat st; + int error; + + error = kern_fstat(uap->fd, &st); + + if (error == 0) { + cvtstat(&ost, &st); + error = copyout(&ost, uap->sb, sizeof(ost)); + } + return (error); +} diff --git a/sys/emulation/43bsd/stat.h b/sys/emulation/dragonfly12/stat.h similarity index 76% copy from sys/emulation/43bsd/stat.h copy to sys/emulation/dragonfly12/stat.h index d0e87e30b5..ff87d5dd1b 100644 --- a/sys/emulation/43bsd/stat.h +++ b/sys/emulation/dragonfly12/stat.h @@ -32,30 +32,32 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/emulation/43bsd/stat.h,v 1.2 2005/07/30 21:52:28 joerg Exp $ + * $DragonFly: src/sys/emulation/dragonfly12/stat.h,v 1.1 2005/08/02 13:03:54 joerg Exp $ */ -#ifndef _EMULATION_43BSD_STAT_H_ -#define _EMULATION_43BSD_STAT_H_ +#ifndef _EMULATION_DRAGONFLY12_STAT_H_ +#define _EMULATION_DRAGONFLY12_STAT_H_ #include -struct ostat { - u_int16_t st_dev; /* inode's device */ - ino_t st_ino; /* inode's number */ +struct dfbsd12_stat { + udev_t st_dev; /* inode's device */ + uint32_t st_ino; /* inode's number */ mode_t st_mode; /* inode protection mode */ - nlink_t st_nlink; /* number of hard links */ - u_int16_t st_uid; /* user ID of the file's owner */ - u_int16_t st_gid; /* group ID of the file's group */ - u_int16_t st_rdev; /* device type */ - int32_t st_size; /* file size, in bytes */ + uint16_t st_nlink; /* number of hard links */ + uid_t st_uid; /* user ID of the file's owner */ + gid_t st_gid; /* group ID of the file's group */ + udev_t st_rdev; /* device type */ struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_ctimespec; /* time of last file status change */ - int32_t st_blksize; /* optimal blocksize for I/O */ - int32_t st_blocks; /* blocks allocated for file */ + off_t st_size; /* file size, in bytes */ + int64_t st_blocks; /* blocks allocated for file */ + u_int32_t st_blksize; /* optimal blocksize for I/O */ u_int32_t st_flags; /* user defined flags for file */ u_int32_t st_gen; /* file generation number */ + int32_t st_lspare; + int64_t st_qspare[2]; }; -#endif /* !_EMULATION_43BSD_STAT_H_ */ +#endif /* !_EMULATION_DRAGONFLY12_STAT_H_ */ diff --git a/sys/emulation/svr4/svr4_socket.c b/sys/emulation/svr4/svr4_socket.c index 011652955d..fe1fcbfb4a 100644 --- a/sys/emulation/svr4/svr4_socket.c +++ b/sys/emulation/svr4/svr4_socket.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/svr4/svr4_socket.c,v 1.7 1999/12/08 12:00:48 newton Exp $ - * $DragonFly: src/sys/emulation/svr4/Attic/svr4_socket.c,v 1.6 2004/08/02 13:22:32 joerg Exp $ + * $DragonFly: src/sys/emulation/svr4/Attic/svr4_socket.c,v 1.7 2005/08/02 13:03:54 joerg Exp $ */ /* @@ -55,6 +55,8 @@ #include #include +#include + #include "svr4.h" #include "svr4_types.h" #include "svr4_util.h" @@ -86,7 +88,7 @@ svr4_find_socket(td, fp, dev, ino) void *cookie = ((struct socket *) fp->f_data)->so_emuldata; if (!svr4_str_initialized) { - DPRINTF(("svr4_find_socket: uninitialized [%p,%d,%d]\n", + DPRINTF(("svr4_find_socket: uninitialized [%p,%d,%"PRId64"]\n", td, dev, ino)); TAILQ_INIT(&svr4_head); svr4_str_initialized = 1; @@ -94,7 +96,7 @@ svr4_find_socket(td, fp, dev, ino) } - DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", td, dev, ino)); + DPRINTF(("svr4_find_socket: [%p,%d,%"PRId64"]: ", td, dev, ino)); TAILQ_FOREACH(e, &svr4_head, entries) if (e->td == td && e->dev == dev && e->ino == ino) { #ifdef DIAGNOSTIC @@ -146,7 +148,7 @@ svr4_add_socket(td, path, st) e->sock.sun_len = len; TAILQ_INSERT_HEAD(&svr4_head, e, entries); - DPRINTF(("svr4_add_socket: %s [%p,%d,%d]\n", e->sock.sun_path, + DPRINTF(("svr4_add_socket: %s [%p,%d,%"PRId64"]\n", e->sock.sun_path, td, e->dev, e->ino)); return 0; } diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index ae73c90ee1..577c7d19c3 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -1,12 +1,14 @@ #! /bin/sh - # @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93 # $FreeBSD: src/sys/kern/makesyscalls.sh,v 1.39.2.4 2001/10/20 09:01:24 marcel Exp $ -# $DragonFly: src/sys/kern/makesyscalls.sh,v 1.11 2004/08/12 19:59:30 eirikn Exp $ +# $DragonFly: src/sys/kern/makesyscalls.sh,v 1.12 2005/08/02 13:03:55 joerg Exp $ set -e # name of compat option: compat=COMPAT_43 +# name of DragonFly 1.2 compat option +compatdf12=COMPAT_DF12 # output files: sysnames="syscalls.c" @@ -25,15 +27,17 @@ namesname="syscallnames" # tmp files: sysdcl="sysent.dcl.$$" syscompat="sysent.compat.$$" +syscompatdf12="sysent.compatdf12.$$" syscompatdcl="sysent.compatdcl.$$" +syscompatdcldf12="sysent.compatdcldf12.$$" sysent="sysent.switch.$$" sysinc="sysinc.switch.$$" sysarg="sysarg.switch.$$" sysun="sysunion.switch.$$" -trap "rm $sysdcl $syscompat $syscompatdcl $sysent $sysinc $sysarg $sysun" 0 +trap "rm $sysdcl $syscompat $syscompatdf12 $syscompatdcl $syscompatdcldf12 $sysent $sysinc $sysarg $sysun" 0 -touch $sysdcl $syscompat $syscompatdcl $sysent $sysinc $sysarg $sysun +touch $sysdcl $syscompat $syscompatdf12 $syscompatdcl $syscompatdf12 $sysent $sysinc $sysarg $sysun case $# in 0) echo "Usage: $0 input-file " 1>&2 @@ -63,7 +67,9 @@ s/\$//g sysproto = \"$sysproto\" sysproto_h = \"$sysproto_h\" syscompat = \"$syscompat\" + syscompatdf12 = \"$syscompatdf12\" syscompatdcl = \"$syscompatdcl\" + syscompatdcldf12 = \"$syscompatdcldf12\" sysent = \"$sysent\" syssw = \"$syssw\" sysinc = \"$sysinc\" @@ -73,6 +79,7 @@ s/\$//g syshdr = \"$syshdr\" sysmk = \"$sysmk\" compat = \"$compat\" + compatdf12 = \"$compatdf12\" syshide = \"$syshide\" syscallprefix = \"$syscallprefix\" switchname = \"$switchname\" @@ -90,6 +97,7 @@ s/\$//g printf " * \$\DragonFly\$\n" > sysarg printf "\n#ifdef %s\n\n", compat > syscompat + printf "\n#ifdef %s\n\n", compatdf12 > syscompatdf12 printf "/*\n * System call names.\n *\n" > sysnames printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames @@ -110,6 +118,7 @@ s/\$//g printf " * \$\DragonFly\$\n" > sysun printf "\n#ifdef _KERNEL\n\n" > sysdcl printf "\n#ifdef _KERNEL\n\n" > syscompatdcl + printf "\n#ifdef _KERNEL\n\n" > syscompatdcldf12 printf "# System call argument table.\n" > sysargs printf "# DO NOT EDIT-- this file is automatically generated.\n" > sysargs @@ -164,6 +173,7 @@ s/\$//g print > sysdcl print > sysarg print > syscompat + print > syscompatdf12 print > sysnames print > syshide print > sysun @@ -176,6 +186,7 @@ s/\$//g print > sysarg print > sysun print > syscompat + print > syscompatdf12 print > sysnames print > syshide syscall = savesyscall @@ -187,6 +198,7 @@ s/\$//g print > sysarg print > sysun print > syscompat + print > syscompatdf12 print > sysnames print > syshide next @@ -256,6 +268,10 @@ s/\$//g argalias = "o" argalias usefuncname = "o" funcname } + if ($2 == "COMPAT_DF12") { + argalias = "dfbsd12_" argalias + usefuncname = "dfbsd12_" funcname + } } f++ @@ -414,6 +430,50 @@ s/\$//g syscall++ next } + $2 == "COMPAT_DF12" { + ncompatdf12++ + parseline() + if (argc != 0) { + printf("#ifdef %s\n", compatdf12) > sysun + printf("\tstruct\t%s %s;\n", argalias, usefuncname) > sysun + printf("#endif\n") > sysun + printf("struct\t%s {\n", argalias) > syscompatdf12 + printf("#ifdef _KERNEL\n") > syscompatdf12 + printf("\tstruct sysmsg sysmsg;\n") > syscompatdf12 + printf("#endif\n") > syscompatdf12 + printf("\tunion usrmsg usrmsg;\n") > syscompatdf12 + for (i = 1; i <= argc; i++) + printf("\t%s\t%s;\tchar %s_[PAD_(%s)];\n", + argtype[i], argname[i], + argname[i], argtype[i]) > syscompatdf12 + printf("};\n") > syscompatdf12 + } + else { + printf("\tstruct\t%s %s;\n", argalias, usefuncname) > sysun + printf("struct\t%s {\n", argalias) > sysarg + printf("#ifdef _KERNEL\n") > sysarg + printf("\tstruct sysmsg sysmsg;\n") > sysarg + printf("#endif\n") > sysarg + printf("\tunion usrmsg usrmsg;\n") > sysarg + printf("\tregister_t dummy;\n") > sysarg + printf("};\n") > sysarg + } + printf("%s\tdfbsd12_%s (struct %s *);\n", + rettype, funcname, argalias) > syscompatdcldf12 + printf("\t{ compatdf12(%s%s,%s) },", + mpsafe, argssize, funcname) > sysent + align_sysent_comment(8 + 9 + length(mpsafe) + \ + length(argssize) + 1 + length(funcname) + 4) + printf("/* %d = old %s */\n", syscall, funcalias) > sysent + printf("\t\"old.%s\",\t\t/* %d = old %s */\n", + funcalias, syscall, funcalias) > sysnames + printf("\t\t\t\t/* %d is old %s */\n", + syscall, funcalias) > syshdr + if ($3 != "NOHIDE") + printf("HIDE_%s(%s)\n", $3, funcname) > syshide + syscall++ + next + } $2 == "LIBCOMPAT" { ncompat++ parseline() @@ -475,20 +535,31 @@ s/\$//g printf "#endif\n" > sysinc } + if (ncompatdf12 != 0) { + printf "#include \"opt_compatdf12.h\"\n\n" > syssw + printf "\n#ifdef %s\n", compatdf12 > sysinc + printf "#define compatdf12(n, name) n, (sy_call_t *)__CONCAT(dfbsd12_,name)\n" > sysinc + printf "#else\n" > sysinc + printf "#define compatdf12(n, name) 0, (sy_call_t *)nosys\n" > sysinc + printf "#endif\n" > sysinc + } + printf("\n#endif /* _KERNEL */\n") > syscompatdcl + printf("\n#endif /* _KERNEL */\n") > syscompatdcldf12 printf("\n#endif /* %s */\n\n", compat) > syscompatdcl - printf("#undef PAD_\n") > syscompatdcl - printf("\n#endif /* !%s */\n", sysproto_h) > syscompatdcl + printf("\n#endif /* %s */\n\n", compatdf12) > syscompatdcldf12 printf("\n") > sysmk printf("};\n") > sysent printf("};\n") > sysnames printf("};\n") > sysun + printf("\n#endif /* !%s */\n", sysproto_h) > sysdcl + printf("#undef PAD_\n") > sysdcl printf("\n#endif /* _KERNEL */\n") > sysdcl printf("#define\t%sMAXSYSCALL\t%d\n", syscallprefix, syscall) \ > syshdr } ' cat $sysinc $sysent >> $syssw -cat $sysarg $sysdcl $syscompat $syscompatdcl > $sysproto +cat $sysarg $syscompat $syscompatdcl $syscompatdf12 $syscompatdcldf12 $sysdcl > $sysproto cat $sysun > $sysunion diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index c109cd1774..cd961708cd 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,4 +1,4 @@ - $DragonFly: src/sys/kern/syscalls.master,v 1.25 2005/07/30 20:29:40 joerg Exp $ + $DragonFly: src/sys/kern/syscalls.master,v 1.26 2005/08/02 13:03:55 joerg Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 ; $FreeBSD: src/sys/kern/syscalls.master,v 1.72.2.10 2002/07/12 08:22:46 alfred Exp $ @@ -37,6 +37,8 @@ #include #endif +#include + ; Reserved/unimplemented system calls in the range 0-150 inclusive ; are reserved for use in future Berkeley releases. ; Additional system calls implemented in vendor and other @@ -291,9 +293,9 @@ 185 UNIMPL BSD lfs_markv 186 UNIMPL BSD lfs_segclean 187 UNIMPL BSD lfs_segwait -188 STD POSIX { int stat(char *path, struct stat *ub); } -189 STD POSIX { int fstat(int fd, struct stat *sb); } -190 STD POSIX { int lstat(char *path, struct stat *ub); } +188 COMPAT_DF12 POSIX { int stat(const char *path, struct dfbsd12_stat *ub); } +189 COMPAT_DF12 POSIX { int fstat(int fd, struct dfbsd12_stat *sb); } +190 COMPAT_DF12 POSIX { int lstat(const char *path, struct dfbsd12_stat *ub); } 191 STD POSIX { int pathconf(char *path, int name); } 192 STD POSIX { int fpathconf(int fd, int name); } 193 UNIMPL NOHIDE nosys @@ -437,7 +439,7 @@ ; XXX 297 is 300 in NetBSD 297 STD BSD { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } 298 STD BSD { int fhopen(const struct fhandle *u_fhp, int flags); } -299 STD BSD { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } +299 COMPAT_DF12 POSIX { int fhstat(const struct fhandle *u_fhp, struct dfbsd12_stat *sb); } ; syscall numbers for FreeBSD 300 STD BSD { int modnext(int modid); } 301 STD BSD { int modstat(int modid, struct module_stat* stat); } @@ -642,4 +644,7 @@ 472 STD BSD { int sys_set_tls_area(int which, struct tls_info *info, size_t infosize); } 473 STD BSD { int sys_get_tls_area(int which, struct tls_info *info, size_t infosize); } 474 STD BSD { int closefrom(int fd); } - +475 STD POSIX { int stat(const char *path, struct stat *ub); } +476 STD POSIX { int fstat(int fd, struct stat *sb); } +477 STD POSIX { int lstat(const char *path, struct stat *ub); } +478 STD BSD { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } diff --git a/sys/sys/stat.h b/sys/sys/stat.h index df7de9409a..d1fb4a5b25 100644 --- a/sys/sys/stat.h +++ b/sys/sys/stat.h @@ -33,7 +33,7 @@ * * @(#)stat.h 8.12 (Berkeley) 6/16/95 * $FreeBSD: src/sys/sys/stat.h,v 1.20 1999/12/29 04:24:47 peter Exp $ - * $DragonFly: src/sys/sys/stat.h,v 1.6 2005/07/30 20:29:40 joerg Exp $ + * $DragonFly: src/sys/sys/stat.h,v 1.7 2005/08/02 13:03:55 joerg Exp $ */ #ifndef _SYS_STAT_H_ @@ -54,10 +54,11 @@ #endif struct stat { - __dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ - mode_t st_mode; /* inode protection mode */ nlink_t st_nlink; /* number of hard links */ + __dev_t st_dev; /* inode's device */ + mode_t st_mode; /* inode protection mode */ + uint16_t st_padding1; uid_t st_uid; /* user ID of the file's owner */ gid_t st_gid; /* group ID of the file's group */ __dev_t st_rdev; /* device type */ diff --git a/sys/sys/syscall-args b/sys/sys/syscall-args index bd81bcde0c..4f45e606a2 100644 --- a/sys/sys/syscall-args +++ b/sys/sys/syscall-args @@ -1,6 +1,6 @@ # System call argument table. # DO NOT EDIT-- this file is automatically generated. -# $DragonFly: src/sys/sys/Attic/syscall-args,v 1.15 2005/07/30 20:31:01 joerg Exp $ +# $DragonFly: src/sys/sys/Attic/syscall-args,v 1.16 2005/08/02 13:03:55 joerg Exp $ # Created from DragonFly: src/sys/kern/syscalls.master,v 1.25 2005/07/30 20:29:40 joerg Exp @@ -126,9 +126,6 @@ int ntp_adjtime ntp_adjtime ntp_adjtime_args struct timex * tp int setgid setgid setgid_args gid_t gid int setegid setegid setegid_args gid_t egid int seteuid seteuid seteuid_args uid_t euid -int stat stat stat_args char * path struct stat * ub -int fstat fstat fstat_args int fd struct stat * sb -int lstat lstat lstat_args char * path struct stat * ub int pathconf pathconf pathconf_args char * path int name int fpathconf fpathconf fpathconf_args int fd int name int getrlimit getrlimit __getrlimit_args u_int which struct rlimit * rlp @@ -173,7 +170,6 @@ int lutimes lutimes lutimes_args char * path struct timeval * tptr int netbsd_msync msync msync_args void * addr size_t len int flags int fhstatfs fhstatfs fhstatfs_args const struct fhandle * u_fhp struct statfs * buf int fhopen fhopen fhopen_args const struct fhandle * u_fhp int flags -int fhstat fhstat fhstat_args const struct fhandle * u_fhp struct stat * sb int modnext modnext modnext_args int modid int modstat modstat modstat_args int modid struct module_stat * stat int modfnext modfnext modfnext_args int modid @@ -262,3 +258,7 @@ int jail_attach jail_attach jail_attach_args int jid int sys_set_tls_area sys_set_tls_area sys_set_tls_area_args int which struct tls_info * info size_t infosize int sys_get_tls_area sys_get_tls_area sys_get_tls_area_args int which struct tls_info * info size_t infosize int closefrom closefrom closefrom_args int fd +int stat stat stat_args const char * path struct stat * ub +int fstat fstat fstat_args int fd struct stat * sb +int lstat lstat lstat_args const char * path struct stat * ub +int fhstat fhstat fhstat_args const struct fhandle * u_fhp struct stat * sb diff --git a/sys/sys/types.h b/sys/sys/types.h index fe33dbeec5..9e592856ec 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -37,7 +37,7 @@ * * @(#)types.h 8.6 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/types.h,v 1.40.2.2 2001/04/21 14:53:06 ume Exp $ - * $DragonFly: src/sys/sys/types.h,v 1.10 2005/06/03 11:07:34 asmodai Exp $ + * $DragonFly: src/sys/sys/types.h,v 1.11 2005/08/02 13:03:55 joerg Exp $ */ #ifndef _SYS_TYPES_H_ @@ -82,10 +82,14 @@ typedef __uint32_t gid_t; /* group id */ typedef __int64_t id_t; /* general id, can hold gid/pid/uid_t */ typedef __uint32_t in_addr_t; /* base type for internet address */ typedef __uint16_t in_port_t; +#ifdef __BOOT2_HACK typedef __uint32_t ino_t; /* inode number */ +#else +typedef __uint64_t ino_t; /* inode number */ +#endif typedef long key_t; /* IPC key (for Sys V IPC) */ typedef __uint16_t mode_t; /* permissions */ -typedef __uint16_t nlink_t; /* link count */ +typedef __uint32_t nlink_t; /* link count */ typedef __off_t off_t; /* file offset */ typedef __pid_t pid_t; /* process id */ typedef __pid_t lwpid_t; /* light weight process id */ diff --git a/sys/sys/vfscache.h b/sys/sys/vfscache.h index 453df23b65..b1e3a53bf2 100644 --- a/sys/sys/vfscache.h +++ b/sys/sys/vfscache.h @@ -63,7 +63,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/vfscache.h,v 1.1 2004/08/17 18:57:32 dillon Exp $ + * $DragonFly: src/sys/sys/vfscache.h,v 1.2 2005/08/02 13:03:55 joerg Exp $ */ /* * This module serves as a focal point for virtually all filesystem and @@ -111,8 +111,8 @@ enum vtagtype { */ struct vattr { enum vtype va_type; /* vnode type (for create) */ + nlink_t va_nlink; /* number of references to file */ u_short va_mode; /* files access mode and type */ - short va_nlink; /* number of references to file */ uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ udev_t va_fsid; /* file system id */ diff --git a/sys/vfs/coda/coda.h b/sys/vfs/coda/coda.h index 164f6b4ffb..2c80b8fcc8 100644 --- a/sys/vfs/coda/coda.h +++ b/sys/vfs/coda/coda.h @@ -28,7 +28,7 @@ * * @(#) src/sys/coda/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda.h,v 1.9 1999/12/29 04:54:30 peter Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda.h,v 1.2 2003/06/17 04:28:19 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda.h,v 1.3 2005/08/02 13:03:55 joerg Exp $ * */ @@ -226,8 +226,8 @@ enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFI struct coda_vattr { int va_type; /* vnode type (for create) */ + nlink_t va_nlink; /* number of references to file */ u_short va_mode; /* files access mode and type */ - short va_nlink; /* number of references to file */ vuid_t va_uid; /* owner user id */ vgid_t va_gid; /* owner group id */ long va_fileid; /* file id */ diff --git a/sys/vfs/gnu/ext2fs/ext2_alloc.c b/sys/vfs/gnu/ext2fs/ext2_alloc.c index 97a41a0fa5..b486ab2279 100644 --- a/sys/vfs/gnu/ext2fs/ext2_alloc.c +++ b/sys/vfs/gnu/ext2fs/ext2_alloc.c @@ -38,7 +38,7 @@ * * @(#)ext2_alloc.c 8.8 (Berkeley) 2/21/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_alloc.c,v 1.28.2.2 2002/07/01 00:18:51 iedowse Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_alloc.c,v 1.6 2004/04/08 20:57:52 cpressey Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_alloc.c,v 1.7 2005/08/02 13:03:55 joerg Exp $ */ #include "opt_quota.h" @@ -51,6 +51,8 @@ #include #include +#include + #include #include #include @@ -501,7 +503,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) pip = VTOI(pvp); fs = pip->i_e2fs; if ((u_int)ino > fs->s_inodes_per_group * fs->s_groups_count) - panic("ext2_vfree: range: dev = (%d, %d), ino = %d, fs = %s", + panic("ext2_vfree: range: dev = (%d, %d), ino = %"PRId64", fs = %s", major(pip->i_dev), minor(pip->i_dev), ino, fs->fs_fsmnt); /* ext2_debug("ext2_vfree (%d, %d) called\n", pip->i_number, mode); diff --git a/sys/vfs/gnu/ext2fs/ext2_inode_cnv.c b/sys/vfs/gnu/ext2fs/ext2_inode_cnv.c index 0b6d9ddcc4..881c6ce723 100644 --- a/sys/vfs/gnu/ext2fs/ext2_inode_cnv.c +++ b/sys/vfs/gnu/ext2fs/ext2_inode_cnv.c @@ -20,7 +20,7 @@ * * Utah $Hdr$ * $FreeBSD: src/sys/gnu/ext2fs/ext2_inode_cnv.c,v 1.11 2000/01/01 17:39:21 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode_cnv.c,v 1.4 2004/04/08 20:57:52 cpressey Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode_cnv.c,v 1.5 2005/08/02 13:03:55 joerg Exp $ */ /* @@ -32,6 +32,8 @@ #include #include +#include + #include #include @@ -82,7 +84,7 @@ ext2_print_dinode(struct dinode *di) void ext2_print_inode(struct inode *in) { - printf( "Inode: %5d", in->i_number); + printf( "Inode: %"PRId64, in->i_number); ext2_print_dinode(&in->i_din); } diff --git a/sys/vfs/hpfs/hpfs_vfsops.c b/sys/vfs/hpfs/hpfs_vfsops.c index 80b777c6cf..42e777dd67 100644 --- a/sys/vfs/hpfs/hpfs_vfsops.c +++ b/sys/vfs/hpfs/hpfs_vfsops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/hpfs/hpfs_vfsops.c,v 1.3.2.2 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.28 2005/07/26 15:43:35 hmp Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.29 2005/08/02 13:03:55 joerg Exp $ */ @@ -40,6 +40,8 @@ #include #include +#include + #include #include #if defined(__NetBSD__) @@ -530,7 +532,7 @@ hpfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) error = bread(hpmp->hpm_devvp, ino, FNODESIZE, &bp); if (error) { - printf("hpfs_vget: can't read ino %d\n",ino); + printf("hpfs_vget: can't read ino %"PRId64"\n",ino); vx_put(vp); return (error); } diff --git a/sys/vfs/isofs/cd9660/cd9660_vnops.c b/sys/vfs/isofs/cd9660/cd9660_vnops.c index 125fbd288b..e103aaf71c 100644 --- a/sys/vfs/isofs/cd9660/cd9660_vnops.c +++ b/sys/vfs/isofs/cd9660/cd9660_vnops.c @@ -37,7 +37,7 @@ * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 * $FreeBSD: src/sys/isofs/cd9660/cd9660_vnops.c,v 1.62 1999/12/15 23:01:51 eivind Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vnops.c,v 1.14 2005/02/15 08:32:18 joerg Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vnops.c,v 1.15 2005/08/02 13:03:55 joerg Exp $ */ #include @@ -551,12 +551,16 @@ cd9660_readdir(struct vop_readdir_args *ap) switch (imp->iso_ftype) { case ISO_FTYPE_RRIP: + { + ino_t cur_fileno = idp->current.d_fileno; cd9660_rrip_getname(ep,idp->current.d_name, &namelen, - &idp->current.d_fileno,imp); + &cur_fileno,imp); + idp->current.d_fileno = cur_fileno; idp->current.d_namlen = (u_char)namelen; if (idp->current.d_namlen) error = iso_uiodir(idp,&idp->current,idp->curroff); break; + } default: /* ISO_FTYPE_DEFAULT || ISO_FTYPE_9660 || ISO_FTYPE_HIGH_SIERRA*/ strcpy(idp->current.d_name,".."); if (idp->current.d_namlen == 1 && ep->name[0] == 0) { diff --git a/sys/vfs/ntfs/ntfs_subr.c b/sys/vfs/ntfs/ntfs_subr.c index e49ae1c775..fd6de44684 100644 --- a/sys/vfs/ntfs/ntfs_subr.c +++ b/sys/vfs/ntfs/ntfs_subr.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ntfs/ntfs_subr.c,v 1.7.2.4 2001/10/12 22:08:49 semenu Exp $ - * $DragonFly: src/sys/vfs/ntfs/ntfs_subr.c,v 1.14 2004/07/02 15:26:26 joerg Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs_subr.c,v 1.15 2005/08/02 13:03:55 joerg Exp $ */ #include @@ -42,6 +42,8 @@ #include #include +#include + #if defined(__NetBSD__) #include #endif @@ -85,7 +87,7 @@ static signed int ntfs_toupper_usecount; int ntfs_ntvattrrele(struct ntvattr *vap) { - dprintf(("ntfs_ntvattrrele: ino: %d, type: 0x%x\n", + dprintf(("ntfs_ntvattrrele: ino: %"PRId64", type: 0x%x\n", vap->va_ip->i_number, vap->va_type)); ntfs_ntrele(vap->va_ip); @@ -105,11 +107,11 @@ ntfs_findvattr(struct ntfsmount *ntmp, struct ntnode *ip, struct ntvattr *vap; if((ip->i_flag & IN_LOADED) == 0) { - dprintf(("ntfs_findvattr: node not loaded, ino: %d\n", + dprintf(("ntfs_findvattr: node not loaded, ino: %"PRId64"\n", ip->i_number)); error = ntfs_loadntnode(ntmp,ip); if (error) { - printf("ntfs_findvattr: FAILED TO LOAD INO: %d\n", + printf("ntfs_findvattr: FAILED TO LOAD INO: %"PRId64"\n", ip->i_number); return (error); } @@ -160,12 +162,12 @@ ntfs_ntvattrget(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t type, if (name) { dprintf(("ntfs_ntvattrget: " \ - "ino: %d, type: 0x%x, name: %s, vcn: %d\n", \ + "ino: %"PRId64", type: 0x%x, name: %s, vcn: %d\n", \ ip->i_number, type, name, (u_int32_t) vcn)); namelen = strlen(name); } else { dprintf(("ntfs_ntvattrget: " \ - "ino: %d, type: 0x%x, vcn: %d\n", \ + "ino: %"PRId64", type: 0x%x, vcn: %d\n", \ ip->i_number, type, (u_int32_t) vcn)); name = ""; namelen = 0; @@ -177,7 +179,7 @@ ntfs_ntvattrget(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t type, if (!lvap) { dprintf(("ntfs_ntvattrget: UNEXISTED ATTRIBUTE: " \ - "ino: %d, type: 0x%x, name: %s, vcn: %d\n", \ + "ino: %"PRId64", type: 0x%x, name: %s, vcn: %d\n", \ ip->i_number, type, name, (u_int32_t) vcn)); return (ENOENT); } @@ -236,7 +238,7 @@ ntfs_ntvattrget(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t type, error = ENOENT; dprintf(("ntfs_ntvattrget: UNEXISTED ATTRIBUTE: " \ - "ino: %d, type: 0x%x, name: %.*s, vcn: %d\n", \ + "ino: %"PRId64", type: 0x%x, name: %.*s, vcn: %d\n", \ ip->i_number, type, (int) namelen, name, (u_int32_t) vcn)); out: FREE(alpool, M_TEMP); @@ -257,7 +259,7 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip) struct attr *ap; struct ntvattr *nvap; - dprintf(("ntfs_loadntnode: loading ino: %d\n",ip->i_number)); + dprintf(("ntfs_loadntnode: loading ino: %"PRId64"\n",ip->i_number)); MALLOC(mfrp, struct filerec *, ntfs_bntob(ntmp->ntm_bpmftrec), M_TEMP, M_WAITOK); @@ -296,12 +298,12 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip) error = ntfs_procfixups(ntmp, NTFS_FILEMAGIC, (caddr_t)mfrp, ntfs_bntob(ntmp->ntm_bpmftrec)); if (error) { - printf("ntfs_loadntnode: BAD MFT RECORD %d\n", - (u_int32_t) ip->i_number); + printf("ntfs_loadntnode: BAD MFT RECORD %"PRId64"\n", + ip->i_number); goto out; } - dprintf(("ntfs_loadntnode: load attrs for ino: %d\n",ip->i_number)); + dprintf(("ntfs_loadntnode: load attrs for ino: %"PRId64"\n",ip->i_number)); off = mfrp->fr_attroff; ap = (struct attr *) ((caddr_t)mfrp + off); @@ -319,7 +321,7 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip) ap = (struct attr *) ((caddr_t)mfrp + off); } if (error) { - printf("ntfs_loadntnode: failed to load attr ino: %d\n", + printf("ntfs_loadntnode: failed to load attr ino: %"PRId64"\n", ip->i_number); goto out; } @@ -344,7 +346,7 @@ ntfs_ntget(struct ntnode *ip) { lwkt_tokref ilock; - dprintf(("ntfs_ntget: get ntnode %d: %p, usecount: %d\n", + dprintf(("ntfs_ntget: get ntnode %"PRId64": %p, usecount: %d\n", ip->i_number, ip, ip->i_usecount)); ip->i_usecount++; /* ZZZ */ @@ -421,7 +423,7 @@ ntfs_ntput(struct ntnode *ip) struct ntvattr *vap; lwkt_tokref ilock; - dprintf(("ntfs_ntput: rele ntnode %d: %p, usecount: %d\n", + dprintf(("ntfs_ntput: rele ntnode %"PRId64": %p, usecount: %d\n", ip->i_number, ip, ip->i_usecount)); lwkt_gettoken(&ilock, &ip->i_interlock); @@ -429,7 +431,7 @@ ntfs_ntput(struct ntnode *ip) #ifdef DIAGNOSTIC if (ip->i_usecount < 0) { - panic("ntfs_ntput: ino: %d usecount: %d \n", + panic("ntfs_ntput: ino: %"PRId64" usecount: %d \n", ip->i_number,ip->i_usecount); } #endif @@ -439,7 +441,7 @@ ntfs_ntput(struct ntnode *ip) return; } - dprintf(("ntfs_ntput: deallocating ntnode: %d\n", ip->i_number)); + dprintf(("ntfs_ntput: deallocating ntnode: %"PRId64"\n", ip->i_number)); if (ip->i_fnlist.lh_first) panic("ntfs_ntput: ntnode has fnodes\n"); @@ -463,7 +465,7 @@ ntfs_ntref(struct ntnode *ip) { ip->i_usecount++; - dprintf(("ntfs_ntref: ino %d, usecount: %d\n", + dprintf(("ntfs_ntref: ino %"PRId64", usecount: %d\n", ip->i_number, ip->i_usecount)); } @@ -476,14 +478,14 @@ ntfs_ntrele(struct ntnode *ip) { lwkt_tokref ilock; - dprintf(("ntfs_ntrele: rele ntnode %d: %p, usecount: %d\n", + dprintf(("ntfs_ntrele: rele ntnode %"PRId64": %p, usecount: %d\n", ip->i_number, ip, ip->i_usecount)); lwkt_gettoken(&ilock, &ip->i_interlock); ip->i_usecount--; if (ip->i_usecount < 0) { - panic("ntfs_ntrele: ino: %d usecount: %d \n", + panic("ntfs_ntrele: ino: %"PRId64" usecount: %d \n", ip->i_number,ip->i_usecount); } lwkt_reltoken(&ilock); @@ -686,7 +688,7 @@ ntfs_fget(struct ntfsmount *ntmp, struct ntnode *ip, int attrtype, { struct fnode *fp; - dprintf(("ntfs_fget: ino: %d, attrtype: 0x%x, attrname: %s\n", + dprintf(("ntfs_fget: ino: %"PRId64", attrtype: 0x%x, attrname: %s\n", ip->i_number,attrtype, attrname?attrname:"")); *fpp = NULL; for (fp = ip->i_fnlist.lh_first; fp != NULL; fp = fp->f_fnlist.le_next){ @@ -737,7 +739,7 @@ ntfs_frele(struct fnode *fp) { struct ntnode *ip = FTONT(fp); - dprintf(("ntfs_frele: fnode: %p for %d: %p\n", fp, ip->i_number, ip)); + dprintf(("ntfs_frele: fnode: %p for %"PRId64": %p\n", fp, ip->i_number, ip)); dprintf(("ntfs_frele: deallocating fnode\n")); LIST_REMOVE(fp,f_fnlist); @@ -1055,7 +1057,7 @@ ntfs_ntreaddir(struct ntfsmount *ntmp, struct fnode *fp, int error = ENOENT; u_int32_t aoff, cnum; - dprintf(("ntfs_ntreaddir: read ino: %d, num: %d\n", ip->i_number, num)); + dprintf(("ntfs_ntreaddir: read ino: %"PRId64", num: %d\n", ip->i_number, num)); error = ntfs_ntget(ip); if (error) return (error); @@ -1219,7 +1221,7 @@ ntfs_times(struct ntfsmount *ntmp, struct ntnode *ip, ntfs_times_t *tm) struct ntvattr *vap; int error; - dprintf(("ntfs_times: ino: %d...\n", ip->i_number)); + dprintf(("ntfs_times: ino: %"PRId64"...\n", ip->i_number)); error = ntfs_ntget(ip); if (error) @@ -1251,7 +1253,7 @@ ntfs_filesize(struct ntfsmount *ntmp, struct fnode *fp, u_int64_t *size, u_int64_t sz, bn; int error; - dprintf(("ntfs_filesize: ino: %d\n", ip->i_number)); + dprintf(("ntfs_filesize: ino: %"PRId64"\n", ip->i_number)); error = ntfs_ntvattrget(ntmp, ip, fp->f_attrtype, fp->f_attrname, 0, &vap); @@ -1615,7 +1617,7 @@ ntfs_readattr(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t attrnum, struct ntvattr *vap; size_t init; - ddprintf(("ntfs_readattr: reading %d: 0x%x, from %d size %d bytes\n", + ddprintf(("ntfs_readattr: reading %"PRId64": 0x%x, from %d size %d bytes\n", ip->i_number, attrnum, (u_int32_t) roff, (u_int32_t) rsize)); error = ntfs_ntvattrget(ntmp, ip, attrnum, attrname, 0, &vap); diff --git a/sys/vfs/ntfs/ntfs_vfsops.c b/sys/vfs/ntfs/ntfs_vfsops.c index df59a020d5..f8d42ee211 100644 --- a/sys/vfs/ntfs/ntfs_vfsops.c +++ b/sys/vfs/ntfs/ntfs_vfsops.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ntfs/ntfs_vfsops.c,v 1.20.2.5 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.28 2005/07/26 15:43:36 hmp Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.29 2005/08/02 13:03:55 joerg Exp $ */ @@ -46,6 +46,8 @@ #include #endif +#include + #include #include #if defined(__NetBSD__) @@ -860,7 +862,7 @@ ntfs_vgetex(struct mount *mp, ino_t ino, u_int32_t attrtype, char *attrname, if (!(flags & VG_DONTLOADIN) && !(ip->i_flag & IN_LOADED)) { error = ntfs_loadntnode(ntmp, ip); if(error) { - printf("ntfs_vget: CAN'T LOAD ATTRIBUTES FOR INO: %d\n", + printf("ntfs_vget: CAN'T LOAD ATTRIBUTES FOR INO: %"PRId64"\n", ip->i_number); ntfs_ntput(ip); return (error); diff --git a/sys/vfs/udf/udf_vnops.c b/sys/vfs/udf/udf_vnops.c index b8f863d755..27a8aa8d65 100644 --- a/sys/vfs/udf/udf_vnops.c +++ b/sys/vfs/udf/udf_vnops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/udf/udf_vnops.c,v 1.33 2003/12/07 05:04:49 scottl Exp $ - * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.13 2005/02/17 14:00:10 joerg Exp $ + * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.14 2005/08/02 13:03:55 joerg Exp $ */ /* udf_vnops.c */ @@ -45,6 +45,8 @@ #include #include +#include + #include #include #include @@ -162,7 +164,7 @@ udf_hashrem(struct udf_node *node) lwkt_gettoken(&hashlock, &udfmp->hash_token); lh = &udfmp->hashtbl[node->hash_id % udfmp->hashsz]; if (lh == NULL) - panic("hash entry is NULL, node->hash_id= %d\n", node->hash_id); + panic("hash entry is NULL, node->hash_id= %"PRId64"\n", node->hash_id); LIST_REMOVE(node, le); lwkt_reltoken(&hashlock); diff --git a/sys/vfs/ufs/ffs_alloc.c b/sys/vfs/ufs/ffs_alloc.c index 2f69794b72..5042d058af 100644 --- a/sys/vfs/ufs/ffs_alloc.c +++ b/sys/vfs/ufs/ffs_alloc.c @@ -32,7 +32,7 @@ * * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 * $FreeBSD: src/sys/ufs/ffs/ffs_alloc.c,v 1.64.2.2 2001/09/21 19:15:21 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_alloc.c,v 1.12 2005/01/20 18:08:54 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_alloc.c,v 1.13 2005/08/02 13:03:55 joerg Exp $ */ #include "opt_quota.h" @@ -48,6 +48,8 @@ #include #include +#include + #include "quota.h" #include "inode.h" #include "ufs_extern.h" @@ -1601,7 +1603,7 @@ ffs_freefile(struct vnode *pvp, ino_t ino, int mode) pip = VTOI(pvp); fs = pip->i_fs; if ((uint)ino >= fs->fs_ipg * fs->fs_ncg) - panic("ffs_vfree: range: dev = (%d,%d), ino = %d, fs = %s", + panic("ffs_vfree: range: dev = (%d,%d), ino = %"PRId64", fs = %s", major(pip->i_dev), minor(pip->i_dev), ino, fs->fs_fsmnt); cg = ino_to_cg(fs, ino); error = bread(pip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c index 69539e866e..f2879a5f93 100644 --- a/sys/vfs/ufs/ffs_softdep.c +++ b/sys/vfs/ufs/ffs_softdep.c @@ -37,7 +37,7 @@ * * from: @(#)ffs_softdep.c 9.59 (McKusick) 6/21/00 * $FreeBSD: src/sys/ufs/ffs/ffs_softdep.c,v 1.57.2.11 2002/02/05 18:46:53 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.27 2005/07/31 22:25:46 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.28 2005/08/02 13:03:55 joerg Exp $ */ /* @@ -61,6 +61,7 @@ #include #include #include +#include #include "dir.h" #include "quota.h" #include "inode.h" @@ -2660,7 +2661,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) } if (dap->da_newinum != ip->i_number) { FREE_LOCK(&lk); - panic("newdirrem: inum %d should be %d", + panic("newdirrem: inum %"PRId64" should be %"PRId64, ip->i_number, dap->da_newinum); } /* @@ -3088,7 +3089,7 @@ initiate_write_filepage(pagedep, bp) ((char *)bp->b_data + dap->da_offset); if (ep->d_ino != dap->da_newinum) { FREE_LOCK(&lk); - panic("%s: dir inum %d != new %d", + panic("%s: dir inum %d != new %"PRId64, "initiate_write_filepage", ep->d_ino, dap->da_newinum); }