CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Wed Jan 4 16:05:53 UTC 2012 Modified Files: src/sys/dev/dm: dm_target_stripe.c Log Message: Fix wrong KASSERT, reported by mhitch@. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/dm/dm_target_stripe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_target_stripe.c diff -u src/sys/dev/dm/dm_target_stripe.c:1.16 src/sys/dev/dm/dm_target_stripe.c:1.17 --- src/sys/dev/dm/dm_target_stripe.c:1.16 Fri Oct 14 09:23:30 2011 +++ src/sys/dev/dm/dm_target_stripe.c Wed Jan 4 16:05:53 2012 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target_stripe.c,v 1.16 2011/10/14 09:23:30 hannken Exp $*/ +/*$NetBSD: dm_target_stripe.c,v 1.17 2012/01/04 16:05:53 haad Exp $*/ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -248,7 +248,7 @@ dm_target_stripe_strategy(dm_table_entry tlc = TAILQ_NEXT(tlc, entries); /* by this point we should have an tlc */ - KASSERT(tlc == NULL); + KASSERT(tlc != NULL); nestbuf-b_blkno += tlc-offset;
CVS commit: src/tests/lib/libc/stdlib
Module Name:src Committed By: haad Date: Sat Jun 4 22:49:49 UTC 2011 Modified Files: src/tests/lib/libc/stdlib: t_strtol.c Log Message: Fix problem with overflowing constant definition t_strtol.c:95: warning: overflow in implicit constant conversion To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdlib/t_strtol.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/stdlib/t_strtol.c diff -u src/tests/lib/libc/stdlib/t_strtol.c:1.1 src/tests/lib/libc/stdlib/t_strtol.c:1.2 --- src/tests/lib/libc/stdlib/t_strtol.c:1.1 Sat Jun 4 14:56:58 2011 +++ src/tests/lib/libc/stdlib/t_strtol.c Sat Jun 4 22:49:49 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: t_strtol.c,v 1.1 2011/06/04 14:56:58 jruoho Exp $ */ +/* $NetBSD: t_strtol.c,v 1.2 2011/06/04 22:49:49 haad Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: t_strtol.c,v 1.1 2011/06/04 14:56:58 jruoho Exp $); +__RCSID($NetBSD: t_strtol.c,v 1.2 2011/06/04 22:49:49 haad Exp $); #include atf-c.h #include errno.h @@ -92,8 +92,8 @@ { 123456789, 342391, 8, NULL }, { 0123456789, 342391, 0, NULL }, { 0123456789, 123456789, 10, NULL }, - { 0123456789, 0x123456789, 16, NULL }, - { 0x123456789, 0x123456789, 0, NULL }, + { 0123456789, (uint32_t)0x123456789, 16, NULL }, + { 0x123456789, (uint32_t)0x123456789, 0, NULL }, { 0x75bcd15, 123456789, 0, NULL }, };
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Thu Jun 2 17:49:40 UTC 2011 Modified Files: src/sys/dev/dm: dm_target_stripe.c Log Message: Fix simple typo which made stripe target not working very at all. Issue found by mhitch@. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/dev/dm/dm_target_stripe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_target_stripe.c diff -u src/sys/dev/dm/dm_target_stripe.c:1.13 src/sys/dev/dm/dm_target_stripe.c:1.14 --- src/sys/dev/dm/dm_target_stripe.c:1.13 Thu Dec 23 14:58:14 2010 +++ src/sys/dev/dm/dm_target_stripe.c Thu Jun 2 17:49:40 2011 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target_stripe.c,v 1.13 2010/12/23 14:58:14 mlelstv Exp $*/ +/*$NetBSD: dm_target_stripe.c,v 1.14 2011/06/02 17:49:40 haad Exp $*/ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -243,7 +243,7 @@ nestbuf-b_blkno = stripe_blknr * tsc-stripe_chunksize + stripe_off; tlc = TAILQ_FIRST(tsc-stripe_devs); - for (i = 0; i stripe_devnr tlc == NULL; i++) + for (i = 0; i stripe_devnr tlc != NULL; i++) tlc = TAILQ_NEXT(tlc, entries); /* by this point we should have an tlc */
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: haad Date: Sun May 29 23:35:50 UTC 2011 Modified Files: src/distrib/sets/lists/comp: shl.mi Log Message: Fix DEBUG enabled build, after every minor lib bump DEBUG enabled build should be run to catch all changes. Hi spz! To generate a diff of this commit: cvs rdiff -u -r1.171 -r1.172 src/distrib/sets/lists/comp/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/shl.mi diff -u src/distrib/sets/lists/comp/shl.mi:1.171 src/distrib/sets/lists/comp/shl.mi:1.172 --- src/distrib/sets/lists/comp/shl.mi:1.171 Fri May 13 01:56:27 2011 +++ src/distrib/sets/lists/comp/shl.mi Sun May 29 23:35:50 2011 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.171 2011/05/13 01:56:27 christos Exp $ +# $NetBSD: shl.mi,v 1.172 2011/05/29 23:35:50 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -241,7 +241,8 @@ ./usr/libdata/debug/usr/lib/libdes.so.8.1.debug comp-crypto-debug crypto,debug ./usr/libdata/debug/usr/lib/libdevmapper.so.1.0.debug comp-lvm-debug lvm,debug ./usr/libdata/debug/usr/lib/libdm.so.0.0.debug comp-sys-debug debug -./usr/libdata/debug/usr/lib/libdns.so.5.3.debug comp-bind-debug debug +./usr/libdata/debug/usr/lib/libdns.so.5.3.debug comp-bind-debug debug,obsolete +./usr/libdata/debug/usr/lib/libdns.so.5.4.debug comp-bind-debug debug ./usr/libdata/debug/usr/lib/libdns_sd.so.0.0.debug comp-mdns-debug mdns,debug ./usr/libdata/debug/usr/lib/libdtrace.so.2.0.debug comp-sys-debug dtrace,debug ./usr/libdata/debug/usr/lib/libdwarf.so.0.0.debug comp-sys-debug debug @@ -263,7 +264,8 @@ ./usr/libdata/debug/usr/lib/libhx509.so.5.0.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/lib/libintl.so.1.0.debug comp-sys-debug debug ./usr/libdata/debug/usr/lib/libipsec.so.3.0.debug comp-net-debug debug -./usr/libdata/debug/usr/lib/libisc.so.5.3.debug comp-bind-debug debug +./usr/libdata/debug/usr/lib/libisc.so.5.3.debug comp-bind-debug debug,obsolete +./usr/libdata/debug/usr/lib/libisc.so.5.4.debug comp-bind-debug debug ./usr/libdata/debug/usr/lib/libisccc.so.5.3.debug comp-bind-debug debug ./usr/libdata/debug/usr/lib/libisccfg.so.5.3.debug comp-bind-debug debug ./usr/libdata/debug/usr/lib/libiscsi.so.2.0.debug comp-iscsi-debug iscsi,debug
CVS commit: src/lib/libdm
Module Name:src Committed By: haad Date: Mon May 30 01:10:58 UTC 2011 Modified Files: src/lib/libdm: libdm_ioctl.c Log Message: Fix problem where DM_IOCTL_NAME was used in libdm_task_set_uuid except of DM_IOCTL_UUID. This makes lvremove to work properly. Thanks To hugo Silva and Toby Karyadi for reporting this issue. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libdm/libdm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/libdm_ioctl.c diff -u src/lib/libdm/libdm_ioctl.c:1.1 src/lib/libdm/libdm_ioctl.c:1.2 --- src/lib/libdm/libdm_ioctl.c:1.1 Tue Feb 8 03:20:15 2011 +++ src/lib/libdm/libdm_ioctl.c Mon May 30 01:10:57 2011 @@ -262,7 +262,7 @@ if ((prop_dictionary_set_cstring(libdm_task-ldm_task, DM_IOCTL_NAME, name)) == false) return ENOENT; - + return 0; } @@ -285,7 +285,7 @@ { if ((prop_dictionary_set_cstring(libdm_task-ldm_task, - DM_IOCTL_NAME, uuid)) == false) + DM_IOCTL_UUID, uuid)) == false) return ENOENT; return 0;
CVS commit: src/share/mk
Module Name:src Committed By: haad Date: Mon May 9 14:36:48 UTC 2011 Modified Files: src/share/mk: bsd.own.mk Log Message: Add MKPERFUSE flag to those who are enabled by default. To generate a diff of this commit: cvs rdiff -u -r1.663 -r1.664 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.663 src/share/mk/bsd.own.mk:1.664 --- src/share/mk/bsd.own.mk:1.663 Thu Apr 21 14:26:35 2011 +++ src/share/mk/bsd.own.mk Mon May 9 14:36:48 2011 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.663 2011/04/21 14:26:35 joerg Exp $ +# $NetBSD: bsd.own.mk,v 1.664 2011/05/09 14:36:48 haad Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -733,7 +733,7 @@ MKNLS \ MKNPF \ MKOBJ \ - MKPAM \ + MKPAM MKPERFUSE \ MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \ MKSHARE MKSKEY MKSTATICLIB \ MKX11FONTS \
CVS commit: src/distrib/sets
Module Name:src Committed By: haad Date: Mon May 9 14:45:45 UTC 2011 Modified Files: src/distrib/sets: sets.subr Log Message: Mention MKPERFUSE keyword here, too. I have forgot to commit this file before. To generate a diff of this commit: cvs rdiff -u -r1.130 -r1.131 src/distrib/sets/sets.subr Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/sets.subr diff -u src/distrib/sets/sets.subr:1.130 src/distrib/sets/sets.subr:1.131 --- src/distrib/sets/sets.subr:1.130 Thu Apr 21 20:59:38 2011 +++ src/distrib/sets/sets.subr Mon May 9 14:45:44 2011 @@ -1,4 +1,4 @@ -# $NetBSD: sets.subr,v 1.130 2011/04/21 20:59:38 joerg Exp $ +# $NetBSD: sets.subr,v 1.131 2011/05/09 14:45:44 haad Exp $ # # @@ -172,7 +172,7 @@ # In each file, a record consists of a path and a System Package name, # separated by whitespace. E.g., # -# # $NetBSD: sets.subr,v 1.130 2011/04/21 20:59:38 joerg Exp $ +# # $NetBSD: sets.subr,v 1.131 2011/05/09 14:45:44 haad Exp $ # . base-sys-root [keyword[,...]] # ./altroot base-sys-root # ./bin base-sys-root @@ -237,6 +237,7 @@ # pic ${MKPIC} != no # postfix ${MKPOSTFIX} != no # profile ${MKPROFILE} != no +# perfuse ${MKPERFUSE} != no # share ${MKSHARE} != no # skey ${MKSKEY} != no # solaris ${MKDTRACE} != no or ${MKZFS} != no
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: haad Date: Thu Apr 21 09:09:33 UTC 2011 Modified Files: src/distrib/sets/lists/comp: ad.mips64eb ad.mips64el md.amd64 md.sparc64 Log Message: Fix MKDEBUG build for all 64bit architectures which have compat lib installed, after kerberos import. hi elric@! To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/distrib/sets/lists/comp/ad.mips64eb \ src/distrib/sets/lists/comp/ad.mips64el cvs rdiff -u -r1.109 -r1.110 src/distrib/sets/lists/comp/md.amd64 cvs rdiff -u -r1.92 -r1.93 src/distrib/sets/lists/comp/md.sparc64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/ad.mips64eb diff -u src/distrib/sets/lists/comp/ad.mips64eb:1.27 src/distrib/sets/lists/comp/ad.mips64eb:1.28 --- src/distrib/sets/lists/comp/ad.mips64eb:1.27 Sun Apr 17 09:01:57 2011 +++ src/distrib/sets/lists/comp/ad.mips64eb Thu Apr 21 09:09:33 2011 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips64eb,v 1.27 2011/04/17 09:01:57 mrg Exp $ +# $NetBSD: ad.mips64eb,v 1.28 2011/04/21 09:09:33 haad Exp $ ./usr/bin/elf2aoutcomp-obsolete obsolete ./usr/bin/elf2ecoffcomp-sysutil-bin ./usr/include/mipscomp-c-include @@ -1184,7 +1184,8 @@ ./usr/libdata/debug/usr/lib/64/i18n/libmapper_zone.so.5.0.debug comp-i18n-debug debug,compat ./usr/libdata/debug/usr/lib/64/libamu.so.4.0.debug comp-amd-debug debug,compat ./usr/libdata/debug/usr/lib/64/libarchive.so.3.1.debug comp-sys-debug debug,compat -./usr/libdata/debug/usr/lib/64/libasn1.so.8.0.debug comp-krb5-debug kerberos,debug,compat +./usr/libdata/debug/usr/lib/64/libasn1.so.8.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete +./usr/libdata/debug/usr/lib/64/libasn1.so.9.0.debug comp-compat-shlib compat,pic,kerberos,debug ./usr/libdata/debug/usr/lib/64/libavl.so.0.0.debug comp-zfs-debug zfs,dynamicroot,debug,compat ./usr/libdata/debug/usr/lib/64/libbfd.so.11.0.debug comp-sys-debug binutils,debug,compat ./usr/libdata/debug/usr/lib/64/libbind9.so.5.3.debug comp-bind-debug debug,compat @@ -1192,7 +1193,8 @@ ./usr/libdata/debug/usr/lib/64/libbsdmalloc.so.0.0.debug comp-sys-debug debug,compat ./usr/libdata/debug/usr/lib/64/libbz2.so.1.1.debug comp-sys-debug debug,compat ./usr/libdata/debug/usr/lib/64/libc.so.12.177.debug comp-sys-debug debug,compat -./usr/libdata/debug/usr/lib/64/libcom_err.so.6.0.debug comp-krb5-debug kerberos,debug,compat +./usr/libdata/debug/usr/lib/64/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete +./usr/libdata/debug/usr/lib/64/libcom_err.so.7.0.debug comp-compat-shlib compat,pic,kerberos,debug ./usr/libdata/debug/usr/lib/64/libcrypt.so.1.0.debug comp-sys-debug debug,compat ./usr/libdata/debug/usr/lib/64/libcrypto.so.6.1.debug comp-crypto-debug crypto,debug,compat ./usr/libdata/debug/usr/lib/64/libctf.so.2.0.debug comp-sys-debug dtrace,debug,compat @@ -1212,9 +1214,13 @@ ./usr/libdata/debug/usr/lib/64/libg2c.so.2.0.debug comp-sys-debug gcc=3,debug,compat ./usr/libdata/debug/usr/lib/64/libgcc_s.so.1.0.debug comp-sys-debug gcc,debug,compat ./usr/libdata/debug/usr/lib/64/libgnumalloc.so.1.0.debug comp-sys-debug debug,compat -./usr/libdata/debug/usr/lib/64/libgssapi.so.9.0.debug comp-krb5-debug kerberos,debug,compat -./usr/libdata/debug/usr/lib/64/libhdb.so.13.0.debug comp-krb5-debug kerberos,debug,compat -./usr/libdata/debug/usr/lib/64/libheimntlm.so.3.0.debug comp-krb5-debug kerberos,debug,compat +./usr/libdata/debug/usr/lib/64/libgssapi.so.9.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete +./usr/libdata/debug/usr/lib/64/libgssapi.so.10.0.debug comp-compat-shlib compat,pic,kerberos,debug +./usr/libdata/debug/usr/lib/64/libhdb.so.13.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete +./usr/libdata/debug/usr/lib/64/libhdb.so.14.0.debug comp-compat-shlib compat,pic,kerberos,debug +./usr/libdata/debug/usr/lib/64/libheimbase.so.1.0.debug comp-compat-shlib compat,pic,kerberos,debug +./usr/libdata/debug/usr/lib/64/libheimntlm.so.3.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete +./usr/libdata/debug/usr/lib/64/libheimntlm.so.4.0.debug comp-compat-shlib compat,pic,kerberos,debug ./usr/libdata/debug/usr/lib/64/libhx509.so.5.0.debug comp-krb5-debug kerberos,debug,compat ./usr/libdata/debug/usr/lib/64/libintl.so.1.0.debug comp-sys-debug debug,compat ./usr/libdata/debug/usr/lib/64/libipsec.so.3.0.debug comp-net-debug debug,compat @@ -1223,10 +1229,14 @@ ./usr/libdata/debug/usr/lib/64/libisccfg.so.5.3.debug comp-bind-debug debug,compat ./usr/libdata/debug/usr/lib/64/libiscsi.so.2.0.debug comp-iscsi-debug iscsi,debug,compat ./usr/libdata/debug/usr/lib/64/libisns.so.0.0.debug comp-isns-debug debug,compat -./usr/libdata/debug/usr/lib/64/libkadm5clnt.so.12.0.debug comp-krb5-debug kerberos,debug,compat -./usr/libdata/debug/usr/lib/64/libkadm5srv.so.13.0.debug comp-krb5-debug kerberos,debug,compat
CVS commit: src/tests/fs/tmpfs
Module Name:src Committed By: haad Date: Thu Apr 21 22:26:46 UTC 2011 Modified Files: src/tests/fs/tmpfs: t_vnd.sh Log Message: Workaround problem with qemu where jot 100 produce garbage otput like this 93 94 :+ :, :- :. :/ 100 This can't be used as name of file, change jot cmd to work in all cases. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/fs/tmpfs/t_vnd.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/tmpfs/t_vnd.sh diff -u src/tests/fs/tmpfs/t_vnd.sh:1.7 src/tests/fs/tmpfs/t_vnd.sh:1.8 --- src/tests/fs/tmpfs/t_vnd.sh:1.7 Thu Mar 24 21:52:51 2011 +++ src/tests/fs/tmpfs/t_vnd.sh Thu Apr 21 22:26:46 2011 @@ -1,4 +1,4 @@ -# $NetBSD: t_vnd.sh,v 1.7 2011/03/24 21:52:51 jmmv Exp $ +# $NetBSD: t_vnd.sh,v 1.8 2011/04/21 22:26:46 haad Exp $ # # Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. # All rights reserved. @@ -46,12 +46,12 @@ atf_check -s eq:0 -o empty -e empty mount /dev/vnd3a mnt echo Creating test files - for f in $(jot 100); do + for f in $(jot -w %u 100 | uniq); do jot 1000 mnt/${f} || atf_fail Failed to create file ${f} done echo Verifying created files - for f in $(jot 100); do + for f in $(jot -w %u 100 | uniq); do [ $(md5 mnt/${f} | cut -d ' ' -f 4) = \ 53d025127ae99ab79e8502aae2d9bea6 ] || \ atf_fail Invalid checksum for file ${f}
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: haad Date: Wed Apr 20 18:55:55 UTC 2011 Modified Files: src/distrib/sets/lists/comp: mi shl.mi Log Message: Do some useful work and fix MKDEBUG build after kerberos update. To generate a diff of this commit: cvs rdiff -u -r1.1618 -r1.1619 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.167 -r1.168 src/distrib/sets/lists/comp/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1618 src/distrib/sets/lists/comp/mi:1.1619 --- src/distrib/sets/lists/comp/mi:1.1618 Sun Apr 17 09:01:57 2011 +++ src/distrib/sets/lists/comp/mi Wed Apr 20 18:55:53 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1618 2011/04/17 09:01:57 mrg Exp $ +# $NetBSD: mi,v 1.1619 2011/04/20 18:55:53 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -3236,7 +3236,8 @@ ./usr/libdata/debug/usr/bin/grolj4.debug comp-groff-debug groff,debug ./usr/libdata/debug/usr/bin/grops.debug comp-groff-debug groff,debug ./usr/libdata/debug/usr/bin/grotty.debug comp-groff-debug groff,debug -./usr/libdata/debug/usr/bin/gss.debug comp-krb5-debug kerberos,debug +./usr/libdata/debug/usr/bin/gss.debug comp-krb5-debug kerberos,debug,obsolete +./usr/libdata/debug/usr/bin/gsstool.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/bin/gzip.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/head.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/hesinfo.debug comp-hesiod-debug hesiod,debug @@ -3259,11 +3260,13 @@ ./usr/libdata/debug/usr/bin/ipcs.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/join.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/jot.debug comp-util-debug debug +./usr/libdata/debug/usr/bin/kcc.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/bin/kdestroy.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/bin/kdump.debug comp-debug-debug debug ./usr/libdata/debug/usr/bin/kgetcred.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/bin/kinit.debug comp-krb5-debug kerberos,debug -./usr/libdata/debug/usr/bin/klist.debug comp-krb5-debug kerberos,debug +./usr/libdata/debug/usr/bin/klist.debug comp-krb5-debug kerberos,debug,obsolete +./usr/libdata/debug/usr/bin/kpasswd.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/bin/ktrace.debug comp-debug-debug debug ./usr/libdata/debug/usr/bin/ktruss.debug comp-debug-debug debug ./usr/libdata/debug/usr/bin/lam.debug comp-util-debug debug @@ -3576,6 +3579,7 @@ ./usr/libdata/debug/usr/libexec/comsat.debug comp-mail-debug debug ./usr/libdata/debug/usr/libexec/cpp.debug comp-obsolete pcccmds,obsolete ./usr/libdata/debug/usr/libexec/f771.debug comp-fortran-debug gcc=3,gcccmds,debug +./usr/libdata/debug/usr/libexec/digest-service.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/libexec/f771.debug comp-obsolete gcc=4,obsolete ./usr/libdata/debug/usr/libexec/fingerd.debug comp-netutil-debug debug ./usr/libdata/debug/usr/libexec/ftp-proxy.debug comp-obsolete obsolete Index: src/distrib/sets/lists/comp/shl.mi diff -u src/distrib/sets/lists/comp/shl.mi:1.167 src/distrib/sets/lists/comp/shl.mi:1.168 --- src/distrib/sets/lists/comp/shl.mi:1.167 Sun Apr 17 09:01:58 2011 +++ src/distrib/sets/lists/comp/shl.mi Wed Apr 20 18:55:54 2011 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.167 2011/04/17 09:01:58 mrg Exp $ +# $NetBSD: shl.mi,v 1.168 2011/04/20 18:55:54 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -222,7 +222,8 @@ ./usr/libdata/debug/usr/lib/i18n/libmapper_zone.so.5.0.debug comp-i18n-debug debug ./usr/libdata/debug/usr/lib/libamu.so.4.0.debug comp-amd-debug debug ./usr/libdata/debug/usr/lib/libarchive.so.3.1.debug comp-sys-debug debug -./usr/libdata/debug/usr/lib/libasn1.so.8.0.debug comp-krb5-debug kerberos,debug +./usr/libdata/debug/usr/lib/libasn1.so.8.0.debug comp-krb5-debug kerberos,debug,obsolete +./usr/libdata/debug/usr/lib/libasn1.so.9.0.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/lib/libavl.so.0.0.debug comp-zfs-debug zfs,dynamicroot,debug ./usr/libdata/debug/usr/lib/libbfd.so.11.0.debug comp-sys-debug binutils,debug ./usr/libdata/debug/usr/lib/libbind9.so.5.3.debug comp-bind-debug debug @@ -230,7 +231,8 @@ ./usr/libdata/debug/usr/lib/libbsdmalloc.so.0.0.debug comp-sys-debug debug ./usr/libdata/debug/usr/lib/libbz2.so.1.1.debug comp-sys-debug debug ./usr/libdata/debug/usr/lib/libc.so.12.177.debug comp-sys-debug debug -./usr/libdata/debug/usr/lib/libcom_err.so.6.0.debug comp-krb5-debug kerberos,debug +./usr/libdata/debug/usr/lib/libcom_err.so.6.0.debug comp-krb5-debug kerberos,debug,obsolete +./usr/libdata/debug/usr/lib/libcom_err.so.7.0.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/lib/libcrypt.so.1.0.debug comp-sys-debug debug
CVS commit: src
Module Name:src Committed By: haad Date: Mon Feb 28 23:23:08 UTC 2011 Modified Files: src/gnu/usr.bin/groff/tmac: mdoc.local src/lib/libdm: dm.3 Log Message: Fix problems in libdm manual page pointed by njoly@ thanks for help. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/gnu/usr.bin/groff/tmac/mdoc.local cvs rdiff -u -r1.3 -r1.4 src/lib/libdm/dm.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/gnu/usr.bin/groff/tmac/mdoc.local diff -u src/gnu/usr.bin/groff/tmac/mdoc.local:1.62 src/gnu/usr.bin/groff/tmac/mdoc.local:1.63 --- src/gnu/usr.bin/groff/tmac/mdoc.local:1.62 Fri Feb 11 23:47:49 2011 +++ src/gnu/usr.bin/groff/tmac/mdoc.local Mon Feb 28 23:23:08 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: mdoc.local,v 1.62 2011/02/11 23:47:49 christos Exp $ +.\ $NetBSD: mdoc.local,v 1.63 2011/02/28 23:23:08 haad Exp $ .\ .\ Copyright (c) 2003, 2004 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -84,6 +84,7 @@ .\ Local libraries not in groff .ds doc-str-Lb-libarchive Reading and Writing Streaming Archives Library (libarchive, \-larchive) .ds doc-str-Lb-libbluetooth Bluetooth Library (libbluetooth, \-lbluetooth) +.ds doc-str-Lb-libdm Device-mapper Library (libdm, \-ldm) .ds doc-str-Lb-libfetch File Transfer Library for URLs (libfetch, \-lfetch) .ds doc-str-Lb-libiscsi iSCSI protocol library (libiscsi, \-liscsi) .ds doc-str-Lb-libisns Internet Storage Name Service Library (libisns, \-lisns) Index: src/lib/libdm/dm.3 diff -u src/lib/libdm/dm.3:1.3 src/lib/libdm/dm.3:1.4 --- src/lib/libdm/dm.3:1.3 Mon Feb 28 09:10:28 2011 +++ src/lib/libdm/dm.3 Mon Feb 28 23:23:08 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: dm.3,v 1.3 2011/02/28 09:10:28 njoly Exp $ +.\ $NetBSD: dm.3,v 1.4 2011/02/28 23:23:08 haad Exp $ .\ .\ Copyright (c) 2004,2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -30,7 +30,7 @@ .Dt DM 3 .Os .Sh NAME -.Nm libdm +.Nm dm .Nd device-mapper access manipulation library .Sh LIBRARY .Lb libdm @@ -107,9 +107,9 @@ .Ft char * .Fn libdm_table_get_target libdm_table_t libdm_table .Ft int -.Fn libdm_table_set_params const char *params libdm_table_t libdm_table +.Fn libdm_table_set_params const char *params libdm_table_t libdm_table .Ft char * -.Fn libdm_table_get_params libdm_table_t libdm_table +.Fn libdm_table_get_params libdm_table_t libdm_table .Ft int32_t .Fn libdm_table_get_status libdm_table_t libdm_table .Ft void @@ -218,12 +218,10 @@ Set/fetch device status flags from the task dictionary. .Pp .Fn libdm_task_get_open_num -Fetch number of opened devices from the kernel and return them as -.Rt count . +Fetch number of opened devices from the kernel and return them as count . .Pp .Fn libdm_task_get_target_num -Fetch number of opened devices from the kernel and return them as -.Rt count . +Fetch number of opened devices from the kernel and return them as count . .Pp .Fn libdm_task_get_cmd_version Get the version of the dm driver in the kernel as array
CVS commit: src/distrib/sets/lists/base
Module Name:src Committed By: haad Date: Wed Feb 9 08:11:38 UTC 2011 Modified Files: src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.sparc64 Log Message: Fix libdm breakage on 64bit platforms. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/distrib/sets/lists/base/ad.mips64eb cvs rdiff -u -r1.37 -r1.38 src/distrib/sets/lists/base/ad.mips64el cvs rdiff -u -r1.105 -r1.106 src/distrib/sets/lists/base/md.sparc64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/ad.mips64eb diff -u src/distrib/sets/lists/base/ad.mips64eb:1.39 src/distrib/sets/lists/base/ad.mips64eb:1.40 --- src/distrib/sets/lists/base/ad.mips64eb:1.39 Sun Feb 6 00:44:08 2011 +++ src/distrib/sets/lists/base/ad.mips64eb Wed Feb 9 08:11:37 2011 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips64eb,v 1.39 2011/02/06 00:44:08 christos Exp $ +# $NetBSD: ad.mips64eb,v 1.40 2011/02/09 08:11:37 haad Exp $ ./libexec/ld.elf_so-64base-compat-shlib compat,pic ./libexec/ld.elf_so-o32base-sysutil-bin compat,pic ./usr/lib/64 base-compat-lib @@ -77,6 +77,9 @@ ./usr/lib/64/libcurses.so.7.0 base-compat-shlib compat,pic ./usr/lib/64/libdes.so.8 base-compat-shlib compat,pic,crypto ./usr/lib/64/libdes.so.8.1 base-compat-shlib compat,pic,crypto +./usr/lib/64/libdm.sobase-compat-shlib compat,pic +./usr/lib/64/libdm.so.0base-compat-shlib compat,pic +./usr/lib/64/libdm.so.0.0 base-compat-shlib compat,pic ./usr/lib/64/libdns.so.5 base-compat-shlib compat,pic ./usr/lib/64/libdns.so.5.2 base-compat-shlib compat,pic ./usr/lib/64/libdns_sd.so.0 base-compat-shlib compat,pic,mdns @@ -336,6 +339,9 @@ ./usr/lib/o32/libcurses.so.7.0 base-compat-shlib compat,pic ./usr/lib/o32/libdes.so.8 base-compat-shlib compat,pic,crypto ./usr/lib/o32/libdes.so.8.1 base-compat-shlib compat,pic,crypto +./usr/lib/o32/libdm.sobase-compat-shlib compat,pic +./usr/lib/o32/libdm.so.0 base-compat-shlib compat,pic +./usr/lib/o32/libdm.so.0.0 base-compat-shlib compat,pic ./usr/lib/o32/libdns.so.5 base-compat-shlib compat,pic ./usr/lib/o32/libdns.so.5.2 base-compat-shlib compat,pic ./usr/lib/o32/libdns_sd.so.0 base-compat-shlib compat,pic,mdns Index: src/distrib/sets/lists/base/ad.mips64el diff -u src/distrib/sets/lists/base/ad.mips64el:1.37 src/distrib/sets/lists/base/ad.mips64el:1.38 --- src/distrib/sets/lists/base/ad.mips64el:1.37 Sun Feb 6 00:44:08 2011 +++ src/distrib/sets/lists/base/ad.mips64el Wed Feb 9 08:11:37 2011 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips64el,v 1.37 2011/02/06 00:44:08 christos Exp $ +# $NetBSD: ad.mips64el,v 1.38 2011/02/09 08:11:37 haad Exp $ ./libexec/ld.elf_so-64base-compat-shlib compat,pic ./libexec/ld.elf_so-o32base-sysutil-bin compat,pic ./usr/lib/64 base-compat-lib @@ -77,6 +77,9 @@ ./usr/lib/64/libcurses.so.7.0 base-compat-shlib compat,pic ./usr/lib/64/libdes.so.8 base-compat-shlib compat,pic,crypto ./usr/lib/64/libdes.so.8.1 base-compat-shlib compat,pic,crypto +./usr/lib/64/libdm.sobase-compat-shlib compat,pic +./usr/lib/64/libdm.so.0base-compat-shlib compat,pic +./usr/lib/64/libdm.so.0.0 base-compat-shlib compat,pic ./usr/lib/64/libdns.so.5 base-compat-shlib compat,pic ./usr/lib/64/libdns.so.5.2 base-compat-shlib compat,pic ./usr/lib/64/libdns_sd.so.0 base-compat-shlib compat,pic,mdns @@ -336,6 +339,9 @@ ./usr/lib/o32/libcurses.so.7.0 base-compat-shlib compat,pic ./usr/lib/o32/libdes.so.8 base-compat-shlib compat,pic,crypto ./usr/lib/o32/libdes.so.8.1 base-compat-shlib compat,pic,crypto +./usr/lib/o32/libdm.sobase-compat-shlib compat,pic +./usr/lib/o32/libdm.so.0 base-compat-shlib compat,pic +./usr/lib/o32/libdm.so.0.0 base-compat-shlib compat,pic ./usr/lib/o32/libdns.so.5 base-compat-shlib compat,pic ./usr/lib/o32/libdns.so.5.2 base-compat-shlib compat,pic ./usr/lib/o32/libdns_sd.so.0 base-compat-shlib compat,pic,mdns Index: src/distrib/sets/lists/base/md.sparc64 diff -u src/distrib/sets/lists/base/md.sparc64:1.105 src/distrib/sets/lists/base/md.sparc64:1.106 --- src/distrib/sets/lists/base/md.sparc64:1.105 Sun Feb 6 00:44:08 2011 +++ src/distrib/sets/lists/base/md.sparc64 Wed Feb 9 08:11:37 2011 @@ -1,4 +1,4 @@ -# $NetBSD: md.sparc64,v 1.105 2011/02/06 00:44:08 christos Exp $ +# $NetBSD: md.sparc64,v 1.106 2011/02/09 08:11:37 haad Exp $ ./libexec/ld.elf_so-sparc base-sysutil-bin compat,pic ./sbin/edlabel base-sysutil-root obsolete ./usr/bin/fdformatbase-util-bin @@ -78,6 +78,9 @@ ./usr/lib/sparc/libcurses.so.7.0 base-compat-shlib compat,pic ./usr/lib/sparc/libdes.so.8 base-compat-shlib compat,pic,crypto ./usr/lib/sparc/libdes.so.8.1 base-compat-shlib compat,pic,crypto +./usr/lib/sparc/libdm.so base-compat-shlib compat,pic +./usr/lib/sparc/libdm.so.0 base-compat-shlib compat,pic +./usr/lib/sparc/libdm.so.0.0 base-compat-shlib compat,pic
CVS commit: src/distrib/sets/lists
Module Name:src Committed By: haad Date: Tue Feb 8 19:57:11 UTC 2011 Modified Files: src/distrib/sets/lists/base: md.amd64 shl.mi src/distrib/sets/lists/comp: md.amd64 Log Message: Fix build after libdm import sorry for breaking build. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/distrib/sets/lists/base/md.amd64 cvs rdiff -u -r1.574 -r1.575 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.96 -r1.97 src/distrib/sets/lists/comp/md.amd64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/md.amd64 diff -u src/distrib/sets/lists/base/md.amd64:1.112 src/distrib/sets/lists/base/md.amd64:1.113 --- src/distrib/sets/lists/base/md.amd64:1.112 Sun Feb 6 00:44:08 2011 +++ src/distrib/sets/lists/base/md.amd64 Tue Feb 8 19:57:10 2011 @@ -1,4 +1,4 @@ -# $NetBSD: md.amd64,v 1.112 2011/02/06 00:44:08 christos Exp $ +# $NetBSD: md.amd64,v 1.113 2011/02/08 19:57:10 haad Exp $ ./dev/lms0 base-obsolete obsolete ./dev/mms0 base-obsolete obsolete ./libexec/ld.elf_so-i386 base-sys-shlib compat,pic @@ -80,6 +80,9 @@ ./usr/lib/i386/libcurses.so.7.0 base-compat-shlib compat,pic ./usr/lib/i386/libdes.so.8 base-compat-shlib compat,pic ./usr/lib/i386/libdes.so.8.1 base-compat-shlib compat,pic +./usr/lib/i386/libdm.sobase-compat-shlib compat,pic +./usr/lib/i386/libdm.so.0 base-compat-shlib compat,pic +./usr/lib/i386/libdm.so.0.0 base-compat-shlib compat,pic ./usr/lib/i386/libdns.so.5 base-compat-shlib compat,pic ./usr/lib/i386/libdns.so.5.2 base-compat-shlib compat,pic ./usr/lib/i386/libdns_sd.so.0 base-compat-shlib compat,pic,mdns Index: src/distrib/sets/lists/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.574 src/distrib/sets/lists/base/shl.mi:1.575 --- src/distrib/sets/lists/base/shl.mi:1.574 Tue Feb 8 03:20:13 2011 +++ src/distrib/sets/lists/base/shl.mi Tue Feb 8 19:57:10 2011 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.574 2011/02/08 03:20:13 haad Exp $ +# $NetBSD: shl.mi,v 1.575 2011/02/08 19:57:10 haad Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -25,9 +25,6 @@ ./lib/libdevmapper.sobase-lvm-shlib lvm,dynamicroot ./lib/libdevmapper.so.1base-lvm-shlib lvm,dynamicroot ./lib/libdevmapper.so.1.0 base-lvm-shlib lvm,dynamicroot -./lib/libdm.so base-sys-shlib dynamicroot -./lib/libdm.so.0base-sys-shlib dynamicroot -./lib/libdm.so.0.0base-sys-shlib dynamicroot ./lib/libedit.sobase-sys-shlib dynamicroot ./lib/libedit.so.3base-sys-shlib dynamicroot ./lib/libedit.so.3.0base-sys-shlib dynamicroot Index: src/distrib/sets/lists/comp/md.amd64 diff -u src/distrib/sets/lists/comp/md.amd64:1.96 src/distrib/sets/lists/comp/md.amd64:1.97 --- src/distrib/sets/lists/comp/md.amd64:1.96 Sun Feb 6 00:44:09 2011 +++ src/distrib/sets/lists/comp/md.amd64 Tue Feb 8 19:57:11 2011 @@ -1,4 +1,4 @@ -# $NetBSD: md.amd64,v 1.96 2011/02/06 00:44:09 christos Exp $ +# $NetBSD: md.amd64,v 1.97 2011/02/08 19:57:11 haad Exp $ ./usr/include/amd64comp-c-include ./usr/include/amd64/ansi.h comp-c-include ./usr/include/amd64/aout_machdep.h comp-c-include @@ -444,6 +444,9 @@ ./usr/lib/i386/libdes_g.a comp-c-proflib compat,debuglib ./usr/lib/i386/libdes_p.a comp-c-proflib compat,profile ./usr/lib/i386/libdes_pic.a comp-c-piclib compat,pic +./usr/lib/i386/libdm.acomp-c-lib compat +./usr/lib/i386/libdm_p.a comp-c-proflb compat,profile +./usr/lib/i386/libdm_pic.a comp-c-piclib compat,pic ./usr/lib/i386/libdns.acomp-c-lib compat ./usr/lib/i386/libdns.so comp-sys-shlib compat,pic ./usr/lib/i386/libdns_g.a comp-c-proflib compat,debuglib @@ -919,6 +922,7 @@ ./usr/libdata/debug/usr/lib/i386/libcrypto.so.6.1.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libcurses.so.7.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libdes.so.8.1.debug comp-compat-shlib compat,pic,debug +./usr/libdata/debug/usr/lib/i386/libdm.so.0.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libdns.so.5.2.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libdns_sd.so.0.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libdwarf.so.0.0.debug comp-compat-shlib compat,pic,debug
CVS commit: src/external/gpl2/lvm2
Module Name:src Committed By: haad Date: Tue Feb 8 03:26:13 UTC 2011 Modified Files: src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c libdm_netbsd.c src/external/gpl2/lvm2/lib/libdevmapper: libdm-netbsd.h src/external/gpl2/lvm2/sbin/dmsetup: Makefile src/external/gpl2/lvm2/sbin/lvm: Makefile Log Message: Switch libdevmapper library to use libdm as it;s backend lib and do not communicate with device-mapper directly. Our lvm stack now looks like this lvm-libdevmapper-libdm-dm where only libdm knows how our dm protocol looks like. No objections on tech-userlevel@. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c cvs rdiff -u -r1.6 -r1.7 \ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/sbin/dmsetup/Makefile cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/lvm2/sbin/lvm/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.11 --- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10 Wed Jan 12 08:16:23 2011 +++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c Tue Feb 8 03:26:12 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: libdm-nbsd-iface.c,v 1.10 2011/01/12 08:16:23 haad Exp $*/ +/* $NetBSD: libdm-nbsd-iface.c,v 1.11 2011/02/08 03:26:12 haad Exp $*/ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -28,6 +28,7 @@ #include dirent.h #include limits.h +#include dm.h #include dev/dm/netbsd-dm.h #include dm-ioctl.h @@ -38,8 +39,8 @@ #endif /* - * Ensure build compatibility. - * The hard-coded versions here are the highest present + * Ensure build compatibility. + * The hard-coded versions here are the highest present * in the _cmd_data arrays. */ @@ -104,9 +105,9 @@ { nbsd_get_dm_major(major, DM_CHAR_MAJOR); - + *minor = 0; - + return 1; } @@ -185,7 +186,7 @@ uint32_t dm_major; nbsd_get_dm_major(dm_major, DM_BLOCK_MAJOR); - + if (major == dm_major) return 1; @@ -201,7 +202,7 @@ if (_control_fd != -1) return 1; -#ifdef RUMP_ACTION +#ifdef RUMP_ACTION rump_init(); #endif snprintf(control, sizeof(control), %s/control, dm_dir()); @@ -297,7 +298,7 @@ } /* - * Find out device-mapper's major version number the first time + * Find out device-mapper's major version number the first time * this is called and whether or not we support it. */ int dm_check_version(void) @@ -422,14 +423,14 @@ dev_t dev; size_t val_len,i; struct kinfo_drivers *kd; - + mode = 0; - + nbsd_get_dm_major(dm_major, DM_BLOCK_MAJOR); if (bufsize 8) return 0; - + if (sysctlbyname(kern.drivers,NULL,val_len,NULL,0) 0) { printf(sysctlbyname failed); return 0; @@ -451,7 +452,7 @@ break; } } - + dev = MKDEV(major,dev_minor); mode |= S_IFBLK; @@ -489,10 +490,10 @@ info-target_count = dmt-dmi.v4-target_count; info-open_count = dmt-dmi.v4-open_count; info-event_nr = dmt-dmi.v4-event_nr; - + nbsd_get_dm_major(info-major, DM_BLOCK_MAJOR); /* get netbsd dm device major number */ info-minor = MINOR(dmt-dmi.v4-dev); - + return 1; } @@ -657,44 +658,39 @@ } /* Parse given dm task structure to proplib dictionary. */ -static int _flatten(struct dm_task *dmt, prop_dictionary_t dm_dict) +static int _flatten(struct dm_task *dmt, libdm_task_t task) { - prop_array_t cmd_array; - prop_dictionary_t target_spec; - + libdm_cmd_t cmd; + libdm_table_t table; + struct target *t; - + size_t len; char type[DM_MAX_TYPE_NAME]; - + uint32_t major, flags; int count = 0; - const int (*version)[3]; - + flags = 0; - version = _cmd_data_v4[dmt-type].version; - cmd_array = prop_array_create(); + cmd = libdm_cmd_create(); for (t = dmt-head; t; t = t-next) { - target_spec = prop_dictionary_create(); - - prop_dictionary_set_uint64(target_spec,DM_TABLE_START,t-start); - prop_dictionary_set_uint64(target_spec,DM_TABLE_LENGTH,t-length); - strlcpy(type,t-type,DM_MAX_TYPE_NAME); - prop_dictionary_set_cstring(target_spec,DM_TABLE_TYPE,type); - prop_dictionary_set_cstring(target_spec,DM_TABLE_PARAMS,t-params); + table = libdm_table_create(); + + libdm_table_set_start(t-start, table); + libdm_table_set_length(t-length, table); + libdm_table_set_target(type, table); + libdm_table_set_params(t-params, table); + libdm_cmd_set_table(table, cmd); - prop_array_set(cmd_array,count,target_spec); + libdm_table_destroy(table); - prop_object_release(target_spec); - count++; } - if (count
CVS commit: src/sys/dev/putter
Module Name:src Committed By: haad Date: Sun Feb 6 14:29:25 UTC 2011 Modified Files: src/sys/dev/putter: putter.c Log Message: Revert my fix. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/putter/putter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/putter/putter.c diff -u src/sys/dev/putter/putter.c:1.30 src/sys/dev/putter/putter.c:1.31 --- src/sys/dev/putter/putter.c:1.30 Sun Feb 6 01:28:16 2011 +++ src/sys/dev/putter/putter.c Sun Feb 6 14:29:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: putter.c,v 1.30 2011/02/06 01:28:16 haad Exp $ */ +/* $NetBSD: putter.c,v 1.31 2011/02/06 14:29:25 haad Exp $ */ /* * Copyright (c) 2006, 2007 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: putter.c,v 1.30 2011/02/06 01:28:16 haad Exp $); +__KERNEL_RCSID(0, $NetBSD: putter.c,v 1.31 2011/02/06 14:29:25 haad Exp $); #include sys/param.h #include sys/systm.h @@ -644,7 +644,7 @@ return i; } -MODULE(MODULE_CLASS_DRIVER, putter, puffs); +MODULE(MODULE_CLASS_DRIVER, putter, NULL); static int putter_modcmd(modcmd_t cmd, void *arg)
CVS commit: src/sys/dev/putter
Module Name:src Committed By: haad Date: Sun Feb 6 01:28:17 UTC 2011 Modified Files: src/sys/dev/putter: putter.c Log Message: Putter depends on puffs add missing dependience. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/putter/putter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/putter/putter.c diff -u src/sys/dev/putter/putter.c:1.29 src/sys/dev/putter/putter.c:1.30 --- src/sys/dev/putter/putter.c:1.29 Fri Aug 27 07:40:01 2010 +++ src/sys/dev/putter/putter.c Sun Feb 6 01:28:16 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: putter.c,v 1.29 2010/08/27 07:40:01 pooka Exp $ */ +/* $NetBSD: putter.c,v 1.30 2011/02/06 01:28:16 haad Exp $ */ /* * Copyright (c) 2006, 2007 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: putter.c,v 1.29 2010/08/27 07:40:01 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: putter.c,v 1.30 2011/02/06 01:28:16 haad Exp $); #include sys/param.h #include sys/systm.h @@ -644,7 +644,7 @@ return i; } -MODULE(MODULE_CLASS_DRIVER, putter, NULL); +MODULE(MODULE_CLASS_DRIVER, putter, puffs); static int putter_modcmd(modcmd_t cmd, void *arg)
CVS commit: src/sys
Module Name:src Committed By: haad Date: Fri Jan 28 23:54:28 UTC 2011 Modified Files: src/sys/dev/pud: pud.c Added Files: src/sys/modules/pud: Makefile Log Message: Add support for building pud as module. Do it in a same way how putter is done. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pud/pud.c cvs rdiff -u -r0 -r1.1 src/sys/modules/pud/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pud/pud.c diff -u src/sys/dev/pud/pud.c:1.8 src/sys/dev/pud/pud.c:1.9 --- src/sys/dev/pud/pud.c:1.8 Wed Mar 18 10:22:41 2009 +++ src/sys/dev/pud/pud.c Fri Jan 28 23:54:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pud.c,v 1.8 2009/03/18 10:22:41 cegger Exp $ */ +/* $NetBSD: pud.c,v 1.9 2011/01/28 23:54:28 haad Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -29,11 +29,12 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pud.c,v 1.8 2009/03/18 10:22:41 cegger Exp $); +__KERNEL_RCSID(0, $NetBSD: pud.c,v 1.9 2011/01/28 23:54:28 haad Exp $); #include sys/param.h #include sys/conf.h #include sys/kmem.h +#include sys/module.h #include sys/poll.h #include sys/queue.h @@ -381,3 +382,28 @@ } mutex_init(pud_mtx, MUTEX_DEFAULT, IPL_NONE); } + +MODULE(MODULE_CLASS_DRIVER, pud, putter); + +static int +pud_modcmd(modcmd_t cmd, void *arg) +{ + #ifdef _MODULE + devmajor_t bmajor = NODEVMAJOR, cmajor = NODEVMAJOR; + + switch (cmd) { + case MODULE_CMD_INIT: + pudattach(); + return devsw_attach(pud, NULL, bmajor, + pud_cdevsw, cmajor); + case MODULE_CMD_FINI: + return ENOTTY; /* XXX: puddetach */ + default: + return ENOTTY; + } + #else + if (cmd == MODULE_CMD_INIT) + return 0; + return ENOTTY; + #endif +} Added files: Index: src/sys/modules/pud/Makefile diff -u /dev/null src/sys/modules/pud/Makefile:1.1 --- /dev/null Fri Jan 28 23:54:28 2011 +++ src/sys/modules/pud/Makefile Fri Jan 28 23:54:28 2011 @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2011/01/28 23:54:28 haad Exp $ + +.include ../Makefile.inc + +.PATH: ${S}/dev/pud + +KMOD= pud +SRCS= pud.c pud_dev.c + +.include bsd.kmodule.mk
CVS commit: src
Module Name:src Committed By: haad Date: Tue Jan 18 22:21:24 UTC 2011 Modified Files: src/distrib/sets/lists/base: shl.mi src/distrib/sets/lists/comp: mi shl.mi src/sys/modules/solaris: Makefile src/sys/modules/zfs: Makefile src/sys/rump/fs: Makefile.rumpfscomp src/sys/rump/kern: Makefile.rumpkerncomp src/sys/rump/librump/rumpkern: locks.c rumpcopy.c vm.c Added Files: src/sys/modules/solaris: Makefile.solmod src/sys/modules/zfs: Makefile.zfsmod src/sys/rump/fs/lib/libzfs: Makefile component.c shlib_version src/sys/rump/kern/lib/libsolaris: Makefile component.c shlib_version Log Message: Add support for compiling ZFS and Solaris modules as RUMP libraries. Add some locking and rumpcopy primitives and refactor module building Makefiles to work with both RUMP and kernel modules. This is first part of adding support for regular test of zfs on NetBSD to hunt some bugs and make it stable. Ok by pooka@. To generate a diff of this commit: cvs rdiff -u -r1.568 -r1.569 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.1570 -r1.1571 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.150 -r1.151 src/distrib/sets/lists/comp/shl.mi cvs rdiff -u -r1.4 -r1.5 src/sys/modules/solaris/Makefile cvs rdiff -u -r0 -r1.1 src/sys/modules/solaris/Makefile.solmod cvs rdiff -u -r1.3 -r1.4 src/sys/modules/zfs/Makefile cvs rdiff -u -r0 -r1.1 src/sys/modules/zfs/Makefile.zfsmod cvs rdiff -u -r1.1 -r1.2 src/sys/rump/fs/Makefile.rumpfscomp cvs rdiff -u -r0 -r1.1 src/sys/rump/fs/lib/libzfs/Makefile \ src/sys/rump/fs/lib/libzfs/component.c \ src/sys/rump/fs/lib/libzfs/shlib_version cvs rdiff -u -r1.2 -r1.3 src/sys/rump/kern/Makefile.rumpkerncomp cvs rdiff -u -r0 -r1.1 src/sys/rump/kern/lib/libsolaris/Makefile \ src/sys/rump/kern/lib/libsolaris/component.c \ src/sys/rump/kern/lib/libsolaris/shlib_version cvs rdiff -u -r1.47 -r1.48 src/sys/rump/librump/rumpkern/locks.c cvs rdiff -u -r1.16 -r1.17 src/sys/rump/librump/rumpkern/rumpcopy.c cvs rdiff -u -r1.106 -r1.107 src/sys/rump/librump/rumpkern/vm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.568 src/distrib/sets/lists/base/shl.mi:1.569 --- src/distrib/sets/lists/base/shl.mi:1.568 Tue Jan 18 20:09:38 2011 +++ src/distrib/sets/lists/base/shl.mi Tue Jan 18 22:21:22 2011 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.568 2011/01/18 20:09:38 pooka Exp $ +# $NetBSD: shl.mi,v 1.569 2011/01/18 22:21:22 haad Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -534,12 +534,18 @@ ./usr/lib/librumpfs_union.so base-rump-shlib ./usr/lib/librumpfs_union.so.0 base-rump-shlib ./usr/lib/librumpfs_union.so.0.0 base-rump-shlib +./usr/lib/librumpfs_zfs.so base-rump-shlib +./usr/lib/librumpfs_zfs.so.0 base-rump-shlib +./usr/lib/librumpfs_zfs.so.0.0 base-rump-shlib ./usr/lib/librumpkern_crypto.so base-rump-shlib ./usr/lib/librumpkern_crypto.so.0 base-rump-shlib ./usr/lib/librumpkern_crypto.so.0.0 base-rump-shlib ./usr/lib/librumpkern_ksem.so base-rump-shlib ./usr/lib/librumpkern_ksem.so.0 base-rump-shlib ./usr/lib/librumpkern_ksem.so.0.0 base-rump-shlib +./usr/lib/librumpkern_solaris.so base-rump-shlib +./usr/lib/librumpkern_solaris.so.0 base-rump-shlib +./usr/lib/librumpkern_solaris.so.0.0 base-rump-shlib ./usr/lib/librumpkern_tty.so base-rump-shlib ./usr/lib/librumpkern_tty.so.0 base-rump-shlib ./usr/lib/librumpkern_tty.so.0.0 base-rump-shlib Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1570 src/distrib/sets/lists/comp/mi:1.1571 --- src/distrib/sets/lists/comp/mi:1.1570 Tue Jan 18 21:07:51 2011 +++ src/distrib/sets/lists/comp/mi Tue Jan 18 22:21:22 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1570 2011/01/18 21:07:51 pooka Exp $ +# $NetBSD: mi,v 1.1571 2011/01/18 22:21:22 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -2784,12 +2784,16 @@ ./usr/lib/librumpfs_union.a comp-c-lib ./usr/lib/librumpfs_union_g.a -unknown- debuglib ./usr/lib/librumpfs_union_p.a comp-c-proflib profile +./usr/lib/librumpfs_zfs.a comp-c-lib +./usr/lib/librumpfs_zfs_p.a comp-c-piclib profile ./usr/lib/librumpkern_crypto.a comp-c-lib ./usr/lib/librumpkern_crypto_g.a -unknown- debuglib ./usr/lib/librumpkern_crypto_p.a comp-c-proflib profile ./usr/lib/librumpkern_ksem.a comp-c-lib ./usr/lib/librumpkern_ksem_g.a -unknown- debuglib ./usr/lib/librumpkern_ksem_p.a comp-c-proflib profile +./usr/lib/librumpkern_solaris.a comp-c-lib +./usr/lib/librumpkern_solaris_p.a comp-c-proflib profile ./usr/lib/librumpkern_tty.a comp-c-lib ./usr/lib/librumpkern_tty_g.a -unknown- debuglib ./usr/lib/librumpkern_tty_p.a comp-c-proflib profile Index:
CVS commit: src/sys/arch/usermode/include
Module Name:src Committed By: haad Date: Tue Jan 18 23:02:37 UTC 2011 Modified Files: src/sys/arch/usermode/include: pmap.h Log Message: Bring pmap.h to new world order. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/usermode/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/usermode/include/pmap.h diff -u src/sys/arch/usermode/include/pmap.h:1.2 src/sys/arch/usermode/include/pmap.h:1.3 --- src/sys/arch/usermode/include/pmap.h:1.2 Wed Oct 21 16:06:59 2009 +++ src/sys/arch/usermode/include/pmap.h Tue Jan 18 23:02:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.2 2009/10/21 16:06:59 snj Exp $ */ +/* $NetBSD: pmap.h,v 1.3 2011/01/18 23:02:36 haad Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca @@ -33,7 +33,7 @@ #define PMAP_MAP_POOLPAGE(x) (x) #define PMAP_UNMAP_POOLPAGE(x) (x) -typedef struct pmap { -} *pmap_t; +struct pmap { +}; #endif /* !_ARCH_USERMODE_INCLUDE_PMAP_H */
CVS commit: src/sys/arch/usermode/include
Module Name:src Committed By: haad Date: Tue Jan 18 23:03:29 UTC 2011 Added Files: src/sys/arch/usermode/include: bus.h Log Message: bus.h is required for build so add some empty file for now. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/usermode/include/bus.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files:
CVS commit: src
Module Name:src Committed By: haad Date: Thu Jan 13 22:28:37 UTC 2011 Modified Files: src/distrib/sets/lists/base: mi src/distrib/sets/lists/comp: mi src/sbin: Makefile src/usr.sbin: Makefile Added Files: src/sbin/chown: Makefile chgrp.1 chown.8 chown.c Removed Files: src/usr.sbin/chown: Makefile chgrp.1 chown.8 chown.c Log Message: Move chown from usr.sbin to sbin and chgrp from usr.bin to bin directories. This was discussed and oked on tech-userlevel I have run full build release, test anita cycle with this patch. To generate a diff of this commit: cvs rdiff -u -r1.914 -r1.915 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.1565 -r1.1566 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.117 -r1.118 src/sbin/Makefile cvs rdiff -u -r0 -r1.5 src/sbin/chown/Makefile cvs rdiff -u -r0 -r1.4 src/sbin/chown/chgrp.1 src/sbin/chown/chown.8 \ src/sbin/chown/chown.c cvs rdiff -u -r1.249 -r1.250 src/usr.sbin/Makefile cvs rdiff -u -r1.9 -r0 src/usr.sbin/chown/Makefile cvs rdiff -u -r1.19 -r0 src/usr.sbin/chown/chgrp.1 cvs rdiff -u -r1.21 -r0 src/usr.sbin/chown/chown.8 cvs rdiff -u -r1.32 -r0 src/usr.sbin/chown/chown.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.914 src/distrib/sets/lists/base/mi:1.915 --- src/distrib/sets/lists/base/mi:1.914 Wed Jan 12 16:18:57 2011 +++ src/distrib/sets/lists/base/mi Thu Jan 13 22:28:36 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.914 2011/01/12 16:18:57 pooka Exp $ +# $NetBSD: mi,v 1.915 2011/01/13 22:28:36 haad Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -21,6 +21,7 @@ ./bin/cp base-util-root ./bin/cpio base-util-root ./bin/csh base-util-root +./bin/chgrp base-util-root ./bin/date base-util-root ./bin/dd base-util-root ./bin/df base-util-root @@ -206,6 +207,7 @@ ./sbin/brconfig base-netutil-root ./sbin/ccdconfigbase-sysutil-root ./sbin/cgdconfigbase-sysutil-root crypto +./sbin/chown base-sysutil-root ./sbin/rump.cgdconfigbase-sysutil-root crypto ./sbin/clri base-sysutil-root ./sbin/dhclient base-dhclient-root Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1565 src/distrib/sets/lists/comp/mi:1.1566 --- src/distrib/sets/lists/comp/mi:1.1565 Wed Jan 12 16:18:57 2011 +++ src/distrib/sets/lists/comp/mi Thu Jan 13 22:28:37 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1565 2011/01/12 16:18:57 pooka Exp $ +# $NetBSD: mi,v 1.1566 2011/01/13 22:28:37 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -2954,6 +2954,7 @@ ./usr/libdata/debug/sbin/brconfig.debug comp-netutil-debug debug ./usr/libdata/debug/sbin/ccdconfig.debug comp-sysutil-debug debug ./usr/libdata/debug/sbin/cgdconfig.debug comp-sysutil-debug crypto,debug +./usr/libdata/debug/sbin/chown.debug comp-sysutil-debug debug ./usr/libdata/debug/sbin/rump.cgdconfig.debug comp-sysutil-debug crypto,debug ./usr/libdata/debug/sbin/clri.debug comp-sysutil-debug debug ./usr/libdata/debug/sbin/dhclient.debug comp-dhclient-debug debug @@ -3597,7 +3598,6 @@ ./usr/libdata/debug/usr/sbin/btuartd.debug comp-obsolete obsolete ./usr/libdata/debug/usr/sbin/catman.debug comp-man-debug debug ./usr/libdata/debug/usr/sbin/chat.debug comp-ppp-debug debug -./usr/libdata/debug/usr/sbin/chown.debug comp-sysutil-debug debug ./usr/libdata/debug/usr/sbin/chroot.debug comp-sysutil-debug debug ./usr/libdata/debug/usr/sbin/chrtbl.debug comp-sysutil-debug debug ./usr/libdata/debug/usr/sbin/cnwctl.debug comp-netutil-debug debug Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.117 src/sbin/Makefile:1.118 --- src/sbin/Makefile:1.117 Sat Oct 30 21:16:07 2010 +++ src/sbin/Makefile Thu Jan 13 22:28:36 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.117 2010/10/30 21:16:07 haad Exp $ +# $NetBSD: Makefile,v 1.118 2011/01/13 22:28:36 haad Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -7,7 +7,7 @@ .include bsd.own.mk SUBDIR= amrctl apmlabel atactl badsect bioctl brconfig ccdconfig \ - disklabel dkctl dkscan_bsdlabel dmesg \ + chown disklabel dkctl dkscan_bsdlabel dmesg \ drvctl fastboot fdisk fsck fsirand gpt ifconfig init ldconfig \ mbrlabel mknod modload modstat modunload mount newbtconf nologin \ pdisk ping pppoectl raidctl reboot rcorder rndctl route routed \ Index: src/usr.sbin/Makefile diff -u src/usr.sbin/Makefile:1.249 src/usr.sbin/Makefile:1.250 --- src/usr.sbin/Makefile:1.249 Wed Dec 8 07:20:14 2010 +++ src/usr.sbin/Makefile Thu Jan 13 22:28:35 2011 @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.249 2010/12/08 07:20:14 kefren Exp $ +# $NetBSD: Makefile,v 1.250 2011/01/13 22:28:35 haad Exp $ # from: @(#)Makefile 5.20 (Berkeley) 6/12/93
CVS commit: src/etc/rc.d
Module Name:src Committed By: haad Date: Thu Jan 13 22:30:10 UTC 2011 Modified Files: src/etc/rc.d: mountcritlocal Log Message: Use chown now when it's available without /usr mounted. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/etc/rc.d/mountcritlocal Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/rc.d/mountcritlocal diff -u src/etc/rc.d/mountcritlocal:1.12 src/etc/rc.d/mountcritlocal:1.13 --- src/etc/rc.d/mountcritlocal:1.12 Sat Jan 8 16:16:51 2011 +++ src/etc/rc.d/mountcritlocal Thu Jan 13 22:30:09 2011 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: mountcritlocal,v 1.12 2011/01/08 16:16:51 haad Exp $ +# $NetBSD: mountcritlocal,v 1.13 2011/01/13 22:30:09 haad Exp $ # # PROVIDE: mountcritlocal @@ -29,7 +29,7 @@ # group and has parmissions to allow lock file creation. # mkdir /var/run/lvm - /rescue/chown root:operator /var/run/lvm + chown root:operator /var/run/lvm chmod 770 /var/run/lvm }
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Thu Jan 13 23:18:24 UTC 2011 Modified Files: src/external/cddl/osnet: Makefile.zfs src/external/cddl/osnet/lib/libavl: Makefile src/external/cddl/osnet/lib/libnvpair: Makefile src/external/cddl/osnet/lib/libuutil: Makefile src/external/cddl/osnet/lib/libzfs: Makefile Log Message: Fix zfs Makefiles + debug, don't add -g by default only when MKDEBUG is enabled. Fix header assert conflicts + bump WARNS for some libs. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/Makefile.zfs cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/lib/libavl/Makefile cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/lib/libnvpair/Makefile cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/lib/libuutil/Makefile cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/lib/libzfs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/Makefile.zfs diff -u src/external/cddl/osnet/Makefile.zfs:1.2 src/external/cddl/osnet/Makefile.zfs:1.3 --- src/external/cddl/osnet/Makefile.zfs:1.2 Sun Feb 28 15:24:04 2010 +++ src/external/cddl/osnet/Makefile.zfs Thu Jan 13 23:18:23 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.zfs,v 1.2 2010/02/28 15:24:04 haad Exp $ +# $NetBSD: Makefile.zfs,v 1.3 2011/01/13 23:18:23 haad Exp $ .include bsd.own.mk @@ -14,8 +14,9 @@ CPPFLAGS+= -D_SUNOS_VTOC_16 CPPFLAGS+= -D_PROPLIB_ZFS_CONFLICT -CPPFLAGS+= -g -LDFLAGS+= -g +CFLAGS+= -O0 -fno-inline + +DBG= -g ZFSDIR= ${NETBSDSRCDIR}/external/cddl/osnet Index: src/external/cddl/osnet/lib/libavl/Makefile diff -u src/external/cddl/osnet/lib/libavl/Makefile:1.3 src/external/cddl/osnet/lib/libavl/Makefile:1.4 --- src/external/cddl/osnet/lib/libavl/Makefile:1.3 Sun Feb 21 01:46:35 2010 +++ src/external/cddl/osnet/lib/libavl/Makefile Thu Jan 13 23:18:24 2011 @@ -1,7 +1,9 @@ -# $NetBSD: Makefile,v 1.3 2010/02/21 01:46:35 darran Exp $ +# $NetBSD: Makefile,v 1.4 2011/01/13 23:18:24 haad Exp $ .PATH: ${.CURDIR}/../../dist/common/avl +CPPFLAGS+=-Wall -Wno-unknown-pragmas + LIB= avl SRCS= avl.c Index: src/external/cddl/osnet/lib/libnvpair/Makefile diff -u src/external/cddl/osnet/lib/libnvpair/Makefile:1.5 src/external/cddl/osnet/lib/libnvpair/Makefile:1.6 --- src/external/cddl/osnet/lib/libnvpair/Makefile:1.5 Mon Feb 22 20:05:03 2010 +++ src/external/cddl/osnet/lib/libnvpair/Makefile Thu Jan 13 23:18:24 2011 @@ -1,8 +1,10 @@ -# $NetBSD: Makefile,v 1.5 2010/02/22 20:05:03 haad Exp $ +# $NetBSD: Makefile,v 1.6 2011/01/13 23:18:24 haad Exp $ .PATH: ${.CURDIR}/../../dist/lib/libnvpair .PATH: ${.CURDIR}/../../dist/common/nvpair +CPPFLAGS+=-Wall -Wno-unknown-pragmas + LIB= nvpair SRCS= libnvpair.c nvpair_alloc_system.c nvpair_alloc_fixed.c nvpair.c Index: src/external/cddl/osnet/lib/libuutil/Makefile diff -u src/external/cddl/osnet/lib/libuutil/Makefile:1.3 src/external/cddl/osnet/lib/libuutil/Makefile:1.4 --- src/external/cddl/osnet/lib/libuutil/Makefile:1.3 Sun Feb 21 01:46:35 2010 +++ src/external/cddl/osnet/lib/libuutil/Makefile Thu Jan 13 23:18:24 2011 @@ -1,8 +1,10 @@ -# $NetBSD: Makefile,v 1.3 2010/02/21 01:46:35 darran Exp $ +# $NetBSD: Makefile,v 1.4 2011/01/13 23:18:24 haad Exp $ .PATH: ${.CURDIR}/../../dist/lib/libuutil/common .PATH: ${.CURDIR}/../../dist/common/avl +CPPFLAGS+=-Wall -Wno-unknown-pragmas + LIB= uutil SRCS= avl.c uu_alloc.c uu_avl.c uu_dprintf.c uu_ident.c uu_list.c \ uu_misc.c uu_open.c uu_pname.c uu_strtoint.c Index: src/external/cddl/osnet/lib/libzfs/Makefile diff -u src/external/cddl/osnet/lib/libzfs/Makefile:1.5 src/external/cddl/osnet/lib/libzfs/Makefile:1.6 --- src/external/cddl/osnet/lib/libzfs/Makefile:1.5 Sun Feb 28 22:40:09 2010 +++ src/external/cddl/osnet/lib/libzfs/Makefile Thu Jan 13 23:18:24 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2010/02/28 22:40:09 haad Exp $ +# $NetBSD: Makefile,v 1.6 2011/01/13 23:18:24 haad Exp $ .PATH: ${.CURDIR}/../../dist/common/zfs .PATH: ${.CURDIR}/../../dist/common/fs/zfs @@ -19,12 +19,13 @@ SRCS+= libzfs_status.c libzfs_sendrecv.c CPPFLAGS+= -I${NETBSDSRCDIR}/sbin/mount +# CPPFLAGS+= -Wall -Wno-unknown-pragmas # Avoid conflict with libprop CPPFLAGS+= -D_PROPLIB_ZFS_CONFLICT # Avoid internal header conflicts -CPPFLAGS+= -D_ZFS_CONTEXT_NO_VERIFY +CPPFLAGS+= -D_ZFS_CONTEXT_NO_VERIFY -D_ZFS_CONTEXT_NO_DEBUG .include ../../Makefile.zfs .include bsd.lib.mk
CVS commit: src/sbin/chown
Module Name:src Committed By: haad Date: Thu Jan 13 23:44:11 UTC 2011 Modified Files: src/sbin/chown: Makefile Log Message: Use SYMLINKS, I'm not sure why I ahve commited old version of my patch, but it should be ok now. Thanks to tron@ for pointing at this issue. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sbin/chown/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/chown/Makefile diff -u src/sbin/chown/Makefile:1.5 src/sbin/chown/Makefile:1.6 --- src/sbin/chown/Makefile:1.5 Thu Jan 13 22:28:36 2011 +++ src/sbin/chown/Makefile Thu Jan 13 23:44:11 2011 @@ -1,12 +1,12 @@ # from: @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $NetBSD: Makefile,v 1.5 2011/01/13 22:28:36 haad Exp $ +# $NetBSD: Makefile,v 1.6 2011/01/13 23:44:11 haad Exp $ PROG= chown CPPFLAGS+=-DSUPPORT_DOT MAN= chgrp.1 chown.8 -LINKS= ${BINDIR}/chown /bin/chgrp +SYMLINKS+= ${BINDIR}/chown /bin/chgrp -LINKS+= ${BINDIR}/chown /usr/bin/chgrp -LINKS+= ${BINDIR}/chown /usr/sbin/chown +SYMLINKS+= ${BINDIR}/chown /usr/bin/chgrp +SYMLINKS+= ${BINDIR}/chown /usr/sbin/chown .include bsd.prog.mk
CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl
Module Name:src Committed By: haad Date: Wed Jan 12 08:16:23 UTC 2011 Modified Files: src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c Log Message: Use DM_DEVICE_CONTROL_MODE, because mapper/control device should have 660 and not 640 permissions. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 \ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10 --- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9 Sun Dec 26 14:48:34 2010 +++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c Wed Jan 12 08:16:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: libdm-nbsd-iface.c,v 1.9 2010/12/26 14:48:34 christos Exp $*/ +/* $NetBSD: libdm-nbsd-iface.c,v 1.10 2011/01/12 08:16:23 haad Exp $*/ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -163,7 +163,7 @@ log_verbose(Creating device %s (%u, %u), control, major, minor); old_umask = umask(0); - if (mknod(control, S_IFCHR | DM_DEVICE_MODE, + if (mknod(control, S_IFCHR | DM_CONTROL_DEVICE_MODE, MKDEV(major, minor)) 0) { umask(old_umask); log_sys_error(mknod, control);
CVS commit: src/etc/rc.d
Module Name:src Committed By: haad Date: Sat Jan 8 16:16:52 UTC 2011 Modified Files: src/etc/rc.d: mountcritlocal Log Message: Use /rescue/chown not chown from /usr/sbin which might not be available in time of running this script. XXX. Why is chown in /usr/sbin ? it should be moved to /sbin To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/etc/rc.d/mountcritlocal Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/rc.d/mountcritlocal diff -u src/etc/rc.d/mountcritlocal:1.11 src/etc/rc.d/mountcritlocal:1.12 --- src/etc/rc.d/mountcritlocal:1.11 Wed Jan 5 14:57:29 2011 +++ src/etc/rc.d/mountcritlocal Sat Jan 8 16:16:51 2011 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: mountcritlocal,v 1.11 2011/01/05 14:57:29 haad Exp $ +# $NetBSD: mountcritlocal,v 1.12 2011/01/08 16:16:51 haad Exp $ # # PROVIDE: mountcritlocal @@ -29,7 +29,7 @@ # group and has parmissions to allow lock file creation. # mkdir /var/run/lvm - chown root:operator /var/run/lvm + /rescue/chown root:operator /var/run/lvm chmod 770 /var/run/lvm }
CVS commit: src
Module Name:src Committed By: haad Date: Wed Jan 5 14:57:29 UTC 2011 Modified Files: src/distrib/sets/lists/base: mi src/etc/mtree: NetBSD.dist.base src/etc/rc.d: mountcritlocal src/external/gpl2/lvm2: lvm2tools.mk src/external/gpl2/lvm2/dist/include: defaults.h src/external/gpl2/lvm2/dist/lib/format_text: archiver.c src/external/gpl2/lvm2/dist/lib/locking: file_locking.c src/external/gpl2/lvm2/dist/lib/misc: lvm-globals.c lvm-globals.h src/external/gpl2/lvm2/dist/libdm: libdm-file.c src/external/gpl2/lvm2/dist/tools: lvmcmdline.c Log Message: Allow operator to use lvm in read-only mode. Switch LVM lock dir to /var/run/lvm and create it in rc.d/mountcritlocal. Fix dm control device permissions to allow rw for operator. Test if we are running lvm commands as operator and if that it's true do not create vg backups and do not print confusing warning. To generate a diff of this commit: cvs rdiff -u -r1.912 -r1.913 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.71 -r1.72 src/etc/mtree/NetBSD.dist.base cvs rdiff -u -r1.10 -r1.11 src/etc/rc.d/mountcritlocal cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/lvm2tools.mk cvs rdiff -u -r1.1.1.2 -r1.2 src/external/gpl2/lvm2/dist/include/defaults.h cvs rdiff -u -r1.1.1.3 -r1.2 \ src/external/gpl2/lvm2/dist/lib/format_text/archiver.c cvs rdiff -u -r1.1.1.3 -r1.2 \ src/external/gpl2/lvm2/dist/lib/locking/file_locking.c cvs rdiff -u -r1.1.1.3 -r1.2 \ src/external/gpl2/lvm2/dist/lib/misc/lvm-globals.c cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/gpl2/lvm2/dist/lib/misc/lvm-globals.h cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/libdm/libdm-file.c cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl2/lvm2/dist/tools/lvmcmdline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.912 src/distrib/sets/lists/base/mi:1.913 --- src/distrib/sets/lists/base/mi:1.912 Sat Jan 1 13:09:13 2011 +++ src/distrib/sets/lists/base/mi Wed Jan 5 14:57:29 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.912 2011/01/01 13:09:13 haad Exp $ +# $NetBSD: mi,v 1.913 2011/01/05 14:57:29 haad Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -4836,8 +4836,8 @@ ./var/games/sailbase-games-root ./var/games/savebase-obsolete obsolete ./var/heimdal base-krb5-root -./var/lock base-sys-root -./var/lock/lvm base-sys-root lvm +./var/lock base-sys-root obsolete +./var/lock/lvm base-sys-root obsolete ./var/log base-sys-root ./var/log/rdist base-netutil-root ./var/mail base-mail-root Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.71 src/etc/mtree/NetBSD.dist.base:1.72 --- src/etc/mtree/NetBSD.dist.base:1.71 Sat Jan 1 22:11:45 2011 +++ src/etc/mtree/NetBSD.dist.base Wed Jan 5 14:57:29 2011 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.71 2011/01/01 22:11:45 haad Exp $ +# $NetBSD: NetBSD.dist.base,v 1.72 2011/01/05 14:57:29 haad Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -1098,8 +1098,6 @@ ./var/games/phantasia uname=games gname=games mode=0775 ./var/games/sail uname=games gname=games mode=0775 ./var/heimdal -./var/lock gname=operator mode=0710 -./var/lock/lvm gname=operator mode=0770 ./var/log ./var/log/rdist ./var/mail mode=1777 Index: src/etc/rc.d/mountcritlocal diff -u src/etc/rc.d/mountcritlocal:1.10 src/etc/rc.d/mountcritlocal:1.11 --- src/etc/rc.d/mountcritlocal:1.10 Tue Apr 21 16:08:57 2009 +++ src/etc/rc.d/mountcritlocal Wed Jan 5 14:57:29 2011 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: mountcritlocal,v 1.10 2009/04/21 16:08:57 joerg Exp $ +# $NetBSD: mountcritlocal,v 1.11 2011/01/05 14:57:29 haad Exp $ # # PROVIDE: mountcritlocal @@ -25,6 +25,12 @@ # rm -f /etc/nologin /var/spool/lock/LCK.* (cd /var/run rm -rf -- *) + # create LVM locking directory, it needs to be owned by operator + # group and has parmissions to allow lock file creation. + # + mkdir /var/run/lvm + chown root:operator /var/run/lvm + chmod 770 /var/run/lvm } load_rc_config $name Index: src/external/gpl2/lvm2/lvm2tools.mk diff -u src/external/gpl2/lvm2/lvm2tools.mk:1.2 src/external/gpl2/lvm2/lvm2tools.mk:1.3 --- src/external/gpl2/lvm2/lvm2tools.mk:1.2 Thu Dec 23 17:46:54 2010 +++ src/external/gpl2/lvm2/lvm2tools.mk Wed Jan 5 14:57:27 2011 @@ -1,4 +1,4 @@ -# $NetBSD: lvm2tools.mk,v 1.2 2010/12/23 17:46:54 christos Exp $ +# $NetBSD: lvm2tools.mk,v 1.3 2011/01/05 14:57:27 haad Exp $ .include bsd.own.mk @@ -10,7 +10,8 @@ LIBDM_INCLUDE= ${NETBSDSRCDIR}/external/gpl2/lvm2/dist/include # root:operator [cb]rw-r- -CPPFLAGS+=-DDM_DEVICE_UID=0 -DDM_DEVICE_GID=5 -DDM_DEVICE_MODE=0640
CVS commit: src
Module Name:src Committed By: haad Date: Sat Jan 1 12:49:49 UTC 2011 Modified Files: src/distrib/sets/lists/base: mi src/etc/mtree: NetBSD.dist.base Log Message: Add /var/lock directory to base set it's used by LVM and other tools. Change group owner to operator to enable LVM locking for him. To generate a diff of this commit: cvs rdiff -u -r1.910 -r1.911 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.68 -r1.69 src/etc/mtree/NetBSD.dist.base Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.910 src/distrib/sets/lists/base/mi:1.911 --- src/distrib/sets/lists/base/mi:1.910 Sun Dec 26 11:31:44 2010 +++ src/distrib/sets/lists/base/mi Sat Jan 1 12:49:49 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.910 2010/12/26 11:31:44 jmcneill Exp $ +# $NetBSD: mi,v 1.911 2011/01/01 12:49:49 haad Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -4836,6 +4836,7 @@ ./var/games/sailbase-games-root ./var/games/savebase-obsolete obsolete ./var/heimdal base-krb5-root +./var/lock base-sys-root ./var/log base-sys-root ./var/log/rdist base-netutil-root ./var/mail base-mail-root Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.68 src/etc/mtree/NetBSD.dist.base:1.69 --- src/etc/mtree/NetBSD.dist.base:1.68 Fri Dec 17 09:54:28 2010 +++ src/etc/mtree/NetBSD.dist.base Sat Jan 1 12:49:48 2011 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.68 2010/12/17 09:54:28 jruoho Exp $ +# $NetBSD: NetBSD.dist.base,v 1.69 2011/01/01 12:49:48 haad Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -1098,6 +1098,7 @@ ./var/games/phantasia uname=games gname=games mode=0775 ./var/games/sail uname=games gname=games mode=0775 ./var/heimdal +./var/lock gname=operator mode=0710 ./var/log ./var/log/rdist ./var/mail mode=1777
CVS commit: src
Module Name:src Committed By: haad Date: Sat Jan 1 13:09:13 UTC 2011 Modified Files: src/distrib/sets/lists/base: mi src/etc/mtree: NetBSD.dist.base Log Message: Add /var/lock/lvm subdir for LVM it can be created automagically but I think that it's better to have it created before. To generate a diff of this commit: cvs rdiff -u -r1.911 -r1.912 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.69 -r1.70 src/etc/mtree/NetBSD.dist.base Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.911 src/distrib/sets/lists/base/mi:1.912 --- src/distrib/sets/lists/base/mi:1.911 Sat Jan 1 12:49:49 2011 +++ src/distrib/sets/lists/base/mi Sat Jan 1 13:09:13 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.911 2011/01/01 12:49:49 haad Exp $ +# $NetBSD: mi,v 1.912 2011/01/01 13:09:13 haad Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -4837,6 +4837,7 @@ ./var/games/savebase-obsolete obsolete ./var/heimdal base-krb5-root ./var/lock base-sys-root +./var/lock/lvm base-sys-root lvm ./var/log base-sys-root ./var/log/rdist base-netutil-root ./var/mail base-mail-root Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.69 src/etc/mtree/NetBSD.dist.base:1.70 --- src/etc/mtree/NetBSD.dist.base:1.69 Sat Jan 1 12:49:48 2011 +++ src/etc/mtree/NetBSD.dist.base Sat Jan 1 13:09:13 2011 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.69 2011/01/01 12:49:48 haad Exp $ +# $NetBSD: NetBSD.dist.base,v 1.70 2011/01/01 13:09:13 haad Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -1099,6 +1099,7 @@ ./var/games/sail uname=games gname=games mode=0775 ./var/heimdal ./var/lock gname=operator mode=0710 +./var/lock/lvm gname=operator mode=0770 optional ./var/log ./var/log/rdist ./var/mail mode=1777
CVS commit: src/etc/mtree
Module Name:src Committed By: haad Date: Sat Jan 1 22:11:45 UTC 2011 Modified Files: src/etc/mtree: NetBSD.dist.base Log Message: Remove optional keyword from directory definition. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/etc/mtree/NetBSD.dist.base Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.70 src/etc/mtree/NetBSD.dist.base:1.71 --- src/etc/mtree/NetBSD.dist.base:1.70 Sat Jan 1 13:09:13 2011 +++ src/etc/mtree/NetBSD.dist.base Sat Jan 1 22:11:45 2011 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.70 2011/01/01 13:09:13 haad Exp $ +# $NetBSD: NetBSD.dist.base,v 1.71 2011/01/01 22:11:45 haad Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -1099,7 +1099,7 @@ ./var/games/sail uname=games gname=games mode=0775 ./var/heimdal ./var/lock gname=operator mode=0710 -./var/lock/lvm gname=operator mode=0770 optional +./var/lock/lvm gname=operator mode=0770 ./var/log ./var/log/rdist ./var/mail mode=1777
CVS commit: src/external/gpl2/lvm2/dist/libdm
Module Name:src Committed By: haad Date: Wed Dec 29 10:39:28 UTC 2010 Modified Files: src/external/gpl2/lvm2/dist/libdm: libdm-common.c Log Message: Fix problem where chown was used on normal device in time when only raw device was created. While here do some cleanup. Problem find and reported by Martin Mersberger on current-us...@. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/dist/libdm/libdm-common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/libdm/libdm-common.c diff -u src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6 src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.7 --- src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6 Sun Dec 26 14:48:34 2010 +++ src/external/gpl2/lvm2/dist/libdm/libdm-common.c Wed Dec 29 10:39:27 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: libdm-common.c,v 1.6 2010/12/26 14:48:34 christos Exp $ */ +/* $NetBSD: libdm-common.c,v 1.7 2010/12/29 10:39:27 haad Exp $ */ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -418,16 +418,16 @@ dev_t dev = MKDEV(major, minor); mode_t old_mask; - #ifdef __NetBSD__ +#ifdef __NetBSD__ char rpath[PATH_MAX]; uint32_t raw_major; dev_t rdev; char raw_devname[DM_NAME_LEN+1]; /* r + other device name */ - nbsd_get_dm_major(raw_major,DM_CHAR_MAJOR); - rdev = MKDEV(raw_major,minor); + nbsd_get_dm_major(raw_major, DM_CHAR_MAJOR); + rdev = MKDEV(raw_major, minor); - snprintf(raw_devname,sizeof(raw_devname),r%s,dev_name); + snprintf(raw_devname, sizeof(raw_devname), r%s, dev_name); _build_dev_path(rpath, sizeof(rpath), raw_devname); @@ -457,8 +457,8 @@ } umask(old_mask); - if (chown(path, uid, gid) 0) { - log_sys_error(chown, rpath); + if (chown(rpath, uid, gid) 0) { + log_sys_error(Raw device chown, rpath); return 0; } #endif
CVS commit: src/external/gpl2/lvm2/dist/lib/device
Module Name:src Committed By: haad Date: Wed Dec 29 23:14:21 UTC 2010 Modified Files: src/external/gpl2/lvm2/dist/lib/device: dev-io.c Log Message: Fix my yesterday fix and finally make _get_dev_size recognise partition size for device without DIOWEDGEINFO, where DIOCGDINFO is used. Patch tested by Martin Mersberger. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/gpl2/lvm2/dist/lib/device/dev-io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.10 --- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9 Wed Dec 29 00:14:04 2010 +++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c Wed Dec 29 23:14:21 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dev-io.c,v 1.9 2010/12/29 00:14:04 haad Exp $ */ +/* $NetBSD: dev-io.c,v 1.10 2010/12/29 23:14:21 haad Exp $ */ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -268,6 +268,7 @@ #ifdef __NetBSD__ struct disklabel lab; struct dkwedge_info dkw; + struct stat stat; #endif if ((fd = open(name, O_RDONLY)) 0) { @@ -285,8 +286,12 @@ DIOCGDINFO for disk device %s, name); close(fd); return 0; - } else - *size = lab.d_nsectors; + } else { + if (fstat(fd, stat) 0) +log_debug(fstat on device %s failure, name); + + *size = lab.d_partitions[DISKPART(stat.st_rdev)].p_size; + } } else *size = dkw.dkw_size; #else
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Tue Dec 28 13:36:09 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzpool: kernel.c src/external/cddl/osnet/sys/sys: zfs_context.h Log Message: Fix problem where vnode vp_size was not updated when vndoe was already allocated, for vdev. This makes ztest survive ztest_vdev_LUN_growth test. Replace dummy VOP_GETATTR with vn_getattr routine which reset vp_size and vattr_size accordingly to reality. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/lib/libzpool/kernel.c cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/sys/sys/zfs_context.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libzpool/kernel.c diff -u src/external/cddl/osnet/lib/libzpool/kernel.c:1.4 src/external/cddl/osnet/lib/libzpool/kernel.c:1.5 --- src/external/cddl/osnet/lib/libzpool/kernel.c:1.4 Sun May 2 23:50:34 2010 +++ src/external/cddl/osnet/lib/libzpool/kernel.c Tue Dec 28 13:36:09 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.c,v 1.4 2010/05/02 23:50:34 haad Exp $ */ +/* $NetBSD: kernel.c,v 1.5 2010/12/28 13:36:09 haad Exp $ */ /* * CDDL HEADER START @@ -29,7 +29,7 @@ #pragma ident %Z%%M% %I% %E% SMI #include sys/cdefs.h -__RCSID($NetBSD: kernel.c,v 1.4 2010/05/02 23:50:34 haad Exp $); +__RCSID($NetBSD: kernel.c,v 1.5 2010/12/28 13:36:09 haad Exp $); #include sys/zfs_context.h #include sys/sysctl.h @@ -213,6 +213,24 @@ return (ret); } +int +vn_getattr(vnode_t *vp, vattr_t *va) +{ + int fd; + struct stat64 st; + + fd = vp-v_fd; + + if (fstat64(fd, st) == -1) + return (errno); + + vp-v_size = st.st_size; + va-va_size = st.st_size; + + return 0; +} + + /*ARGSUSED*/ int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset, Index: src/external/cddl/osnet/sys/sys/zfs_context.h diff -u src/external/cddl/osnet/sys/sys/zfs_context.h:1.7 src/external/cddl/osnet/sys/sys/zfs_context.h:1.8 --- src/external/cddl/osnet/sys/sys/zfs_context.h:1.7 Tue Dec 14 01:23:43 2010 +++ src/external/cddl/osnet/sys/sys/zfs_context.h Tue Dec 28 13:36:09 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zfs_context.h,v 1.7 2010/12/14 01:23:43 haad Exp $ */ +/* $NetBSD: zfs_context.h,v 1.8 2010/12/28 13:36:09 haad Exp $ */ /* * CDDL HEADER START @@ -369,7 +369,7 @@ #define VOP_CLOSE(vp, f, c, o, cr, unk) 0 #define VOP_PUTPAGE(vp, of, sz, fl, cr, unk) 0 -#define VOP_GETATTR(vp, vap, fl, cr, unk) ((vap)-va_size = (vp)-v_size, 0) +#define VOP_GETATTR(vp, vap, fl, cr, unk) vn_getattr(vp, vap) #define VOP_FSYNC(vp, f, cr, unk) fsync((vp)-v_fd) #define VN_RELE(vp) vn_close(vp)
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Tue Dec 28 16:44:45 UTC 2010 Modified Files: src/external/cddl/osnet/sys/sys: zfs_context.h Log Message: Define vn_getattr in zfs_context.h. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/sys/sys/zfs_context.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sys/sys/zfs_context.h diff -u src/external/cddl/osnet/sys/sys/zfs_context.h:1.8 src/external/cddl/osnet/sys/sys/zfs_context.h:1.9 --- src/external/cddl/osnet/sys/sys/zfs_context.h:1.8 Tue Dec 28 13:36:09 2010 +++ src/external/cddl/osnet/sys/sys/zfs_context.h Tue Dec 28 16:44:45 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zfs_context.h,v 1.8 2010/12/28 13:36:09 haad Exp $ */ +/* $NetBSD: zfs_context.h,v 1.9 2010/12/28 16:44:45 haad Exp $ */ /* * CDDL HEADER START @@ -381,6 +381,7 @@ extern int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset, int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp); extern void vn_close(vnode_t *vp); +extern int vn_getattr(vnode_t *vp, vattr_t *va); #define vn_remove(path, x1, x2) remove(path) #define vn_rename(from, to, seg) rename((from), (to))
CVS commit: src/external/gpl2/lvm2/dist/lib/device
Module Name:src Committed By: haad Date: Wed Dec 29 00:14:05 UTC 2010 Modified Files: src/external/gpl2/lvm2/dist/lib/device: dev-io.c Log Message: Fix bug added by my last commit. This should fix PR: bin/44286 Reported by: mlelstv@ and Martin Mersberger. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/lvm2/dist/lib/device/dev-io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9 --- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8 Thu Dec 23 21:39:08 2010 +++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c Wed Dec 29 00:14:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dev-io.c,v 1.8 2010/12/23 21:39:08 haad Exp $ */ +/* $NetBSD: dev-io.c,v 1.9 2010/12/29 00:14:04 haad Exp $ */ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -286,7 +286,7 @@ close(fd); return 0; } else - *size /= lab.d_secsize; + *size = lab.d_nsectors; } else *size = dkw.dkw_size; #else
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: haad Date: Sat Dec 25 23:28:19 UTC 2010 Modified Files: src/distrib/sets/lists/comp: mi Log Message: Fix MKDTRACE MKDEBUG enabled build, add some dtrace entries. To generate a diff of this commit: cvs rdiff -u -r1.1561 -r1.1562 src/distrib/sets/lists/comp/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1561 src/distrib/sets/lists/comp/mi:1.1562 --- src/distrib/sets/lists/comp/mi:1.1561 Wed Dec 22 19:35:41 2010 +++ src/distrib/sets/lists/comp/mi Sat Dec 25 23:28:18 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1561 2010/12/22 19:35:41 jruoho Exp $ +# $NetBSD: mi,v 1.1562 2010/12/25 23:28:18 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -3114,6 +3114,9 @@ ./usr/libdata/debug/usr/bin/crunchide.debug comp-c-debug debug ./usr/libdata/debug/usr/bin/csplit.debug comp-c-debug debug ./usr/libdata/debug/usr/bin/ctags.debug comp-c-debug debug +./usr/libdata/debug/usr/bin/ctfconvert.debug comp-util-debug dtrace,debug +./usr/libdata/debug/usr/bin/ctfdump.debug comp-util-debug dtrace,debug +./usr/libdata/debug/usr/bin/ctfmerge.debug comp-util-debug dtrace,debug ./usr/libdata/debug/usr/bin/cut.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/cvs.debug comp-cvs-debug cvs,debug ./usr/libdata/debug/usr/bin/db.debug comp-util-debug debug @@ -3612,6 +3615,7 @@ ./usr/libdata/debug/usr/sbin/dnssec-settime.debug comp-bind-debug debug ./usr/libdata/debug/usr/sbin/dnssec-signzone.debug comp-bind-debug debug ./usr/libdata/debug/usr/sbin/dtmfdecode.debug comp-isdn-debug debug +./usr/libdata/debug/usr/sbin/dtrace.debug comp-util-debug dtrace,debug ./usr/libdata/debug/usr/sbin/dumpfs.debug comp-sysutil-debug debug ./usr/libdata/debug/usr/sbin/dumplfs.debug comp-sysutil-debug debug ./usr/libdata/debug/usr/sbin/edquota.debug comp-sysutil-debug debug
CVS commit: src/external/cddl/osnet/dist/lib/libzfs/common
Module Name:src Committed By: haad Date: Fri Dec 24 16:13:58 UTC 2010 Modified Files: src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_util.c Log Message: libzfs_fru_clear was not ported to NetBSD disable it foor now. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c diff -u src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c:1.3 src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c:1.4 --- src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c:1.3 Sat Feb 27 23:43:53 2010 +++ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c Fri Dec 24 16:13:58 2010 @@ -615,7 +615,9 @@ if (hdl-libzfs_log_str) (void) free(hdl-libzfs_log_str); zpool_free_handles(hdl); +#ifdef PORT_SOLARIS libzfs_fru_clear(hdl, B_TRUE); +#endif namespace_clear(hdl); libzfs_mnttab_fini(hdl); free(hdl);
CVS commit: src/external/gpl2/lvm2/dist/lib/device
Module Name:src Committed By: haad Date: Thu Dec 23 21:39:09 UTC 2010 Modified Files: src/external/gpl2/lvm2/dist/lib/device: dev-io.c Log Message: Change way how we get device size from device. Do not use LSEEK but DIOCGWEDGEINFO and DIOCGDINFO. This should fix problem with raidframe + lvm reported by Toby Karyadi on current-us...@. Thanks for reporting this issue. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/lvm2/dist/lib/device/dev-io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8 --- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7 Thu Dec 23 14:46:25 2010 +++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c Thu Dec 23 21:39:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dev-io.c,v 1.7 2010/12/23 14:46:25 mlelstv Exp $ */ +/* $NetBSD: dev-io.c,v 1.8 2010/12/23 21:39:08 haad Exp $ */ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -275,26 +275,20 @@ log_sys_error(open, name); #endif return 0; - } - -#ifdef __NetBSD__ - if ((*size = lseek (fd, 0, SEEK_END)) 0) { - log_sys_error(lseek SEEK_END, name); - close(fd); - return 0; } - if (ioctl(fd, DIOCGDINFO, lab) 0) { - if (ioctl(fd, DIOCGWEDGEINFO, dkw) 0) { - log_debug(ioctl DIOCGWEDGEINFO, name); +#ifdef __NetBSD__ +/* Get info about partition/wedge */ + if (ioctl(fd, DIOCGWEDGEINFO, dkw) == -1) { + if (ioctl(fd, DIOCGDINFO, lab) == -1) { + log_debug(Please implement DIOCGWEDGEINFO or + DIOCGDINFO for disk device %s, name); close(fd); return 0; } else - if (dkw.dkw_size) -*size = dkw.dkw_size; - } else - if (lab.d_secsize) *size /= lab.d_secsize; + } else + *size = dkw.dkw_size; #else if (ioctl(fd, BLKGETSIZE64, size) 0) { log_sys_error(ioctl BLKGETSIZE64, name);
CVS commit: src/sys/arch/i386/conf
Module Name:src Committed By: haad Date: Wed Dec 15 08:09:02 UTC 2010 Modified Files: src/sys/arch/i386/conf: MONOLITHIC Log Message: Enable device-mapper driver in MONOLITHIC kernels. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/conf/MONOLITHIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/conf/MONOLITHIC diff -u src/sys/arch/i386/conf/MONOLITHIC:1.12 src/sys/arch/i386/conf/MONOLITHIC:1.13 --- src/sys/arch/i386/conf/MONOLITHIC:1.12 Sun Aug 22 18:56:21 2010 +++ src/sys/arch/i386/conf/MONOLITHIC Wed Dec 15 08:09:02 2010 @@ -1,4 +1,4 @@ -# $NetBSD: MONOLITHIC,v 1.12 2010/08/22 18:56:21 rmind Exp $ +# $NetBSD: MONOLITHIC,v 1.13 2010/12/15 08:09:02 haad Exp $ # # Non MODULAR, used mostly as a reference as to what we modularized. # @@ -64,3 +64,4 @@ pseudo-device pad # pseudo audio device driver +pseudo-device dm # device-mapper device driver
CVS commit: src/tests
Module Name:src Committed By: haad Date: Wed Dec 15 10:36:50 UTC 2010 Modified Files: src/tests: Makefile Added Files: src/tests/usr.sbin: Makefile Log Message: Hook traceroute test case to build. it was added to lists so unbreak build now. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/tests/Makefile cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/Makefile diff -u src/tests/Makefile:1.25 src/tests/Makefile:1.26 --- src/tests/Makefile:1.25 Wed Dec 8 23:56:02 2010 +++ src/tests/Makefile Wed Dec 15 10:36:50 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.25 2010/12/08 23:56:02 njoly Exp $ +# $NetBSD: Makefile,v 1.26 2010/12/15 10:36:50 haad Exp $ .include bsd.own.mk @@ -8,7 +8,7 @@ ATFFILE= yes SUBDIR= crypto dev fs games include ipf kernel lib libexec net -SUBDIR+= rump sbin sys syscall util +SUBDIR+= rump sbin sys syscall util usr.sbin . if ${MACHINE} != evbppc ${MKKMOD} != no SUBDIR+= modules Added files: Index: src/tests/usr.sbin/Makefile diff -u /dev/null src/tests/usr.sbin/Makefile:1.1 --- /dev/null Wed Dec 15 10:36:50 2010 +++ src/tests/usr.sbin/Makefile Wed Dec 15 10:36:49 2010 @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2010/12/15 10:36:49 haad Exp $ +.include bsd.own.mk + +TESTSDIR= ${TESTSBASE}/usr.sbin + +TESTS_SUBDIRS+= traceroute + +.include bsd.test.mk
CVS commit: src/distrib/sets/lists/tests
Module Name:src Committed By: haad Date: Wed Dec 15 10:42:57 UTC 2010 Modified Files: src/distrib/sets/lists/tests: mi Log Message: Add usr.sbin/Attfile to test list. To generate a diff of this commit: cvs rdiff -u -r1.177 -r1.178 src/distrib/sets/lists/tests/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.177 src/distrib/sets/lists/tests/mi:1.178 --- src/distrib/sets/lists/tests/mi:1.177 Wed Dec 15 00:17:34 2010 +++ src/distrib/sets/lists/tests/mi Wed Dec 15 10:42:56 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.177 2010/12/15 00:17:34 pooka Exp $ +# $NetBSD: mi,v 1.178 2010/12/15 10:42:56 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -1687,6 +1687,7 @@ ./usr/tests/syscall/t_cmsg tests-syscall-tests atf ./usr/tests/syscall/t_timer tests-syscall-tests atf ./usr/tests/usr.sbintests-util-tests +./usr/tests/usr.sbin/Atffile tests-sbin-tests atf ./usr/tests/usr.sbin/traceroute tests-util-tests ./usr/tests/usr.sbin/traceroute/Atffile tests-util-tests atf ./usr/tests/usr.sbin/traceroute/t_traceroute tests-util-tests atf
CVS commit: src/external/cddl/osnet/dist/lib/libzpool/common
Module Name:src Committed By: haad Date: Wed Dec 15 22:09:14 UTC 2010 Modified Files: src/external/cddl/osnet/dist/lib/libzpool/common: taskq.c Log Message: Only KM_SLEEP | KM_NOSLEEP can be passed down to kmem layer, clean up tqflags from internal taskq flags (TQ_FRONT) before calling kmem_alloc. To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c diff -u src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c:1.1.1.2 src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c:1.2 --- src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c:1.1.1.2 Sat Feb 27 22:30:30 2010 +++ src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c Wed Dec 15 22:09:14 2010 @@ -76,7 +76,10 @@ */ delay(hz); } - t = kmem_alloc(sizeof (task_t), tqflags); + + /* Clean up TQ_FRONT from tqflags before passing it to kmem */ + t = kmem_alloc(sizeof (task_t), + tqflags (KM_SLEEP | KM_NOSLEEP)); mutex_enter(tq-tq_lock); if (t != NULL) tq-tq_nalloc++;
CVS commit: src/external/cddl/osnet/dist/lib/libzpool/common
Module Name:src Committed By: haad Date: Wed Dec 15 22:49:42 UTC 2010 Modified Files: src/external/cddl/osnet/dist/lib/libzpool/common: taskq.c Log Message: Whitespace police. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c diff -u src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c:1.2 src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c:1.3 --- src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c:1.2 Wed Dec 15 22:09:14 2010 +++ src/external/cddl/osnet/dist/lib/libzpool/common/taskq.c Wed Dec 15 22:49:42 2010 @@ -76,7 +76,7 @@ */ delay(hz); } - + /* Clean up TQ_FRONT from tqflags before passing it to kmem */ t = kmem_alloc(sizeof (task_t), tqflags (KM_SLEEP | KM_NOSLEEP));
CVS commit: src/external/cddl/osnet/lib/libzpool
Module Name:src Committed By: haad Date: Tue Dec 14 09:19:15 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzpool: Makefile Log Message: Use only cas versions of 64 bit atomic ops. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/lib/libzpool/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libzpool/Makefile diff -u src/external/cddl/osnet/lib/libzpool/Makefile:1.4 src/external/cddl/osnet/lib/libzpool/Makefile:1.5 --- src/external/cddl/osnet/lib/libzpool/Makefile:1.4 Sun Feb 21 01:46:35 2010 +++ src/external/cddl/osnet/lib/libzpool/Makefile Tue Dec 14 09:19:14 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2010/02/21 01:46:35 darran Exp $ +# $NetBSD: Makefile,v 1.5 2010/12/14 09:19:14 haad Exp $ .include ${.CURDIR}/../../dist/uts/common/Makefile.files .include ../../Makefile.zfs @@ -13,6 +13,7 @@ DPADD= ${LIBPTHREAD} ${LIBZ} LDADD= -lpthread -lz CPPFLAGS+= -std=c99 +#CPPFLAGS+=-Wall -Wno-unknown-pragmas # Local stuff SRCS= kernel.c kernel2.c @@ -26,7 +27,7 @@ .if ${MACHINE_ARCH} == i386 CPPFLAGS+= -D__HAVE_ATOMIC64_OPS # add NetBSD 64 add operations on i386 .PATH: ${NETBSDSRCDIR}/common/lib/libc/atomic -SRCS+= atomic_add_64_cas.c atomic_add_64_nv_cas.c atomic_inc_64_add.c atomic_dec_64_add.c +SRCS+= atomic_add_64_cas.c atomic_add_64_nv_cas.c atomic_inc_64_cas.c atomic_dec_64_cas.c .endif print:
CVS commit: src/sys/arch/i386/include
Module Name:src Committed By: haad Date: Tue Dec 14 15:50:07 UTC 2010 Modified Files: src/sys/arch/i386/include: types.h Log Message: Revert change made in revision 1.66 by ad@ this is not true and 64bit atomic ops should be enabled in libc by default. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/arch/i386/include/types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/include/types.h diff -u src/sys/arch/i386/include/types.h:1.68 src/sys/arch/i386/include/types.h:1.69 --- src/sys/arch/i386/include/types.h:1.68 Tue Sep 21 00:18:05 2010 +++ src/sys/arch/i386/include/types.h Tue Dec 14 15:50:07 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.68 2010/09/21 00:18:05 jym Exp $ */ +/* $NetBSD: types.h,v 1.69 2010/12/14 15:50:07 haad Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -107,12 +107,12 @@ #define __HAVE_SYSCALL_INTERN #define __HAVE_MINIMAL_EMUL #define __HAVE_OLD_DISKLABEL +#define __HAVE_ATOMIC64_OPS #define __HAVE_ATOMIC_AS_MEMBAR #define __HAVE_CPU_LWP_SETPRIVATE #define __HAVE_INTR_CONTROL #if defined(_KERNEL) -#define __HAVE_ATOMIC64_OPS /* not true for i486 in userspace */ #define __HAVE_RAS #endif
CVS commit: src/sys/modules/dtrace
Module Name:src Committed By: haad Date: Tue Dec 14 23:27:48 UTC 2010 Modified Files: src/sys/modules/dtrace/dtrace: Makefile src/sys/modules/dtrace/fbt: Makefile src/sys/modules/dtrace/sdt: Makefile Log Message: Disable errors reported by unknown pragmas in dtrace module. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/modules/dtrace/dtrace/Makefile cvs rdiff -u -r1.2 -r1.3 src/sys/modules/dtrace/fbt/Makefile cvs rdiff -u -r1.3 -r1.4 src/sys/modules/dtrace/sdt/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/dtrace/dtrace/Makefile diff -u src/sys/modules/dtrace/dtrace/Makefile:1.2 src/sys/modules/dtrace/dtrace/Makefile:1.3 --- src/sys/modules/dtrace/dtrace/Makefile:1.2 Sat Mar 13 22:23:47 2010 +++ src/sys/modules/dtrace/dtrace/Makefile Tue Dec 14 23:27:47 2010 @@ -27,6 +27,8 @@ CPPFLAGS+= -DSMP -DDEBUG +CPPFLAGS+= -Wno-unknown-pragmas + EXPORT_SYMS= dtrace_register \ dtrace_unregister \ dtrace_probe_lookup Index: src/sys/modules/dtrace/fbt/Makefile diff -u src/sys/modules/dtrace/fbt/Makefile:1.2 src/sys/modules/dtrace/fbt/Makefile:1.3 --- src/sys/modules/dtrace/fbt/Makefile:1.2 Sat Mar 13 22:29:33 2010 +++ src/sys/modules/dtrace/fbt/Makefile Tue Dec 14 23:27:48 2010 @@ -11,4 +11,6 @@ -I${NETBSDSRCDIR}/external/cddl/osnet/dev/sdt \ -I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common +CPPFLAGS+= -Wno-unknown-pragmas + .include bsd.kmodule.mk Index: src/sys/modules/dtrace/sdt/Makefile diff -u src/sys/modules/dtrace/sdt/Makefile:1.3 src/sys/modules/dtrace/sdt/Makefile:1.4 --- src/sys/modules/dtrace/sdt/Makefile:1.3 Sat Mar 13 22:29:34 2010 +++ src/sys/modules/dtrace/sdt/Makefile Tue Dec 14 23:27:48 2010 @@ -11,4 +11,6 @@ -I${NETBSDSRCDIR}/external/cddl/osnet/dev/sdt \ -I${NETBSDSRCDIR}/external/cddl/osnet/dist/uts/common +CPPFLAGS+= -Wno-unknown-pragmas + .include bsd.kmodule.mk
CVS commit: src/external/cddl/osnet/lib/libzpool
Module Name:src Committed By: haad Date: Tue Dec 14 23:39:11 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzpool: Makefile Log Message: Do not built 64b atomic ops to libzpool they are in libc again. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/lib/libzpool/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libzpool/Makefile diff -u src/external/cddl/osnet/lib/libzpool/Makefile:1.5 src/external/cddl/osnet/lib/libzpool/Makefile:1.6 --- src/external/cddl/osnet/lib/libzpool/Makefile:1.5 Tue Dec 14 09:19:14 2010 +++ src/external/cddl/osnet/lib/libzpool/Makefile Tue Dec 14 23:39:11 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2010/12/14 09:19:14 haad Exp $ +# $NetBSD: Makefile,v 1.6 2010/12/14 23:39:11 haad Exp $ .include ${.CURDIR}/../../dist/uts/common/Makefile.files .include ../../Makefile.zfs @@ -23,13 +23,6 @@ SRCS+= ${ZFS_SHARED_OBJS:C/.o$/.c/} SRCS+= taskq.c util.c list.o u8_textprep.o -# Add opensolaris atomic functions and use fakedones if we do not support them -.if ${MACHINE_ARCH} == i386 -CPPFLAGS+= -D__HAVE_ATOMIC64_OPS # add NetBSD 64 add operations on i386 -.PATH: ${NETBSDSRCDIR}/common/lib/libc/atomic -SRCS+= atomic_add_64_cas.c atomic_add_64_nv_cas.c atomic_inc_64_cas.c atomic_dec_64_cas.c -.endif - print: echo ${LIST_SRCS} ${LIST_OBJS}
CVS commit: src/external/cddl/osnet/dist/uts/common/sys
Module Name:src Committed By: haad Date: Wed Dec 15 00:58:58 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/sys: note.h Log Message: Revert last commit it's not needed anymore. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/dist/uts/common/sys/note.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/sys/note.h diff -u src/external/cddl/osnet/dist/uts/common/sys/note.h:1.2 src/external/cddl/osnet/dist/uts/common/sys/note.h:1.3 --- src/external/cddl/osnet/dist/uts/common/sys/note.h:1.2 Tue Dec 14 14:08:42 2010 +++ src/external/cddl/osnet/dist/uts/common/sys/note.h Wed Dec 15 00:58:58 2010 @@ -39,7 +39,7 @@ #ifndef _SYS_NOTE_H #define _SYS_NOTE_H -/* #pragma ident %Z%%M% %I% %E% SMI */ +#pragma ident %Z%%M% %I% %E% SMI #ifdef __cplusplus extern C {
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Tue Dec 14 01:00:26 UTC 2010 Modified Files: src/external/cddl/osnet/sys/sys: mnttab.h Log Message: NetBSD doesn't have /etc/mnttab replace it with /dev/null. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/sys/mnttab.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sys/sys/mnttab.h diff -u src/external/cddl/osnet/sys/sys/mnttab.h:1.3 src/external/cddl/osnet/sys/sys/mnttab.h:1.4 --- src/external/cddl/osnet/sys/sys/mnttab.h:1.3 Sun Feb 21 01:46:36 2010 +++ src/external/cddl/osnet/sys/sys/mnttab.h Tue Dec 14 01:00:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mnttab.h,v 1.3 2010/02/21 01:46:36 darran Exp $ */ +/* $NetBSD: mnttab.h,v 1.4 2010/12/14 01:00:26 haad Exp $ */ /* * CDDL HEADER START @@ -42,7 +42,7 @@ extern C { #endif -#define MNTTAB /etc/mnttab +#define MNTTAB /dev/null #define MNT_LINE_MAX 1024 #define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */
CVS commit: src/external/cddl/osnet/sys
Module Name:src Committed By: haad Date: Tue Dec 14 01:01:41 UTC 2010 Modified Files: src/external/cddl/osnet/sys/kern: string.c src/external/cddl/osnet/sys/sys: string.h Log Message: Simple routine to convert long to string. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/sys/kern/string.c cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/sys/string.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sys/kern/string.c diff -u src/external/cddl/osnet/sys/kern/string.c:1.1 src/external/cddl/osnet/sys/kern/string.c:1.2 --- src/external/cddl/osnet/sys/kern/string.c:1.1 Fri Aug 7 20:57:57 2009 +++ src/external/cddl/osnet/sys/kern/string.c Tue Dec 14 01:01:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: string.c,v 1.1 2009/08/07 20:57:57 haad Exp $ */ +/* $NetBSD: string.c,v 1.2 2010/12/14 01:01:40 haad Exp $ */ /* * CDDL HEADER START @@ -71,3 +71,25 @@ } *s = 0; } + +/* + * Simple-minded conversion of a long into a null-terminated character + * string. Caller must ensure there's enough space to hold the result. + */ +void +numtos(unsigned long num, char *s) +{ + char prbuf[40]; + + char *cp = prbuf; + + do { + *cp++ = 0123456789[num % 10]; + num /= 10; + } while (num); + + do { + *s++ = *--cp; + } while (cp prbuf); + *s = '\0'; +} Index: src/external/cddl/osnet/sys/sys/string.h diff -u src/external/cddl/osnet/sys/sys/string.h:1.3 src/external/cddl/osnet/sys/sys/string.h:1.4 --- src/external/cddl/osnet/sys/sys/string.h:1.3 Sun Feb 21 01:46:36 2010 +++ src/external/cddl/osnet/sys/sys/string.h Tue Dec 14 01:01:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: string.h,v 1.3 2010/02/21 01:46:36 darran Exp $ */ +/* $NetBSD: string.h,v 1.4 2010/12/14 01:01:41 haad Exp $ */ /*- * Copyright (c) 2007 Pawel Jakub Dawidek p...@freebsd.org @@ -33,5 +33,6 @@ char *strpbrk(const char *, const char *); void strident_canon(char *s, size_t n); +void numtos(unsigned long num, char *s); #endif /* _OPENSOLARIS_SYS_STRING_H_ */
CVS commit: src/external/cddl/osnet/sbin/zpool
Module Name:src Committed By: haad Date: Tue Dec 14 01:03:10 UTC 2010 Modified Files: src/external/cddl/osnet/sbin/zpool: Makefile Log Message: Define print_timestamp during build, to shut up gcc warning. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sbin/zpool/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sbin/zpool/Makefile diff -u src/external/cddl/osnet/sbin/zpool/Makefile:1.3 src/external/cddl/osnet/sbin/zpool/Makefile:1.4 --- src/external/cddl/osnet/sbin/zpool/Makefile:1.3 Sun Feb 28 14:45:47 2010 +++ src/external/cddl/osnet/sbin/zpool/Makefile Tue Dec 14 01:03:10 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2010/02/28 14:45:47 haad Exp $ +# $NetBSD: Makefile,v 1.4 2010/12/14 01:03:10 haad Exp $ .include ../../Makefile.zfs @@ -7,6 +7,8 @@ USETBL= yes SRCS= zpool_main.c zpool_iter.c zpool_util.c zpool_vdev.c +CFLAGS+=-Dprint_timestamp(a)=((void)0) + DPADD= ${LIBAVL} ${LIBZFS} ${LIBM} ${LIBNVPAIR} ${LIBUUTIL} ${LIBUTIL} ${LIBUMEM} LIBAVL_OBJDIR!= cd ${LIBAVL_SRCDIR} ${PRINTOBJDIR}
CVS commit: src/external/cddl/osnet/sys/kern
Module Name:src Committed By: haad Date: Tue Dec 14 01:18:34 UTC 2010 Modified Files: src/external/cddl/osnet/sys/kern: ddi.c Log Message: Include sys/debug.h to get ASSERT defined. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/kern/ddi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sys/kern/ddi.c diff -u src/external/cddl/osnet/sys/kern/ddi.c:1.3 src/external/cddl/osnet/sys/kern/ddi.c:1.4 --- src/external/cddl/osnet/sys/kern/ddi.c:1.3 Sun Feb 28 14:45:47 2010 +++ src/external/cddl/osnet/sys/kern/ddi.c Tue Dec 14 01:18:34 2010 @@ -32,6 +32,7 @@ #include sys/types.h #include sys/ddi.h +#include sys/debug.h #include sys/errno.h #include sys/param.h #include sys/kernel.h
CVS commit: src/external/cddl/osnet/dist/lib/libzfs/common
Module Name:src Committed By: haad Date: Tue Dec 14 01:22:24 UTC 2010 Modified Files: src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_mount.c Log Message: Fix amd64 build where sysinfo was not defined, disable libshare for now. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c diff -u src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c:1.3 src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c:1.4 --- src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c:1.3 Sat Feb 27 23:43:52 2010 +++ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c Tue Dec 14 01:22:24 2010 @@ -168,7 +168,7 @@ /* the mountpoint is the first entry on each line */ if ((tab = strchr(buf, '\t')) == NULL) continue; - +#if defined(sun) *tab = '\0'; if (strcmp(buf, mountpoint) == 0) { /* @@ -194,6 +194,11 @@ } } } +#else + if (proto == PROTO_NFS) +return (SHARED_NFS); +#endif + } return (SHARED_NOT_SHARED); @@ -515,7 +520,7 @@ * wrapper functions that check to see that the pointers to functions * initialized in _zfs_init_libshare() are actually present. */ - +#ifdef PORT_SOLARIS static sa_handle_t (*_sa_init)(int); static void (*_sa_fini)(sa_handle_t); static sa_share_t (*_sa_find_share)(sa_handle_t, char *); @@ -528,7 +533,7 @@ static int (*_sa_zfs_process_share)(sa_handle_t, sa_group_t, sa_share_t, char *, char *, zprop_source_t, char *, char *, char *); static void (*_sa_update_sharetab_ts)(sa_handle_t); - +#endif /* * _zfs_init_libshare() * @@ -541,6 +546,7 @@ static void _zfs_init_libshare(void) { +#ifdef PORT_SOLARIS void *libshare; char path[MAXPATHLEN]; char isa[MAXISALEN]; @@ -595,6 +601,7 @@ _sa_update_sharetab_ts = NULL; } } +#endif } /* @@ -609,7 +616,7 @@ zfs_init_libshare(libzfs_handle_t *zhandle, int service) { int ret = SA_OK; - +#ifdef PORT_SOLARIS if (_sa_init == NULL) ret = SA_CONFIG_ERR; @@ -635,7 +642,7 @@ if (ret == SA_OK zhandle-libzfs_sharehdl == NULL) ret = SA_NO_MEMORY; - +#endif return (ret); } @@ -649,8 +656,10 @@ zfs_uninit_libshare(libzfs_handle_t *zhandle) { if (zhandle != NULL zhandle-libzfs_sharehdl != NULL) { +#ifdef PORT_SOLARIS if (_sa_fini != NULL) _sa_fini(zhandle-libzfs_sharehdl); +#endif zhandle-libzfs_sharehdl = NULL; } } @@ -664,13 +673,18 @@ int zfs_parse_options(char *options, zfs_share_proto_t proto) { +#ifdef PORT_SOLARIS if (_sa_parse_legacy_options != NULL) { return (_sa_parse_legacy_options(NULL, options, proto_table[proto].p_name)); } return (SA_CONFIG_ERR); +#else + return (SA_OK); +#endif } +#ifdef PORT_SOLARIS /* * zfs_sa_find_share(handle, path) * @@ -712,7 +726,7 @@ return (_sa_disable_share(share, proto)); return (SA_CONFIG_ERR); } - +#endif /* * Share the given filesystem according to the options in the specified * protocol specific properties (sharenfs, sharesmb). We rely @@ -728,11 +742,11 @@ sa_share_t share; zfs_share_proto_t *curr_proto; zprop_source_t sourcetype; - int ret; + int error, ret; if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) return (0); - +#ifdef PORT_SOLARIS if ((ret = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { (void) zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, dgettext(TEXT_DOMAIN, cannot share '%s': %s), @@ -740,7 +754,7 @@ _sa_errorstr(ret) : ); return (-1); } - +#endif for (curr_proto = proto; *curr_proto != PROTO_END; curr_proto++) { /* * Return success if there are no share options. @@ -760,6 +774,7 @@ if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED)) continue; +#ifdef PORT_SOLARIS share = zfs_sa_find_share(hdl-libzfs_sharehdl, mountpoint); if (share == NULL) { /* @@ -803,7 +818,7 @@ zfs_get_name(zhp)); return (-1); } - +#endif } return (0); } @@ -834,6 +849,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint, zfs_share_proto_t proto) { +#ifdef PORT_SOLARIS sa_share_t share; int err; char *mntpt; @@ -867,6 +883,7 @@ dgettext(TEXT_DOMAIN, cannot unshare '%s': not found), name)); } +#endif return (0); } @@ -1027,7 +1044,7 @@ sizeof (shareopts), NULL, NULL, 0, B_FALSE) != 0 || strcmp(shareopts, off) == 0) return (0); - +#ifdef PORT_ISCSI /* NetBSD do not support zfssharing with iscsi, yet */ if (iscsitgt_zfs_share == NULL || iscsitgt_zfs_share(dataset) != 0) { int error = EZFS_SHAREISCSIFAILED; @@ -1042,7 +1059,7 @@ return (zfs_error_fmt(hdl, error, dgettext(TEXT_DOMAIN, cannot share '%s'), dataset)); } - +#endif return (0); } @@ -1052,6 +1069,7 @@
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Tue Dec 14 01:23:44 UTC 2010 Modified Files: src/external/cddl/osnet/sys/sys: zfs_context.h Log Message: Remove now unneeded print_timestamp. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/cddl/osnet/sys/sys/zfs_context.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/sys/sys/zfs_context.h diff -u src/external/cddl/osnet/sys/sys/zfs_context.h:1.6 src/external/cddl/osnet/sys/sys/zfs_context.h:1.7 --- src/external/cddl/osnet/sys/sys/zfs_context.h:1.6 Sun Feb 28 14:45:47 2010 +++ src/external/cddl/osnet/sys/sys/zfs_context.h Tue Dec 14 01:23:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zfs_context.h,v 1.6 2010/02/28 14:45:47 haad Exp $ */ +/* $NetBSD: zfs_context.h,v 1.7 2010/12/14 01:23:43 haad Exp $ */ /* * CDDL HEADER START @@ -570,10 +570,6 @@ extern char *kmem_asprintf(const char *fmt, ...); #define strfree(str) kmem_free((str), strlen(str)+1) -//#define print_timestamp(a) 0 - -extern void print_timestamp(int); - #define DEV_PHYS_PATH phys_path #define DDI_SLEEP KM_SLEEP
CVS commit: src/external/cddl/osnet/lib/libumem
Module Name:src Committed By: haad Date: Tue Dec 14 01:25:37 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libumem: stub_stand.c Log Message: Define mutex_owned. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libumem/stub_stand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libumem/stub_stand.c diff -u src/external/cddl/osnet/lib/libumem/stub_stand.c:1.1 src/external/cddl/osnet/lib/libumem/stub_stand.c:1.2 --- src/external/cddl/osnet/lib/libumem/stub_stand.c:1.1 Sun Feb 28 22:45:45 2010 +++ src/external/cddl/osnet/lib/libumem/stub_stand.c Tue Dec 14 01:25:37 2010 @@ -55,6 +55,12 @@ return (1); } +int +mutex_owned(mutex_t *mp) +{ + return (1); +} + /*ARGSUSED*/ int mutex_lock(mutex_t *mp)
CVS commit: src/external/cddl/osnet/dist/uts/common/fs
Module Name:src Committed By: haad Date: Tue Dec 14 01:28:18 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs: gfs.c src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ctldir.c Log Message: Add NetBSD version of zfs snapshot management code. IT needs testing it was only compile tested for now, but I would like to have some code in to be sure that it will not be lost. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/cddl/osnet/dist/uts/common/fs/gfs.c cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/gfs.c diff -u src/external/cddl/osnet/dist/uts/common/fs/gfs.c:1.1.1.1 src/external/cddl/osnet/dist/uts/common/fs/gfs.c:1.2 --- src/external/cddl/osnet/dist/uts/common/fs/gfs.c:1.1.1.1 Fri Aug 7 18:32:48 2009 +++ src/external/cddl/osnet/dist/uts/common/fs/gfs.c Tue Dec 14 01:28:18 2010 @@ -121,6 +121,7 @@ * both the caller and the vnode type provider need to access gfsv_ops * and gfsv_template, and the caller also needs to know gfsv_name. */ +#ifdef PORT_SOLARIS int gfs_make_opsvec(gfs_opsvec_t *vec) { @@ -143,6 +144,7 @@ } return (error); } +#endif /* * Low level directory routines @@ -257,15 +259,17 @@ static int gfs_readdir_emit_int(gfs_readdir_state_t *st, uio_t *uiop, offset_t next) { - int reclen; + int reclen, namelen; dirent64_t *dp; edirent_t *edp; if (st-grd_flags V_RDDIR_ENTFLAGS) { edp = st-grd_dirent; + namelen = strlen(edp-ed_name); reclen = EDIRENT_RECLEN(strlen(edp-ed_name)); } else { dp = st-grd_dirent; + namelen = strlen(dp-d_name); reclen = DIRENT64_RECLEN(strlen(dp-d_name)); } @@ -282,8 +286,9 @@ edp-ed_off = next; edp-ed_reclen = (ushort_t)reclen; } else { - dp-d_off = next; dp-d_reclen = (ushort_t)reclen; + dp-d_type = DT_DIR; + dp-d_namlen = namelen; } if (uiomove((caddr_t)st-grd_dirent, reclen, UIO_READ, uiop)) @@ -458,12 +463,17 @@ { gfs_file_t *fp; vnode_t *vp; + int error; /* * Allocate vnode and internal data structure */ fp = kmem_zalloc(size, KM_SLEEP); - vp = vn_alloc(KM_SLEEP); + /* XXX FreeBSD adds vfs_t * as parameter to gfs_file_create and + gfs_dir_create */ + error = getnewvnode(VT_ZFS, pvp-v_vfsp, ops, vp); + ASSERT(error == 0); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* * Set up various pointers @@ -639,6 +649,7 @@ mutex_enter(fp-gfs_parent-v_lock); } mutex_enter(vp-v_lock); +#ifdef PORT_SOLARIS if (vp-v_count == 1) { /* * Really remove this vnode @@ -680,6 +691,7 @@ if (dp) gfs_dir_unlock(dp); } +#endif return (data); } @@ -1093,6 +1105,7 @@ * putpage() routines. */ /* ARGSUSED */ +#ifdef PORT_SOLARIS int gfs_vop_map(vnode_t *vp, offset_t off, struct as *as, caddr_t *addrp, size_t len, uchar_t prot, uchar_t maxprot, uint_t flags, cred_t *cred, @@ -1154,7 +1167,7 @@ return (rv); } - +#endif /* * gfs_vop_inactive: VOP_INACTIVE() entry point * Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.1.1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.2 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c:1.1.1.2 Sat Feb 27 22:31:19 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c Tue Dec 14 01:28:18 2010 @@ -111,16 +111,13 @@ return (0); } -vnodeops_t *zfsctl_ops_root; -vnodeops_t *zfsctl_ops_snapdir; -vnodeops_t *zfsctl_ops_snapshot; -vnodeops_t *zfsctl_ops_shares; -vnodeops_t *zfsctl_ops_shares_dir; - -static const fs_operation_def_t zfsctl_tops_root[]; -static const fs_operation_def_t zfsctl_tops_snapdir[]; -static const fs_operation_def_t zfsctl_tops_snapshot[]; -static const fs_operation_def_t zfsctl_tops_shares[]; +//vnodeops_t *zfsctl_ops_shares_dir; + +static struct vnodeopv_entry_desc zfsctl_ops_root; +static struct vnodeopv_entry_desc zfsctl_ops_snapdir; +static struct vnodeopv_entry_desc zfsctl_ops_snapshot; +static struct vnodeopv_entry_desc zfsctl_ops_shares; + static vnode_t *zfsctl_mknode_snapdir(vnode_t *); static vnode_t *zfsctl_mknode_shares(vnode_t *); @@ -159,31 +156,11 @@ void zfsctl_init(void) { - VERIFY(gfs_make_opsvec(zfsctl_opsvec) == 0); } void zfsctl_fini(void) { - /* - * Remove vfsctl vnode ops - */ - if (zfsctl_ops_root) - vn_freevnodeops(zfsctl_ops_root); - if (zfsctl_ops_snapdir) - vn_freevnodeops(zfsctl_ops_snapdir); - if (zfsctl_ops_snapshot) - vn_freevnodeops(zfsctl_ops_snapshot); - if (zfsctl_ops_shares) - vn_freevnodeops(zfsctl_ops_shares); - if (zfsctl_ops_shares_dir) - vn_freevnodeops(zfsctl_ops_shares_dir); - - zfsctl_ops_root = NULL; - zfsctl_ops_snapdir = NULL; - zfsctl_ops_snapshot = NULL; - zfsctl_ops_shares = NULL; -
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Mon Dec 6 08:54:49 UTC 2010 Modified Files: src/sys/dev/dm: dm.h dm_ioctl.c Log Message: Add comment about dm_dev minor, and change it to 32bit value we realy not going to use so much device minor numbers. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/dm/dm.h cvs rdiff -u -r1.22 -r1.23 src/sys/dev/dm/dm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm.h diff -u src/sys/dev/dm/dm.h:1.19 src/sys/dev/dm/dm.h:1.20 --- src/sys/dev/dm/dm.h:1.19 Sat Oct 23 21:18:54 2010 +++ src/sys/dev/dm/dm.h Mon Dec 6 08:54:49 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm.h,v 1.19 2010/10/23 21:18:54 haad Exp $ */ +/*$NetBSD: dm.h,v 1.20 2010/12/06 08:54:49 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -124,7 +124,7 @@ char uuid[DM_UUID_LEN]; device_t devt; /* pointer to autoconf device_t structure */ - uint64_t minor; + uint64_t minor; /* Device minor number */ uint32_t flags; /* store communication protocol flags */ kmutex_t dev_mtx; /* mutex for generall device lock */ Index: src/sys/dev/dm/dm_ioctl.c diff -u src/sys/dev/dm/dm_ioctl.c:1.22 src/sys/dev/dm/dm_ioctl.c:1.23 --- src/sys/dev/dm/dm_ioctl.c:1.22 Tue May 18 15:01:17 2010 +++ src/sys/dev/dm/dm_ioctl.c Mon Dec 6 08:54:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dm_ioctl.c,v 1.22 2010/05/18 15:01:17 haad Exp $ */ +/* $NetBSD: dm_ioctl.c,v 1.23 2010/12/06 08:54:49 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -93,7 +93,7 @@ #include netbsd-dm.h #include dm.h -static uint64_t sc_minor_num; +static uint32_t sc_minor_num; extern const struct dkdriver dmdkdriver; uint64_t dm_dev_counter; @@ -236,7 +236,7 @@ if (name) strlcpy(dmv-name, name, DM_NAME_LEN); - dmv-minor = atomic_inc_64_nv(sc_minor_num); + dmv-minor = (uint64_t)atomic_inc_32_nv(sc_minor_num); dmv-flags = 0; /* device flags are set when needed */ dmv-ref_cnt = 0; dmv-event_nr = 0;
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Mon Dec 6 09:03:41 UTC 2010 Modified Files: src/sys/dev/dm: dm_ioctl.c Log Message: We don't need 64 bit variable for dm_device coutner, too. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/dev/dm/dm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_ioctl.c diff -u src/sys/dev/dm/dm_ioctl.c:1.23 src/sys/dev/dm/dm_ioctl.c:1.24 --- src/sys/dev/dm/dm_ioctl.c:1.23 Mon Dec 6 08:54:49 2010 +++ src/sys/dev/dm/dm_ioctl.c Mon Dec 6 09:03:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dm_ioctl.c,v 1.23 2010/12/06 08:54:49 haad Exp $ */ +/* $NetBSD: dm_ioctl.c,v 1.24 2010/12/06 09:03:40 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ static uint32_t sc_minor_num; extern const struct dkdriver dmdkdriver; -uint64_t dm_dev_counter; +uint32_t dm_dev_counter; /* Generic cf_data for device-mapper driver */ static struct cfdata dm_cfdata = { @@ -266,7 +266,7 @@ DM_REMOVE_FLAG(flags, DM_INACTIVE_PRESENT_FLAG); /* Increment device counter After creating device */ - atomic_inc_64(dm_dev_counter); + atomic_inc_32(dm_dev_counter); return r; }
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Mon Dec 6 09:12:23 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c Log Message: I have forgot to fix dm_dev_counter here, too. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/dm/device-mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.25 src/sys/dev/dm/device-mapper.c:1.26 --- src/sys/dev/dm/device-mapper.c:1.25 Sat Oct 23 21:18:54 2010 +++ src/sys/dev/dm/device-mapper.c Mon Dec 6 09:12:23 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.25 2010/10/23 21:18:54 haad Exp $ */ +/*$NetBSD: device-mapper.c,v 1.26 2010/12/06 09:12:23 haad Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -110,7 +110,7 @@ extern struct cfdriver dm_cd; -extern uint64_t dm_dev_counter; +extern uint32_t dm_dev_counter; /* * This array is used to translate cmd to function pointer. @@ -277,7 +277,7 @@ (void)dm_dev_free(dmv); /* Decrement device counter After removing device */ - atomic_dec_64(dm_dev_counter); + atomic_dec_32(dm_dev_counter); return 0; }
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Tue Nov 30 00:14:42 UTC 2010 Modified Files: src/external/cddl/osnet: TODO Log Message: Update TODO for zfs add new tasks, list some know issues and mark some done stuff. iRequested by: agc@ To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/TODO Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/TODO diff -u src/external/cddl/osnet/TODO:1.2 src/external/cddl/osnet/TODO:1.3 --- src/external/cddl/osnet/TODO:1.2 Tue Oct 6 08:47:59 2009 +++ src/external/cddl/osnet/TODO Tue Nov 30 00:14:42 2010 @@ -56,12 +56,53 @@ - device properties for unique device id (driver:model-revision-serial-etc). - use device id to locate disks/partitions -- port ZFS snapshot / ctldir stuff. +PDONE port ZFS snapshot / ctldir stuff. - zfs/nfs integration. - zfs/iscsi integration. - native getpages/putpages. -- update ZFS to latest. +PDONE zfs v22 update ZFS to latest. - Implement *at syscalls correctly. +Pre netbsd-6.0 tasks +- More testing especially zvol, vdev and zfs code snapshot will stay disabled +- Get ztest and zdb working +- Get zfs properties working + +Post netbsd-6.0 tasks +- Update to latest version +- Harden zfs, test, survive build.sh on zfs +- all Post integration tasks +- Write regression test suite +- RUMP port (might be very good idea.) + + +### +## List of Know ZFS bugs/issues +### + +User-land += + +1) zpool list ENOMEM error fixed in rev 1.3 sunddi.h and rev 1.5 zfs_ioctl.h +2) zfs unmount crash in getmntinfo +3) ztest TXG dmu commit threshold problem ?? Maybe fixed by replacing atomic functions with mutex. +4) ztest vdev resize problem (spa_thread ? ) + +Kernel +== + +1) Faulted zpool after modload (missing ztest/ dmu_objset) + ZDB fails to work with because of this problem. This need to be investigated more. + see zdb.c#2904 + +2) data lost on filesystem after panic +3) Strange panic during zfs_znode_dmu_init +4) zpool scrub panic in vdev_open-vdev_disk_open-VOP_IOCTL +5) zfs set doesn't work - zfs set dedup=on, zfs set compression=gzip +6) device nodes in /dev/zvol are not created + + + + PDONE = Partialy done.
CVS commit: src
Module Name:src Committed By: haad Date: Sat Oct 30 21:16:08 UTC 2010 Modified Files: src/distrib/sets/lists/base: mi src/distrib/sets/lists/man: mi src/sbin: Makefile src/sbin/resize_ffs: resize_ffs.8 resize_ffs.c Log Message: Add resize_ffs tool to build, change default behaviour to grow filesystem to device size. Add parameter -s to specify size if user want to shrink filesystem. Apply some KNF, remove dead unused code. Oked by chris...@. To generate a diff of this commit: cvs rdiff -u -r1.882 -r1.883 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.1242 -r1.1243 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.116 -r1.117 src/sbin/Makefile cvs rdiff -u -r1.3 -r1.4 src/sbin/resize_ffs/resize_ffs.8 cvs rdiff -u -r1.12 -r1.13 src/sbin/resize_ffs/resize_ffs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.882 src/distrib/sets/lists/base/mi:1.883 --- src/distrib/sets/lists/base/mi:1.882 Wed Oct 20 09:22:33 2010 +++ src/distrib/sets/lists/base/mi Sat Oct 30 21:16:08 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.882 2010/10/20 09:22:33 jmmv Exp $ +# $NetBSD: mi,v 1.883 2010/10/30 21:16:08 haad Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -295,6 +295,7 @@ ./sbin/rdump_lfsbase-sysutil-root ./sbin/reboot base-sysutil-root ./sbin/resolvconfbase-resolvconf-root +./sbin/resize_ffsbase-sysutil-root ./sbin/resize_lfsbase-sysutil-root ./sbin/restore base-sysutil-root ./sbin/rndctl base-sysutil-root Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1242 src/distrib/sets/lists/man/mi:1.1243 --- src/distrib/sets/lists/man/mi:1.1242 Sun Oct 24 08:54:14 2010 +++ src/distrib/sets/lists/man/mi Sat Oct 30 21:16:08 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1242 2010/10/24 08:54:14 jruoho Exp $ +# $NetBSD: mi,v 1.1243 2010/10/30 21:16:08 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -2552,6 +2552,7 @@ ./usr/share/man/cat8/renice.0 man-sysutil-catman .cat ./usr/share/man/cat8/repquota.0 man-sysutil-catman .cat ./usr/share/man/cat8/rescue.0 man-sysutil-catman .cat +./usr/share/man/cat8/resize_ffs.0 man-sysutil-catman .cat ./usr/share/man/cat8/resize_lfs.0 man-sysutil-catman .cat ./usr/share/man/cat8/resolvconf.0 man-resolvconf-catman .cat ./usr/share/man/cat8/restore.0 man-sysutil-catman .cat @@ -4991,6 +4992,7 @@ ./usr/share/man/html8/renice.html man-sysutil-htmlman html ./usr/share/man/html8/repquota.html man-sysutil-htmlman html ./usr/share/man/html8/rescue.html man-sysutil-htmlman html +./usr/share/man/html8/resize_ffs.html man-sysutil-htmlman html ./usr/share/man/html8/resize_lfs.html man-sysutil-htmlman html ./usr/share/man/html8/resolvconf.html man-resolvconf-htmlman html ./usr/share/man/html8/restore.html man-sysutil-htmlman html @@ -7706,6 +7708,7 @@ ./usr/share/man/man8/renice.8 man-sysutil-man .man ./usr/share/man/man8/repquota.8 man-sysutil-man .man ./usr/share/man/man8/rescue.8 man-sysutil-man .man +./usr/share/man/man8/resize_ffs.8 man-sysutil-man .man ./usr/share/man/man8/resize_lfs.8 man-sysutil-man .man ./usr/share/man/man8/resolvconf.8 man-resolvconf-man .man ./usr/share/man/man8/restore.8 man-sysutil-man .man Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.116 src/sbin/Makefile:1.117 --- src/sbin/Makefile:1.116 Wed Mar 10 23:13:10 2010 +++ src/sbin/Makefile Sat Oct 30 21:16:07 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.116 2010/03/10 23:13:10 abs Exp $ +# $NetBSD: Makefile,v 1.117 2010/10/30 21:16:07 haad Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -16,7 +16,7 @@ # support for various file systems SUBDIR+= newfs_ext2fs fsck_ext2fs -SUBDIR+= newfs fsck_ffs fsdb dump restore clri tunefs +SUBDIR+= newfs fsck_ffs fsdb dump restore clri tunefs resize_ffs SUBDIR+= newfs_lfs fsck_lfs dump_lfs resize_lfs SUBDIR+= newfs_msdos fsck_msdos SUBDIR+= newfs_sysvbfs Index: src/sbin/resize_ffs/resize_ffs.8 diff -u src/sbin/resize_ffs/resize_ffs.8:1.3 src/sbin/resize_ffs/resize_ffs.8:1.4 --- src/sbin/resize_ffs/resize_ffs.8:1.3 Mon Mar 10 09:23:23 2003 +++ src/sbin/resize_ffs/resize_ffs.8 Sat Oct 30 21:16:07 2010 @@ -1,4 +1,4 @@ -.\ $NetBSD: resize_ffs.8,v 1.3 2003/03/10 09:23:23 wiz Exp $ +.\ $NetBSD: resize_ffs.8,v 1.4 2010/10/30 21:16:07 haad Exp $ .\ .\ As its sole author, I explicitly place this man page in the public .\ domain. Anyone may use it in any way for any purpose (though I would @@ -16,16 +16,14 @@ .Nd resize an on-disk file system .Sh SYNOPSIS .Nm +.Op Fl y +.Op Fl s Ar size .Ar file-system-raw-device -.Ar newsize .Sh DESCRIPTION .Nm resizes a file system on disk. .Ar
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Sat Oct 23 21:18:55 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c dm.h dm_target_stripe.c Added Files: src/sys/dev/dm/doc: locking.txt Log Message: Add old file describing locking schema used in dm driver. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/dm/device-mapper.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/dm/dm.h cvs rdiff -u -r1.10 -r1.11 src/sys/dev/dm/dm_target_stripe.c cvs rdiff -u -r0 -r1.1 src/sys/dev/dm/doc/locking.txt Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.24 src/sys/dev/dm/device-mapper.c:1.25 --- src/sys/dev/dm/device-mapper.c:1.24 Sat Oct 9 12:56:06 2010 +++ src/sys/dev/dm/device-mapper.c Sat Oct 23 21:18:54 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.24 2010/10/09 12:56:06 haad Exp $ */ +/*$NetBSD: device-mapper.c,v 1.25 2010/10/23 21:18:54 haad Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -350,7 +350,6 @@ r = 0; aprint_debug(dmioctl called\n); - KASSERT(data != NULL); if (( r = disk_ioctl_switch(dev, cmd, data)) == ENOTTY) { Index: src/sys/dev/dm/dm.h diff -u src/sys/dev/dm/dm.h:1.18 src/sys/dev/dm/dm.h:1.19 --- src/sys/dev/dm/dm.h:1.18 Tue May 18 15:10:41 2010 +++ src/sys/dev/dm/dm.h Sat Oct 23 21:18:54 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm.h,v 1.18 2010/05/18 15:10:41 haad Exp $ */ +/*$NetBSD: dm.h,v 1.19 2010/10/23 21:18:54 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -170,12 +170,23 @@ typedef struct target_linear_config { dm_pdev_t *pdev; uint64_t offset; + TAILQ_ENTRY(target_linear_config) entries; } dm_target_linear_config_t; +/* + * Striping devices are stored in a linked list, this might be inefficient + * for more than 8 striping devices and can be changed to something more + * scalable. + * TODO: look for other options than linked list. + */ +TAILQ_HEAD(target_linear_devs, target_linear_config); + +typedef struct target_linear_devs dm_target_linear_devs_t; + /* for stripe : */ typedef struct target_stripe_config { -#define MAX_STRIPES 2 - struct target_linear_config stripe_devs[MAX_STRIPES]; +#define DM_STRIPE_DEV_OFFSET 2 + struct target_linear_devs stripe_devs; uint8_t stripe_num; uint64_t stripe_chunksize; size_t params_len; Index: src/sys/dev/dm/dm_target_stripe.c diff -u src/sys/dev/dm/dm_target_stripe.c:1.10 src/sys/dev/dm/dm_target_stripe.c:1.11 --- src/sys/dev/dm/dm_target_stripe.c:1.10 Tue May 18 15:10:41 2010 +++ src/sys/dev/dm/dm_target_stripe.c Sat Oct 23 21:18:54 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target_stripe.c,v 1.10 2010/05/18 15:10:41 haad Exp $*/ +/*$NetBSD: dm_target_stripe.c,v 1.11 2010/10/23 21:18:54 haad Exp $*/ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -102,6 +102,8 @@ /* * Init function called from dm_table_load_ioctl. + * DM_STRIPE_DEV_OFFSET should always hold the index of the first device-offset + * pair in the parameters. * Example line sent to dm from lvm tools when using striped target. * start length striped #stripes chunk_size device1 offset1 ... deviceN offsetN * 0 65536 striped 2 512 /dev/hda 0 /dev/hdb 0 @@ -109,9 +111,11 @@ int dm_target_stripe_init(dm_dev_t * dmv, void **target_config, char *params) { + dm_target_linear_config_t *tlc; dm_target_stripe_config_t *tsc; size_t len; char **ap, *argv[10]; + int strpc, strpi; if (params == NULL) return EINVAL; @@ -130,33 +134,34 @@ printf(Stripe target init function called!!\n); - printf(Stripe target chunk size %s number of stripes %s\n, argv[1], argv[0]); - printf(Stripe target device name %s -- offset %s\n, argv[2], argv[3]); - printf(Stripe target device name %s -- offset %s\n, argv[4], argv[5]); + printf(Stripe target chunk size %s number of stripes %s\n, + argv[1], argv[0]); - if (atoi(argv[0]) MAX_STRIPES) - return ENOTSUP; - - if ((tsc = kmem_alloc(sizeof(dm_target_stripe_config_t), KM_NOSLEEP)) - == NULL) + if ((tsc = kmem_alloc(sizeof(*tsc), KM_NOSLEEP)) == NULL) return ENOMEM; - /* Insert dmp to global pdev list */ - if ((tsc-stripe_devs[0].pdev = dm_pdev_insert(argv[2])) == NULL) - return ENOENT; - - /* Insert dmp to global pdev list */ - if ((tsc-stripe_devs[1].pdev = dm_pdev_insert(argv[4])) == NULL) - return ENOENT; - - tsc-stripe_devs[0].offset = atoi(argv[3]); - tsc-stripe_devs[1].offset = atoi(argv[5]); + /* Initialize linked list for striping devices */ + TAILQ_INIT(tsc-stripe_devs); /* Save length of param string */ tsc-params_len = len; tsc-stripe_chunksize = atoi(argv[1]); tsc-stripe_num = (uint8_t) atoi(argv[0]); + strpc = DM_STRIPE_DEV_OFFSET + (tsc-stripe_num * 2); + for (strpi = DM_STRIPE_DEV_OFFSET; strpi strpc; strpi += 2) { + printf(Stripe target device name %s -- offset
CVS commit: src/sys/rump/dev/lib/libnpf
Module Name:src Committed By: haad Date: Thu Oct 14 22:39:30 UTC 2010 Added Files: src/sys/rump/dev/lib/libnpf: Makefile component.c shlib_version Log Message: Add files needed to build npf as a RUMP library, original code bu rmind some modifications done by me. Oked by @rmind. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libnpf/Makefile \ src/sys/rump/dev/lib/libnpf/component.c \ src/sys/rump/dev/lib/libnpf/shlib_version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/dev/lib/libnpf/Makefile diff -u /dev/null src/sys/rump/dev/lib/libnpf/Makefile:1.1 --- /dev/null Thu Oct 14 22:39:30 2010 +++ src/sys/rump/dev/lib/libnpf/Makefile Thu Oct 14 22:39:30 2010 @@ -0,0 +1,17 @@ +# $NetBSD: Makefile,v 1.1 2010/10/14 22:39:30 haad Exp $ +# + +.PATH: ${.CURDIR}/../../../../net/npf + +LIB= rumpdev_npf + +SRCS= npf.c npf_ctl.c npf_handler.c npf_instr.c npf_mbuf.c +SRCS+= npf_processor.c npf_ruleset.c npf_tableset.c npf_inet.c +SRCS+= npf_session.c npf_nat.c npf_alg.c + +SRCS+= component.c + +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpvfs + +.include bsd.lib.mk +.include bsd.klinks.mk Index: src/sys/rump/dev/lib/libnpf/component.c diff -u /dev/null src/sys/rump/dev/lib/libnpf/component.c:1.1 --- /dev/null Thu Oct 14 22:39:30 2010 +++ src/sys/rump/dev/lib/libnpf/component.c Thu Oct 14 22:39:30 2010 @@ -0,0 +1,35 @@ +/* $NetBSD: component.c,v 1.1 2010/10/14 22:39:30 haad Exp $ */ + +/* + * Public Domain. + */ + +#include sys/cdefs.h +__KERNEL_RCSID(0, $NetBSD: component.c,v 1.1 2010/10/14 22:39:30 haad Exp $); + +#include sys/param.h +#include sys/conf.h +#include sys/device.h +#include sys/stat.h + +#include rump_private.h +#include rump_dev_private.h +#include rump_vfs_private.h + +extern const struct cdevsw npf_cdevsw; + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + devmajor_t bmajor = NODEVMAJOR, cmajor = NODEVMAJOR; + int error; + + error = devsw_attach(npf, NULL, bmajor, npf_cdevsw, cmajor); + if (error) { + panic(npf attaching failed: %d, error); + } + + error = rump_vfs_makeonedevnode(S_IFCHR, /dev/npf, cmajor, 0); + if (error) { + panic(npf device node creation failed: %d, error); + } +} Index: src/sys/rump/dev/lib/libnpf/shlib_version diff -u /dev/null src/sys/rump/dev/lib/libnpf/shlib_version:1.1 --- /dev/null Thu Oct 14 22:39:30 2010 +++ src/sys/rump/dev/lib/libnpf/shlib_version Thu Oct 14 22:39:30 2010 @@ -0,0 +1,4 @@ +# $NetBSD: shlib_version,v 1.1 2010/10/14 22:39:30 haad Exp $ +# +major=0 +minor=0
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Sat Oct 9 12:56:07 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c Log Message: In rome do as romans do. If I will get EEXIST from devsw_attach don't exit and continue. This unbreaks usage of libdm in RUMP. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/dev/dm/device-mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.23 src/sys/dev/dm/device-mapper.c:1.24 --- src/sys/dev/dm/device-mapper.c:1.23 Tue May 18 15:10:41 2010 +++ src/sys/dev/dm/device-mapper.c Sat Oct 9 12:56:06 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.23 2010/05/18 15:10:41 haad Exp $ */ +/*$NetBSD: device-mapper.c,v 1.24 2010/10/09 12:56:06 haad Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -174,6 +174,8 @@ error = devsw_attach(dm_cd.cd_name, dm_bdevsw, bmajor, dm_cdevsw, cmajor); + if (error == EEXIST) + error = 0; if (error) { config_cfattach_detach(dm_cd.cd_name, dm_ca); config_cfdriver_detach(dm_cd);
CVS commit: src/tests/dev/dm
Module Name:src Committed By: haad Date: Wed Oct 6 11:24:56 UTC 2010 Added Files: src/tests/dev/dm: Atffile Makefile dm_targets_cmd.plist dm_version_cmd.plist h_dm.c t_dm.sh Log Message: Import new test program for device-mapper driver it currently call dm_version_list and dm_targets_list ioctl to test if dm driver inside rump works. It will be disable for now, because I need to find out why if I run this test by atf-run it fails while running h_dm by hand works. XXX. component.c in rump/libdm calls devsw_attach before dm_modcmd can do that therefore unmodified modcmd returns error. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/tests/dev/dm/Atffile src/tests/dev/dm/Makefile \ src/tests/dev/dm/dm_targets_cmd.plist \ src/tests/dev/dm/dm_version_cmd.plist src/tests/dev/dm/h_dm.c \ src/tests/dev/dm/t_dm.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tests/dev/dm/Atffile diff -u /dev/null src/tests/dev/dm/Atffile:1.1 --- /dev/null Wed Oct 6 11:24:56 2010 +++ src/tests/dev/dm/Atffile Wed Oct 6 11:24:55 2010 @@ -0,0 +1,6 @@ +Content-Type: application/X-atf-atffile; version=1 +X-NetBSD-Id: $NetBSD: Atffile,v 1.1 2010/10/06 11:24:55 haad Exp $ + +prop: test-suite = NetBSD + +tp-glob: t_* Index: src/tests/dev/dm/Makefile diff -u /dev/null src/tests/dev/dm/Makefile:1.1 --- /dev/null Wed Oct 6 11:24:56 2010 +++ src/tests/dev/dm/Makefile Wed Oct 6 11:24:55 2010 @@ -0,0 +1,27 @@ + +# $NetBSD: Makefile,v 1.1 2010/10/06 11:24:55 haad Exp $ +# + +.include bsd.own.mk + +TESTSDIR= ${TESTSBASE}/dev/dm +FILESDIR= ${TESTSDIR} + +TESTS_SH= t_dm +TESTS_C= h_dm + +ATFFILE= yes + + +LDADD+= -lprop -lutil +LDADD+= -lrumpdev_disk -lrumpdev_dm +LDADD+= -lrumpdev -lrumpvfs +LDADD+= -lrump +LDADD+= -lrumpuser -lpthread + +FILES= t_dm_disk_1.bz2.uue t_dm_disk_2.bz2.uue t_dm_disk_3.bz2.uue + +WARNS= 4 +NOMAN= + +.include bsd.test.mk Index: src/tests/dev/dm/dm_targets_cmd.plist diff -u /dev/null src/tests/dev/dm/dm_targets_cmd.plist:1.1 --- /dev/null Wed Oct 6 11:24:56 2010 +++ src/tests/dev/dm/dm_targets_cmd.plist Wed Oct 6 11:24:55 2010 @@ -0,0 +1,20 @@ +?xml version=1.0 encoding=UTF-8? +!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd; +plist version=1.0 +dict +keycmd_data/key +array/ +keycommand/key +stringtargets/string +keyevent_nr/key +integer0x0/integer +keyflags/key +integer0x4/integer +keyversion/key +array +integer0x4/integer +integer0x1/integer +integer0x0/integer +/array +/dict +/plist \ No newline at end of file Index: src/tests/dev/dm/dm_version_cmd.plist diff -u /dev/null src/tests/dev/dm/dm_version_cmd.plist:1.1 --- /dev/null Wed Oct 6 11:24:56 2010 +++ src/tests/dev/dm/dm_version_cmd.plist Wed Oct 6 11:24:55 2010 @@ -0,0 +1,20 @@ +?xml version=1.0 encoding=UTF-8? +!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd; +plist version=1.0 +dict +keycmd_data/key +array/ +keycommand/key +stringversion/string +keyevent_nr/key +integer0x0/integer +keyflags/key +integer0x4/integer +keyversion/key +array +integer0x4/integer +integer0x0/integer +integer0x0/integer +/array +/dict +/plist \ No newline at end of file Index: src/tests/dev/dm/h_dm.c diff -u /dev/null src/tests/dev/dm/h_dm.c:1.1 --- /dev/null Wed Oct 6 11:24:56 2010 +++ src/tests/dev/dm/h_dm.c Wed Oct 6 11:24:55 2010 @@ -0,0 +1,146 @@ +/* $NetBSD: h_dm.c,v 1.1 2010/10/06 11:24:55 haad Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * 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 AUTHOR ``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 AUTHOR 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
CVS commit: src/sys/arch
Module Name:src Committed By: haad Date: Thu Aug 12 20:16:28 UTC 2010 Modified Files: src/sys/arch/amd64/conf: XEN3_DOM0 XEN3_DOMU src/sys/arch/i386/conf: XEN3_DOM0 XEN3_DOMU Log Message: dd dm driver to XEN configs because they do not have modules working yet. This will enable using LVM by default on XEN DOM0 hostings running NetBSD. Change suggested by Sam Fourman. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.24 -r1.25 src/sys/arch/amd64/conf/XEN3_DOMU cvs rdiff -u -r1.36 -r1.37 src/sys/arch/i386/conf/XEN3_DOM0 cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/conf/XEN3_DOMU Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/conf/XEN3_DOM0 diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.56 src/sys/arch/amd64/conf/XEN3_DOM0:1.57 --- src/sys/arch/amd64/conf/XEN3_DOM0:1.56 Tue Jul 6 15:00:09 2010 +++ src/sys/arch/amd64/conf/XEN3_DOM0 Thu Aug 12 20:16:27 2010 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.56 2010/07/06 15:00:09 cherry Exp $ +# $NetBSD: XEN3_DOM0,v 1.57 2010/08/12 20:16:27 haad Exp $ include arch/amd64/conf/std.xen @@ -786,6 +786,7 @@ pseudo-device md 1 # memory disk device (ramdisk) pseudo-device vnd # disk-like interface to files pseudo-device putter # for puffs and pud +pseudo-device dm # device-mapper driver for LVM # network pseudo-devices pseudo-device bpfilter # Berkeley packet filter Index: src/sys/arch/amd64/conf/XEN3_DOMU diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.24 src/sys/arch/amd64/conf/XEN3_DOMU:1.25 --- src/sys/arch/amd64/conf/XEN3_DOMU:1.24 Tue Jul 6 15:00:09 2010 +++ src/sys/arch/amd64/conf/XEN3_DOMU Thu Aug 12 20:16:28 2010 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOMU,v 1.24 2010/07/06 15:00:09 cherry Exp $ +# $NetBSD: XEN3_DOMU,v 1.25 2010/08/12 20:16:28 haad Exp $ include arch/amd64/conf/std.xen @@ -195,6 +195,7 @@ pseudo-device md 1 # memory disk device (ramdisk) pseudo-device vnd # disk-like interface to files +pseudo-device dm # device-mapper driver for LVM # network pseudo-devices pseudo-device bpfilter # Berkeley packet filter Index: src/sys/arch/i386/conf/XEN3_DOM0 diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.36 src/sys/arch/i386/conf/XEN3_DOM0:1.37 --- src/sys/arch/i386/conf/XEN3_DOM0:1.36 Tue Jul 6 15:00:09 2010 +++ src/sys/arch/i386/conf/XEN3_DOM0 Thu Aug 12 20:16:27 2010 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.36 2010/07/06 15:00:09 cherry Exp $ +# $NetBSD: XEN3_DOM0,v 1.37 2010/08/12 20:16:27 haad Exp $ # # XEN3_0: Xen 3.0 domain0 kernel @@ -762,6 +762,7 @@ pseudo-device md 1 # memory disk device (ramdisk) pseudo-device vnd # disk-like interface to files +pseudo-device dm # device-mapper driver for LVM # network pseudo-devices pseudo-device bpfilter # Berkeley packet filter Index: src/sys/arch/i386/conf/XEN3_DOMU diff -u src/sys/arch/i386/conf/XEN3_DOMU:1.25 src/sys/arch/i386/conf/XEN3_DOMU:1.26 --- src/sys/arch/i386/conf/XEN3_DOMU:1.25 Tue Jul 6 15:00:09 2010 +++ src/sys/arch/i386/conf/XEN3_DOMU Thu Aug 12 20:16:27 2010 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOMU,v 1.25 2010/07/06 15:00:09 cherry Exp $ +# $NetBSD: XEN3_DOMU,v 1.26 2010/08/12 20:16:27 haad Exp $ include arch/xen/conf/std.xen @@ -209,6 +209,7 @@ pseudo-device md 1 # memory disk device (ramdisk) pseudo-device vnd # disk-like interface to files +pseudo-device dm # device-mapper driver for LVM # network pseudo-devices pseudo-device bpfilter # Berkeley packet filter
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: haad Date: Wed May 19 17:51:00 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: space_map.c Log Message: Do not initialize space map cv twice. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c:1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c:1.4 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c:1.3 Sat Feb 27 23:43:53 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c Wed May 19 17:50:59 2010 @@ -62,8 +62,6 @@ avl_create(sm-sm_root, space_map_seg_compare, sizeof (space_seg_t), offsetof(struct space_seg, ss_node)); - - cv_init(sm-sm_load_cv, NULL, CV_DEFAULT, NULL); sm-sm_start = start; sm-sm_size = size;
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Wed May 19 18:01:26 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ioctl.c src/external/cddl/osnet/sys/sys: sunddi.h Log Message: Use ddi_copyin and ddi_copyout as solaris does, change them to ioctl_copyin/ioctl_copyout in kernel and to bcopy in user space. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/sys/sunddi.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.5 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.6 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.5 Wed May 19 17:57:42 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c Wed May 19 18:01:26 2010 @@ -4454,16 +4454,8 @@ zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP); - /* XXX is this still needed ? */ - error = xcopyin((void *)arg, zc, sizeof (zfs_cmd_t)); - printf(zfsdev_ioct zc_value %s, zc_string\n, zc-zc_value, zc-zc_string); - printf(zfsdev_ioctl - calling zfs_ioc_vec secpolicy function on %d\n, vec); - if (error == 0) -#if 0 error = ddi_copyin((void *)arg, zc, sizeof (zfs_cmd_t), flag); - if ((error == 0) !(flag FKIOCTL)) -#endif error = zfs_ioc_vec[vec].zvec_secpolicy(zc, cr); /* Index: src/external/cddl/osnet/sys/sys/sunddi.h diff -u src/external/cddl/osnet/sys/sys/sunddi.h:1.3 src/external/cddl/osnet/sys/sys/sunddi.h:1.4 --- src/external/cddl/osnet/sys/sys/sunddi.h:1.3 Sun Feb 21 01:46:36 2010 +++ src/external/cddl/osnet/sys/sys/sunddi.h Wed May 19 18:01:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: sunddi.h,v 1.3 2010/02/21 01:46:36 darran Exp $ */ +/* $NetBSD: sunddi.h,v 1.4 2010/05/19 18:01:26 haad Exp $ */ /*- * Copyright (c) 2007 Pawel Jakub Dawidek p...@freebsd.org @@ -31,8 +31,13 @@ #ifndef _OPENSOLARIS_SYS_SUNDDI_H_ #define _OPENSOLARIS_SYS_SUNDDI_H_ +#ifndef _KERNEL #define ddi_copyin(from, to, size, flag) (bcopy((from), (to), (size)), 0) #define ddi_copyout(from, to, size, flag) (bcopy((from), (to), (size)), 0) +#else +#define ddi_copyin(from, to, size, flag) (ioctl_copyin((flag), (from), (to), (size))) +#define ddi_copyout(from, to, size, flag) (ioctl_copyout((flag), (from), (to), (size))) +#endif int ddi_strtoul(const char *str, char **nptr, int base, unsigned long *result); #endif /* _OPENSOLARIS_SYS_SUNDDI_H_ */
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: haad Date: Wed May 19 17:57:42 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ioctl.c Log Message: Do not call zfs_init and zfs_fini directly they will be called by vfs routines. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.5 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.4 Sat Feb 27 23:43:53 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c Wed May 19 17:57:42 2010 @@ -4626,14 +4626,13 @@ return error; } spa_init(FREAD | FWRITE); - zfs_init(); zvol_init(); zfs_vfsinit(16, MOUNT_ZFS); /* I need to use well defined args. */ error = devsw_attach(zfs, zfs_bdevsw, zfs_bmajor, zfs_cdevsw, zfs_cmajor); if (error != 0) { zvol_fini(); - zfs_fini(); + zfs_vfsfini(); spa_fini(); lwp_specific_key_delete(zfs_fsyncer_key); lwp_specific_key_delete(rrw_tsd_key); @@ -4647,7 +4646,6 @@ error = devsw_detach(zfs_bdevsw, zfs_cdevsw); zvol_fini(); zfs_vfsfini(); - zfs_fini(); spa_fini(); lwp_specific_key_delete(zfs_fsyncer_key); lwp_specific_key_delete(rrw_tsd_key);
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Tue May 18 15:01:17 UTC 2010 Modified Files: src/sys/dev/dm: dm_ioctl.c Log Message: Fix typo in comment. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/dm/dm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_ioctl.c diff -u src/sys/dev/dm/dm_ioctl.c:1.21 src/sys/dev/dm/dm_ioctl.c:1.22 --- src/sys/dev/dm/dm_ioctl.c:1.21 Thu Feb 25 20:48:58 2010 +++ src/sys/dev/dm/dm_ioctl.c Tue May 18 15:01:17 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dm_ioctl.c,v 1.21 2010/02/25 20:48:58 jakllsch Exp $ */ +/* $NetBSD: dm_ioctl.c,v 1.22 2010/05/18 15:01:17 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -47,7 +47,7 @@ * To access table entries dm_table_* routines must be used. * * dm_table_get_entry will increment table users reference - * counter. It will return active or inactive table depedns + * counter. It will return active or inactive table depends * on uint8_t argument. * * dm_table_release must be called for every table_entry from
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Tue May 18 15:10:41 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c dm.h dm_target.c dm_target_error.c dm_target_linear.c dm_target_mirror.c dm_target_snapshot.c dm_target_stripe.c dm_target_zero.c Log Message: Add support for DIOCCACHESYNC ioctl for dm devices. Add new sync function pointer to dm_target_t because that is the only part of dm which know real block device. disk_ioctl_switch parses whole device table and for every entry it calls particular sync routine which propagates DIOCCACHESYNC to real disk. While I was here implement some KNF fixes and remove unneeded symbols from dm.h. Problem reported on port-xen@ by Hugo Silva. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/dev/dm/device-mapper.c cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/dm.h cvs rdiff -u -r1.12 -r1.13 src/sys/dev/dm/dm_target.c \ src/sys/dev/dm/dm_target_snapshot.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/dm/dm_target_error.c \ src/sys/dev/dm/dm_target_zero.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/dm/dm_target_linear.c \ src/sys/dev/dm/dm_target_stripe.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/dm/dm_target_mirror.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.22 src/sys/dev/dm/device-mapper.c:1.23 --- src/sys/dev/dm/device-mapper.c:1.22 Fri Mar 26 15:46:04 2010 +++ src/sys/dev/dm/device-mapper.c Tue May 18 15:10:41 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.22 2010/03/26 15:46:04 jakllsch Exp $ */ +/*$NetBSD: device-mapper.c,v 1.23 2010/05/18 15:10:41 haad Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -152,6 +152,7 @@ static int dm_modcmd(modcmd_t cmd, void *arg) { +#ifdef _MODULE int error, bmajor, cmajor; error = 0; @@ -209,6 +210,9 @@ } return error; +#else + return ENOTTY; +#endif } #endif /* _MODULE */ @@ -470,6 +474,32 @@ dm_dev_unbusy(dmv); break; } + + case DIOCCACHESYNC: + { + dm_table_entry_t *table_en; + dm_table_t *tbl; + int err; + + if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL) + return ENODEV; + + /* Select active table */ + tbl = dm_table_get_entry(dmv-table_head, DM_TABLE_ACTIVE); + + /* + * Call sync target routine for all table entries. Target sync + * routine basically call DIOCCACHESYNC on underlying devices. + */ + SLIST_FOREACH(table_en, tbl, next) + { + err = table_en-target-sync(table_en); + } + dm_table_release(dmv-table_head, DM_TABLE_ACTIVE); + dm_dev_unbusy(dmv); + break; + } + default: aprint_debug(unknown disk_ioctl called\n); Index: src/sys/dev/dm/dm.h diff -u src/sys/dev/dm/dm.h:1.17 src/sys/dev/dm/dm.h:1.18 --- src/sys/dev/dm/dm.h:1.17 Tue Dec 29 23:37:48 2009 +++ src/sys/dev/dm/dm.h Tue May 18 15:10:41 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm.h,v 1.17 2009/12/29 23:37:48 haad Exp $ */ +/*$NetBSD: dm.h,v 1.18 2010/05/18 15:10:41 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -38,7 +38,9 @@ #include sys/errno.h #include sys/atomic.h +#include sys/fcntl.h #include sys/condvar.h +#include sys/kauth.h #include sys/mutex.h #include sys/rwlock.h #include sys/queue.h @@ -226,6 +228,7 @@ */ char * (*status)(void *); int (*strategy)(dm_table_entry_t *, struct buf *); + int (*sync)(dm_table_entry_t *); int (*upcall)(dm_table_entry_t *, struct buf *); uint32_t version[3]; @@ -284,26 +287,11 @@ #define DM_MAX_PARAMS_SIZE 1024 -/* dm_target_zero.c */ -int dm_target_zero_init(dm_dev_t *, void**, char *); -char * dm_target_zero_status(void *); -int dm_target_zero_strategy(dm_table_entry_t *, struct buf *); -int dm_target_zero_destroy(dm_table_entry_t *); -int dm_target_zero_deps(dm_table_entry_t *, prop_array_t); -int dm_target_zero_upcall(dm_table_entry_t *, struct buf *); - -/* dm_target_error.c */ -int dm_target_error_init(dm_dev_t *, void**, char *); -char * dm_target_error_status(void *); -int dm_target_error_strategy(dm_table_entry_t *, struct buf *); -int dm_target_error_deps(dm_table_entry_t *, prop_array_t); -int dm_target_error_destroy(dm_table_entry_t *); -int dm_target_error_upcall(dm_table_entry_t *, struct buf *); - /* dm_target_linear.c */ int dm_target_linear_init(dm_dev_t *, void**, char *); char * dm_target_linear_status(void *); int dm_target_linear_strategy(dm_table_entry_t *, struct buf *); +int dm_target_linear_sync(dm_table_entry_t *); int dm_target_linear_deps(dm_table_entry_t *, prop_array_t); int dm_target_linear_destroy(dm_table_entry_t *); int dm_target_linear_upcall(dm_table_entry_t *, struct buf *); @@ -311,38 +299,15 @@ /* Generic function used to convert char to string */ uint64_t atoi(const char *); -/* dm_target_mirror.c */ -int dm_target_mirror_init(dm_dev_t *, void**, char *);
CVS commit: src/share/man/man9
Module Name:src Committed By: haad Date: Wed May 12 15:54:47 UTC 2010 Modified Files: src/share/man/man9: kthread.9 Log Message: Document kthread_join in kthread(9). To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/kthread.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/kthread.9 diff -u src/share/man/man9/kthread.9:1.20 src/share/man/man9/kthread.9:1.21 --- src/share/man/man9/kthread.9:1.20 Mon Aug 3 23:29:19 2009 +++ src/share/man/man9/kthread.9 Wed May 12 15:54:47 2010 @@ -1,4 +1,4 @@ -.\ $NetBSD: kthread.9,v 1.20 2009/08/03 23:29:19 rmind Exp $ +.\ $NetBSD: kthread.9,v 1.21 2010/05/12 15:54:47 haad Exp $ .\ .\ Copyright (c) 2000, 2007, 2008 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -34,6 +34,7 @@ .Nm kthread_create , .Nm kthread_destroy , .Nm kthread_exit +.Nm kthread_join .Nd kernel threads .Sh SYNOPSIS .In sys/kthread.h @@ -108,6 +109,8 @@ .Fa ci , meaning that it will only ever execute on that CPU. By default, the threads are free to execute on any CPU in the system. +.Dv KTHREAD_JOINABLE +Request creation of joinable kthread. .It Fa func A function to be called when the thread begins executing. This function must not return. @@ -139,6 +142,8 @@ .It Fn kthread_exit ecode Exit from a kernel thread. Must only be called by a kernel thread. +.It Fn kthread_join l +Suspend execution of running LWP untils the target kthread terminates. .El .Sh RETURN VALUES Upon successful completion,
CVS commit: src/external/cddl/osnet/lib/libzpool
Module Name:src Committed By: haad Date: Tue May 11 22:18:10 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzpool: kernel2.c Log Message: Fix userspace cv_timedwait implementation to work on NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libzpool/kernel2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libzpool/kernel2.c diff -u src/external/cddl/osnet/lib/libzpool/kernel2.c:1.1 src/external/cddl/osnet/lib/libzpool/kernel2.c:1.2 --- src/external/cddl/osnet/lib/libzpool/kernel2.c:1.1 Fri Aug 7 20:57:56 2009 +++ src/external/cddl/osnet/lib/libzpool/kernel2.c Tue May 11 22:18:10 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel2.c,v 1.1 2009/08/07 20:57:56 haad Exp $ */ +/* $NetBSD: kernel2.c,v 1.2 2010/05/11 22:18:10 haad Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: kernel2.c,v 1.1 2009/08/07 20:57:56 haad Exp $); +__RCSID($NetBSD: kernel2.c,v 1.2 2010/05/11 22:18:10 haad Exp $); #include sys/zfs_context.h @@ -239,6 +239,7 @@ clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime) { + struct timespec nowts; struct timespec ts; uint64_t when; int error; @@ -247,10 +248,14 @@ cv_init(cv, NULL, 0, NULL); } + clock_gettime(CLOCK_REALTIME, nowts); + /* convert back from 119hz to nanoseconds. */ - when = abstime 23; + when = (uint64_t)abstime 23; ts.tv_sec = (long)(abstime / 10); ts.tv_nsec = (long)(abstime % 10); + + timespecadd(ts, nowts, ts); do { error = pthread_cond_timedwait(GET(cv), GET(mp), ts);
CVS commit: src/sys
Module Name:src Committed By: haad Date: Tue May 11 22:26:00 UTC 2010 Modified Files: src/sys/kern: kern_kthread.c src/sys/sys: kthread.h Log Message: Add support for kthread_join in our kernel thread implementation. This is used by zfs but I think that it can be generaly usefull. Thread need to be created with KTHREAD_JOINABLE flag and can be joined only once. When joinable thread was created it will not e automatically reaped from system and kthread_join must be called on it to reap it. Ok by a...@. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/kern/kern_kthread.c cvs rdiff -u -r1.8 -r1.9 src/sys/sys/kthread.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_kthread.c diff -u src/sys/kern/kern_kthread.c:1.27 src/sys/kern/kern_kthread.c:1.28 --- src/sys/kern/kern_kthread.c:1.27 Wed Oct 21 21:12:06 2009 +++ src/sys/kern/kern_kthread.c Tue May 11 22:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_kthread.c,v 1.27 2009/10/21 21:12:06 rmind Exp $ */ +/* $NetBSD: kern_kthread.c,v 1.28 2010/05/11 22:26:00 haad Exp $ */ /*- * Copyright (c) 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_kthread.c,v 1.27 2009/10/21 21:12:06 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_kthread.c,v 1.28 2010/05/11 22:26:00 haad Exp $); #include sys/param.h #include sys/systm.h @@ -52,6 +52,12 @@ /* * Fork a kernel thread. Any process can request this to be done. + * + * With joinable kthreads KTHREAD_JOINABLE flag this should be known. + * 1. If you specify KTHREAD_JOINABLE, you must call kthread_join() to reap the thread. + *It will not be automatically reaped by the system. + * 2. For any given call to kthread_create(KTHREAD_JOINABLE), you may call kthread_join() + *only once on the returned lwp_t *. */ int kthread_create(pri_t pri, int flag, struct cpu_info *ci, @@ -60,10 +66,11 @@ { lwp_t *l; vaddr_t uaddr; - int error; + int error, lc, lwp_flags; va_list ap; - int lc; + lwp_flags = LWP_DETACHED; + uaddr = uvm_uarea_alloc(); if (uaddr == 0) { return ENOMEM; @@ -73,7 +80,12 @@ } else { lc = SCHED_RR; } - error = lwp_create(lwp0, proc0, uaddr, LWP_DETACHED, NULL, + + if ((flag KTHREAD_JOINABLE) != 0) { + lwp_flags = ~LWP_DETACHED; + } + + error = lwp_create(lwp0, proc0, uaddr, lwp_flags, NULL, 0, func, arg, l, lc); if (error) { uvm_uarea_free(uaddr); @@ -82,7 +94,7 @@ if (fmt != NULL) { l-l_name = kmem_alloc(MAXCOMLEN, KM_SLEEP); if (l-l_name == NULL) { - lwp_exit(l); + kthread_destroy(l); return ENOMEM; } va_start(ap, fmt); @@ -97,6 +109,11 @@ KASSERT((flag KTHREAD_MPSAFE) != 0); } + /* Joinable kthread can't be NULL. */ + if ((flag KTHREAD_JOINABLE) != 0) { + KASSERT(l != NULL); + } + if (pri == PRI_NONE) { if ((flag KTHREAD_TS) != 0) { /* Maximum user priority level. */ @@ -182,9 +199,39 @@ void kthread_destroy(lwp_t *l) { - + proc_t *p; + KASSERT((l-l_flag LW_SYSTEM) != 0); KASSERT(l-l_stat == LSIDL); + p = l-l_proc; + + /* Add LRP_DETACHED flag because we can have joinable kthread now. */ + mutex_enter(p-p_lock); + l-l_prflag |= LPR_DETACHED; + mutex_exit(p-p_lock); + lwp_exit(l); } + +/* + * Wait for a kthread to exit, as pthread_join(). + */ +int +kthread_join(lwp_t *l) +{ + lwpid_t departed; + proc_t *p; + int error; + + KASSERT((l-l_flag LW_SYSTEM) != 0); + KASSERT((l-l_prflag LPR_DETACHED) == 0); + + p = l-l_proc; + + mutex_enter(p-p_lock); + error = lwp_wait1(curlwp, l-l_lid, departed, LWPWAIT_EXITCONTROL); + mutex_exit(p-p_lock); + + return error; +} Index: src/sys/sys/kthread.h diff -u src/sys/sys/kthread.h:1.8 src/sys/sys/kthread.h:1.9 --- src/sys/sys/kthread.h:1.8 Thu Jan 29 22:00:26 2009 +++ src/sys/sys/kthread.h Tue May 11 22:26:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kthread.h,v 1.8 2009/01/29 22:00:26 ad Exp $ */ +/* $NetBSD: kthread.h,v 1.9 2010/05/11 22:26:00 haad Exp $ */ /*- * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc. @@ -44,6 +44,7 @@ #define KTHREAD_MPSAFE 0x02 /* does not need kernel_lock */ #define KTHREAD_INTR 0x04 /* interrupt handler */ #define KTHREAD_TS 0x08 /* timeshared */ +#define KTHREAD_JOINABLE 0x10 /* joinable thread */ int kthread_create(pri_t, int, struct cpu_info *, void (*)(void *), void *, @@ -51,6 +52,7 @@ __attribute__((__format__(__printf__,7,8))); void kthread_exit(int) __dead; void kthread_destroy(lwp_t *); +int kthread_join(lwp_t *); #endif /* _KERNEL */ #endif /* _SYS_KTHREAD_H_ */
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: haad Date: Mon May 10 06:10:59 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_znode.c Log Message: Get new vnode when creating zfs share dir for it's znode. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c:1.6 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c:1.7 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c:1.6 Sat Feb 27 23:43:53 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c Mon May 10 06:10:59 2010 @@ -484,7 +484,8 @@ sharezp-z_zfsvfs = zfsvfs; vp = ZTOV(sharezp); - vn_reinit(vp); + error = getnewvnode(VT_ZFS, zfsvfs-z_parent-z_vfs, + zfs_vnodeop_p, zp-z_vnode); vp-v_type = VDIR; VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, vattr,
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: haad Date: Mon May 10 06:15:28 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: spa.c Log Message: Fix spa_thread to compile under the NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c:1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c:1.4 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c:1.3 Sat Feb 27 23:43:53 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa.c Mon May 10 06:15:28 2010 @@ -1,3 +1,4 @@ + /* * CDDL HEADER START * @@ -671,13 +672,14 @@ callb_cpr_t cprinfo; spa_t *spa = arg; -#ifdef PORT_SOLARIS - user_t *pu = PTOU(curproc); CALLB_CPR_INIT(cprinfo, spa-spa_proc_lock, callb_generic_cpr, spa-spa_name); ASSERT(curproc != p0); +#ifdef PORT_SOLARIS + user_t *pu = PTOU(curproc); + (void) snprintf(pu-u_psargs, sizeof (pu-u_psargs), zpool-%s, spa-spa_name); (void) strlcpy(pu-u_comm, pu-u_psargs, sizeof (pu-u_comm)); @@ -753,7 +755,7 @@ ASSERT(spa-spa_proc_state == SPA_PROC_NONE); ASSERT(spa-spa_proc == p0); spa-spa_did = 0; - +#if 0 /* Only create a process if we're going to be around a while. */ if (spa_create_process strcmp(spa-spa_name, TRYIMPORT_NAME) != 0) { if (newproc(spa_thread, (caddr_t)spa, syscid, maxclsyspri, @@ -773,7 +775,8 @@ spa-spa_name); #endif } - } + } +#endif mutex_exit(spa-spa_proc_lock); /* If we didn't create a process, we need to create our taskqs. */
CVS commit: src/external/cddl/osnet/include
Module Name:src Committed By: haad Date: Mon May 10 06:26:11 UTC 2010 Modified Files: src/external/cddl/osnet/include: thread.h Log Message: If thread_create was called with thread_id = NULL use our local thread id as replacement otherwise we will crash. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/include/thread.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/include/thread.h diff -u src/external/cddl/osnet/include/thread.h:1.2 src/external/cddl/osnet/include/thread.h:1.3 --- src/external/cddl/osnet/include/thread.h:1.2 Mon May 3 00:31:32 2010 +++ src/external/cddl/osnet/include/thread.h Mon May 10 06:26:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: thread.h,v 1.2 2010/05/03 00:31:32 haad Exp $ */ +/* $NetBSD: thread.h,v 1.3 2010/05/10 06:26:11 haad Exp $ */ /* * CDDL HEADER START @@ -91,9 +91,16 @@ if(flags THR_DETACHED) pthread_attr_setdetachstate(attr, PTHREAD_CREATE_DETACHED); + thread_t th_id; + thread_t *t_id; + if(new_thread_ID != NULL) + t_id = new_thread_ID; + else + t_id = th_id; + /* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */ - ret = pthread_create(new_thread_ID, attr, start_func, arg); + ret = pthread_create(t_id, attr, start_func, arg); pthread_attr_destroy(attr);
CVS commit: src/external/cddl/osnet/lib/libumem
Module Name:src Committed By: haad Date: Mon May 10 06:27:57 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libumem: Makefile Log Message: Disable building of stub_stand.c we build all locking primitives in libzpool. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/lib/libumem/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libumem/Makefile diff -u src/external/cddl/osnet/lib/libumem/Makefile:1.4 src/external/cddl/osnet/lib/libumem/Makefile:1.5 --- src/external/cddl/osnet/lib/libumem/Makefile:1.4 Sun Feb 28 22:45:45 2010 +++ src/external/cddl/osnet/lib/libumem/Makefile Mon May 10 06:27:57 2010 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.4 2010/02/28 22:45:45 haad Exp $ +# $NetBSD: Makefile,v 1.5 2010/05/10 06:27:57 haad Exp $ LIB= umem -SRCS= umem.c stub_stand.c +SRCS= umem.c .include ../../Makefile.zfs .include bsd.lib.mk
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: haad Date: Thu May 6 22:31:46 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: arc.c Log Message: Fix difference btween solaris cv_timedwait and NetBSD one. NetBSD takes offset from current time and solaris exact time from unix born. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.7 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.8 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.7 Sat Apr 3 19:01:15 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Thu May 6 22:31:46 2010 @@ -4487,7 +4487,7 @@ (void) cv_timedwait(l2arc_feed_thr_cv, l2arc_feed_thr_lock, (hz * l2arc_feed_secs)); CALLB_CPR_SAFE_END(cpr, l2arc_feed_thr_lock); - next = ddi_get_lbolt() + hz; + next = ddi_get_lbolt(); /* * Quick check for L2ARC devices.
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: haad Date: Thu May 6 22:35:37 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: arc.c Log Message: Disable uvm_reclaim_hook for userland builds. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.8 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.9 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.8 Thu May 6 22:31:46 2010 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Thu May 6 22:35:37 2010 @@ -174,7 +174,10 @@ #include sys/callback.h /* Structures used for memory and kva space reclaim. */ static struct callback_entry arc_kva_reclaim_entry; + +#ifdef _KERNEL static struct uvm_reclaim_hook arc_hook; +#endif #endif /* __NetBSD__ */
CVS commit: src/external/cddl/osnet/lib/libzpool
Module Name:src Committed By: haad Date: Sun May 2 23:50:34 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzpool: kernel.c Log Message: Initialize system_taskq during taskq init. This fixes ztest crash in taskq_dispatch. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/lib/libzpool/kernel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libzpool/kernel.c diff -u src/external/cddl/osnet/lib/libzpool/kernel.c:1.3 src/external/cddl/osnet/lib/libzpool/kernel.c:1.4 --- src/external/cddl/osnet/lib/libzpool/kernel.c:1.3 Mon Mar 1 21:13:10 2010 +++ src/external/cddl/osnet/lib/libzpool/kernel.c Sun May 2 23:50:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.c,v 1.3 2010/03/01 21:13:10 haad Exp $ */ +/* $NetBSD: kernel.c,v 1.4 2010/05/02 23:50:34 haad Exp $ */ /* * CDDL HEADER START @@ -29,7 +29,7 @@ #pragma ident %Z%%M% %I% %E% SMI #include sys/cdefs.h -__RCSID($NetBSD: kernel.c,v 1.3 2010/03/01 21:13:10 haad Exp $); +__RCSID($NetBSD: kernel.c,v 1.4 2010/05/02 23:50:34 haad Exp $); #include sys/zfs_context.h #include sys/sysctl.h @@ -597,6 +597,8 @@ snprintf(hw_serial, sizeof (hw_serial), %ld, gethostid()); + system_taskq_init(); + spa_init(mode); }
CVS commit: src/external/cddl/osnet/lib/libumem
Module Name:src Committed By: haad Date: Sun May 2 23:59:54 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libumem: umem.c Log Message: In NetBSD pool cache constructor/destructor routines has inverted arguments. C To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libumem/umem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libumem/umem.c diff -u src/external/cddl/osnet/lib/libumem/umem.c:1.1 src/external/cddl/osnet/lib/libumem/umem.c:1.2 --- src/external/cddl/osnet/lib/libumem/umem.c:1.1 Fri Aug 7 20:57:56 2009 +++ src/external/cddl/osnet/lib/libumem/umem.c Sun May 2 23:59:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: umem.c,v 1.1 2009/08/07 20:57:56 haad Exp $ */ +/* $NetBSD: umem.c,v 1.2 2010/05/02 23:59:54 haad Exp $ */ /* * CDDL HEADER START @@ -135,7 +135,8 @@ } if(cache-constructor != NULL) { - if(cache-constructor(buf, cache-callback_data, flags) != 0) { + /* XXX NetBSD pool cache costructor has switched arguments. */ + if(cache-constructor(cache-callback_data, buf, flags) != 0) { free(buf); if(!(flags UMEM_NOFAIL)) return NULL; @@ -155,7 +156,8 @@ void umem_cache_free(umem_cache_t *cache, void *buffer) { if(cache-destructor != NULL) - cache-destructor(buffer, cache-callback_data); + /* XXX NetBSD pool cache costructor has switched arguments. */ + cache-destructor(cache-callback_data, buffer); free(buffer); }
CVS commit: src/external/cddl/osnet/include
Module Name:src Committed By: haad Date: Mon May 3 00:31:32 UTC 2010 Modified Files: src/external/cddl/osnet/include: thread.h Log Message: Add _mutex_held routine to test if mutex_t * is held. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/include/thread.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/include/thread.h diff -u src/external/cddl/osnet/include/thread.h:1.1 src/external/cddl/osnet/include/thread.h:1.2 --- src/external/cddl/osnet/include/thread.h:1.1 Fri Aug 7 20:57:55 2009 +++ src/external/cddl/osnet/include/thread.h Mon May 3 00:31:32 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: thread.h,v 1.1 2009/08/07 20:57:55 haad Exp $ */ +/* $NetBSD: thread.h,v 1.2 2010/05/03 00:31:32 haad Exp $ */ /* * CDDL HEADER START @@ -52,6 +52,7 @@ #define thr_main() (1) #define _mutex_init(l,f,a) pthread_mutex_init(l,NULL) #define _mutex_destroy(l) pthread_mutex_destroy(l) +#define _mutex_held(l) pthread_mutex_held_np(l) #define mutex_lock(l) pthread_mutex_lock(l) #define mutex_trylock(l) pthread_mutex_trylock(l) #define mutex_unlock(l) pthread_mutex_unlock(l)
CVS commit: src/share/mk
Module Name:src Committed By: haad Date: Sat Mar 13 17:07:28 UTC 2010 Modified Files: src/share/mk: bsd.own.mk Log Message: Enable MKZFS by default on i386 and amd64 now when it compiles. To generate a diff of this commit: cvs rdiff -u -r1.621 -r1.622 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.621 src/share/mk/bsd.own.mk:1.622 --- src/share/mk/bsd.own.mk:1.621 Mon Mar 8 09:32:18 2010 +++ src/share/mk/bsd.own.mk Sat Mar 13 17:07:28 2010 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.621 2010/03/08 09:32:18 he Exp $ +# $NetBSD: bsd.own.mk,v 1.622 2010/03/13 17:07:28 haad Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -725,7 +725,7 @@ MKMANDOC MKMANZ MKOBJDIRS \ MKPCC MKPCCCMDS \ MKSOFTFLOAT MKSTRIPIDENT \ - MKUNPRIVED MKUPDATE MKX11 MKZFS + MKUNPRIVED MKUPDATE MKX11 .for var in ${_MKVARS.no} ${var}?=no .endfor
CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl
Module Name:src Committed By: haad Date: Fri Mar 12 16:24:40 UTC 2010 Modified Files: src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c Log Message: Fix /var/run/dev.db dependency by adding new get_dev_name routine which converts raw device major:minor number to block device path. By reading /dev and using stat to find block device major:minor numbers. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.7 --- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6 Wed Dec 9 00:15:51 2009 +++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c Fri Mar 12 16:24:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: libdm-nbsd-iface.c,v 1.6 2009/12/09 00:15:51 haad Exp $*/ +/* $NetBSD: libdm-nbsd-iface.c,v 1.7 2010/03/12 16:24:40 haad Exp $*/ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -358,6 +358,45 @@ return 1; } +static char * +get_dev_name(char *d_name, uint32_t d_major, uint32_t d_minor) +{ + static char d_buf[MAXPATHLEN]; + struct dirent *dire; + struct stat st; + DIR *dev_dir; + + int err; + char *name; + + dev_dir = opendir(/dev); + + while ((dire = readdir(dev_dir)) != NULL) { + + if (strstr(dire-d_name, d_name) == NULL) + continue; + + snprintf(d_buf, MAXPATHLEN, /dev/%s, dire-d_name); + + if ((err = stat(d_buf, st)) 0) + printf(stat failed with %d, err); + + if (st.st_mode S_IFBLK){ + if ((major(st.st_rdev) == d_major) (minor(st.st_rdev) == d_minor)) { +strncpy(d_buf, dire-d_name, strlen(dire-d_name) + 1); +name = d_buf; +break; + } + } + + memset(d_buf, '0', sizeof(d_buf)); + } + + (void)closedir(dev_dir); + + return name; +} + /* * @dev_major is major number of char device * @@ -409,16 +448,17 @@ dev = MKDEV(major,dev_minor); mode |= S_IFBLK; - - name = devname(dev,mode); + + if ((name = devname(dev,mode)) == NULL) + name = get_dev_name(kd[i].d_name, major, dev_minor); r = snprintf(buf, (size_t) bufsize, /dev/%s,name); free(kd); - + if (r 0 || r bufsize - 1 || name == NULL) return 0; - + return 1; }
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Fri Mar 12 16:26:26 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c Log Message: Disable disk_ioctl_switch fo device-mapper control device. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/dm/device-mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.19 src/sys/dev/dm/device-mapper.c:1.20 --- src/sys/dev/dm/device-mapper.c:1.19 Sat Feb 27 00:31:57 2010 +++ src/sys/dev/dm/device-mapper.c Fri Mar 12 16:26:26 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.19 2010/02/27 00:31:57 jakllsch Exp $ */ +/*$NetBSD: device-mapper.c,v 1.20 2010/03/12 16:26:26 haad Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -424,6 +424,10 @@ { dm_dev_t *dmv; + /* disk ioctls make sense only on block devices */ + if (minor(dev) == 0) + return ENOTTY; + switch(cmd) { case DIOCGWEDGEINFO: {
CVS commit: src
Module Name:src Committed By: haad Date: Thu Feb 11 23:13:46 UTC 2010 Modified Files: src/share/man/man9: kmem.9 src/sys/kern: subr_kmem.c src/sys/sys: kmem.h Log Message: Add kmem_asprintf rotuine which allocates string accordingly to format string from kmem pool. Allocated string is string length + 1 char for ending zero. Ok: a...@. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/kmem.9 cvs rdiff -u -r1.32 -r1.33 src/sys/kern/subr_kmem.c cvs rdiff -u -r1.3 -r1.4 src/sys/sys/kmem.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/kmem.9 diff -u src/share/man/man9/kmem.9:1.4 src/share/man/man9/kmem.9:1.5 --- src/share/man/man9/kmem.9:1.4 Sat Jan 23 00:54:43 2010 +++ src/share/man/man9/kmem.9 Thu Feb 11 23:13:46 2010 @@ -1,4 +1,4 @@ -.\ $NetBSD: kmem.9,v 1.4 2010/01/23 00:54:43 rmind Exp $ +.\ $NetBSD: kmem.9,v 1.5 2010/02/11 23:13:46 haad Exp $ .\ .\ Copyright (c)2006 YAMAMOTO Takashi, .\ All rights reserved. @@ -45,6 +45,9 @@ .Ft void .Fn kmem_free \ void *p size_t size +.Ft char * +.Fn kmem_asprintf \ +const char *fmt ... .\ .Pp .Cd options DEBUG @@ -93,6 +96,16 @@ except that it initializes the memory to zero. .Pp .\ +.Fn kmem_asprintf +functions as the well known +.Fn asprintf +function, but allocates memory using +.Fn kmem_alloc . +This routine can sleep during allocation. +The size of the allocated area is the length of the returned character string, plus one (for the NUL terminator). +This must be taken into consideration when freeing the returned area with +.Fn kmem_free . +.\ .Fn kmem_free frees kernel wired memory allocated by .Fn kmem_alloc Index: src/sys/kern/subr_kmem.c diff -u src/sys/kern/subr_kmem.c:1.32 src/sys/kern/subr_kmem.c:1.33 --- src/sys/kern/subr_kmem.c:1.32 Sun Jan 31 11:54:32 2010 +++ src/sys/kern/subr_kmem.c Thu Feb 11 23:13:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_kmem.c,v 1.32 2010/01/31 11:54:32 skrll Exp $ */ +/* $NetBSD: subr_kmem.c,v 1.33 2010/02/11 23:13:46 haad Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.32 2010/01/31 11:54:32 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.33 2010/02/11 23:13:46 haad Exp $); #include sys/param.h #include sys/callback.h @@ -79,6 +79,8 @@ #include lib/libkern/libkern.h +#include machine/stdarg.h + #define KMEM_QUANTUM_SIZE (ALIGNBYTES + 1) #define KMEM_QCACHE_MAX (KMEM_QUANTUM_SIZE * 32) #define KMEM_CACHE_COUNT 16 @@ -456,3 +458,28 @@ } } #endif /* defined(KMEM_SIZE) */ + +/* + * Used to dynamically allocate string with kmem accordingly to format. + */ +char * +kmem_asprintf(const char *fmt, ...) +{ + int size, str_len; + va_list va; + char *str; + char buf[1]; + + va_start(va, fmt); + str_len = vsnprintf(buf, sizeof(buf), fmt, va) + 1; + va_end(va); + + str = kmem_alloc(str_len, KM_SLEEP); + + if ((size = vsnprintf(str, str_len, fmt, va)) == -1) { + kmem_free(str, str_len); + return NULL; + } + + return str; +} Index: src/sys/sys/kmem.h diff -u src/sys/sys/kmem.h:1.3 src/sys/sys/kmem.h:1.4 --- src/sys/sys/kmem.h:1.3 Mon Dec 24 16:45:16 2007 +++ src/sys/sys/kmem.h Thu Feb 11 23:13:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kmem.h,v 1.3 2007/12/24 16:45:16 ad Exp $ */ +/* $NetBSD: kmem.h,v 1.4 2010/02/11 23:13:46 haad Exp $ */ /*- * Copyright (c)2006 YAMAMOTO Takashi, @@ -39,6 +39,7 @@ void kmem_init(void); size_t kmem_roundup_size(size_t); +char *kmem_asprintf(const char *, ...); /* * km_flag_t *
CVS commit: src
Module Name:src Committed By: haad Date: Thu Feb 11 23:16:35 UTC 2010 Modified Files: src/share/man/man9: vnode.9 src/sys/kern: vfs_subr.c src/sys/sys: vnode.h Log Message: Add vrele_async routine which asynchronously release vnodes in different contex and in some time in the future. Ok: a...@. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/share/man/man9/vnode.9 cvs rdiff -u -r1.397 -r1.398 src/sys/kern/vfs_subr.c cvs rdiff -u -r1.213 -r1.214 src/sys/sys/vnode.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/vnode.9 diff -u src/share/man/man9/vnode.9:1.44 src/share/man/man9/vnode.9:1.45 --- src/share/man/man9/vnode.9:1.44 Fri Jan 8 13:15:46 2010 +++ src/share/man/man9/vnode.9 Thu Feb 11 23:16:35 2010 @@ -1,4 +1,4 @@ -.\ $NetBSD: vnode.9,v 1.44 2010/01/08 13:15:46 pooka Exp $ +.\ $NetBSD: vnode.9,v 1.45 2010/02/11 23:16:35 haad Exp $ .\ .\ Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -34,6 +34,7 @@ .Nm vnode , .Nm vref , .Nm vrele , +.Nm vrele_async , .Nm vget , .Nm vput , .Nm vhold , @@ -62,6 +63,8 @@ .Fn vref struct vnode *vp .Ft void .Fn vrele struct vnode *vp +.Ft void +.Fn vrele_async struct vnode *vp .Ft int .Fn vget struct vnode *vp int lockflag .Ft void @@ -246,6 +249,7 @@ This count is maintained by .Fn vref , .Fn vrele , +.Fn vrele_async , and .Fn vput . The second is the number of active references within the kernel to the @@ -531,6 +535,8 @@ .Em v_holdcnt are zero, the vnode is placed on the freelist. .It Fn vget vp lockflags +.It Fn vrele_async vp +Will asychronously release vnode in different context than caller, sometime in future. Reclaim vnode .Fa vp from the freelist, increment its reference count and lock it. Index: src/sys/kern/vfs_subr.c diff -u src/sys/kern/vfs_subr.c:1.397 src/sys/kern/vfs_subr.c:1.398 --- src/sys/kern/vfs_subr.c:1.397 Fri Jan 15 19:28:26 2010 +++ src/sys/kern/vfs_subr.c Thu Feb 11 23:16:35 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.397 2010/01/15 19:28:26 bouyer Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.398 2010/02/11 23:16:35 haad Exp $ */ /*- * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc. @@ -91,7 +91,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.397 2010/01/15 19:28:26 bouyer Exp $); +__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.398 2010/02/11 23:16:35 haad Exp $); #include opt_ddb.h #include opt_compat_netbsd.h @@ -1424,8 +1424,12 @@ /* * XXX This ugly block can be largely eliminated if * locking is pushed down into the file systems. + * + * Defer vnode release to vrele_thread if caller + * requests it explicitly. */ - if (curlwp == uvm.pagedaemon_lwp) { + if ((curlwp == uvm.pagedaemon_lwp) || + (flags VRELEL_ASYNC_RELE) != 0) { /* The pagedaemon can't wait around; defer. */ defer = true; } else if (curlwp == vrele_lwp) { @@ -1599,6 +1603,23 @@ vrelel(vp, 0); } +/* + * Asynchronous vnode release, vnode is released in different context. + */ +void +vrele_async(vnode_t *vp) +{ + + KASSERT((vp-v_iflag VI_MARKER) == 0); + + if ((vp-v_iflag VI_INACTNOW) == 0 vtryrele(vp)) { + return; + } + + mutex_enter(vp-v_interlock); + vrelel(vp, VRELEL_ASYNC_RELE); +} + static void vrele_thread(void *cookie) { Index: src/sys/sys/vnode.h diff -u src/sys/sys/vnode.h:1.213 src/sys/sys/vnode.h:1.214 --- src/sys/sys/vnode.h:1.213 Wed Jan 27 15:34:08 2010 +++ src/sys/sys/vnode.h Thu Feb 11 23:16:35 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vnode.h,v 1.213 2010/01/27 15:34:08 uebayasi Exp $ */ +/* $NetBSD: vnode.h,v 1.214 2010/02/11 23:16:35 haad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -601,6 +601,7 @@ void vput(struct vnode *); int vrecycle(struct vnode *, kmutex_t *, struct lwp *); void vrele(struct vnode *); +void vrele_async(struct vnode *); int vtruncbuf(struct vnode *, daddr_t, bool, int); void vwakeup(struct buf *); void vwait(struct vnode *, int); @@ -609,6 +610,7 @@ void vrelel(struct vnode *, int); #define VRELEL_NOINACTIVE 0x01 #define VRELEL_ONHEAD 0x02 +#define VRELEL_ASYNC_RELE 0x03 struct vnode * vnalloc(struct mount *); void vnfree(struct vnode *);
CVS commit: src
Module Name:src Committed By: haad Date: Thu Feb 11 23:28:53 UTC 2010 Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile Log Message: Hook kmem_asprintf and vrele_async manpages to the build. To generate a diff of this commit: cvs rdiff -u -r1.1388 -r1.1389 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.314 -r1.315 src/share/man/man9/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1388 src/distrib/sets/lists/comp/mi:1.1389 --- src/distrib/sets/lists/comp/mi:1.1388 Thu Feb 11 02:29:23 2010 +++ src/distrib/sets/lists/comp/mi Thu Feb 11 23:28:53 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1388 2010/02/11 02:29:23 pooka Exp $ +# $NetBSD: mi,v 1.1389 2010/02/11 23:28:53 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -8999,6 +8999,7 @@ ./usr/share/man/cat9/kmem_alloc.0 comp-sys-catman .cat ./usr/share/man/cat9/kmem_free.0 comp-sys-catman .cat ./usr/share/man/cat9/kmem_zalloc.0 comp-sys-catman .cat +./usr/share/man/cat9/kmem_asprintf.0 comp-sys-catman .cat ./usr/share/man/cat9/knote.0 comp-sys-catman .cat ./usr/share/man/cat9/kpause.0 comp-sys-catman .cat ./usr/share/man/cat9/kpreempt.0 comp-sys-catman .cat @@ -9652,6 +9653,7 @@ ./usr/share/man/cat9/vrecycle.0 comp-sys-catman .cat ./usr/share/man/cat9/vref.0 comp-sys-catman .cat ./usr/share/man/cat9/vrele.0 comp-sys-catman .cat +./usr/share/man/cat9/vrele_async.0 comp-sys-catman .cat ./usr/share/man/cat9/vslock.0 comp-obsolete obsolete ./usr/share/man/cat9/vsnprintf.0 comp-sys-catman .cat ./usr/share/man/cat9/vsprintf.0 comp-sys-catman .cat @@ -14574,6 +14576,7 @@ ./usr/share/man/html9/kmem_alloc.html comp-sys-htmlman html ./usr/share/man/html9/kmem_free.html comp-sys-htmlman html ./usr/share/man/html9/kmem_zalloc.html comp-sys-htmlman html +./usr/share/man/html9/kmem_asprintf.html comp-sys-htmlman html ./usr/share/man/html9/knote.html comp-sys-htmlman html ./usr/share/man/html9/kpause.html comp-sys-htmlman html ./usr/share/man/html9/kpreempt.html comp-sys-htmlman html @@ -15179,6 +15182,7 @@ ./usr/share/man/html9/vrecycle.html comp-sys-htmlman html ./usr/share/man/html9/vref.html comp-sys-htmlman html ./usr/share/man/html9/vrele.html comp-sys-htmlman html +./usr/share/man/html9/vrele_async.html comp-sys-htmlman html ./usr/share/man/html9/vsnprintf.html comp-sys-htmlman html ./usr/share/man/html9/vsprintf.html comp-sys-htmlman html ./usr/share/man/html9/vtruncbuf.html comp-sys-htmlman html @@ -20308,6 +20312,7 @@ ./usr/share/man/man9/kmem_alloc.9 comp-sys-man .man ./usr/share/man/man9/kmem_free.9 comp-sys-man .man ./usr/share/man/man9/kmem_zalloc.9 comp-sys-man .man +./usr/share/man/man9/kmem_asprintf.9 comp-sys-man .man ./usr/share/man/man9/knote.9 comp-sys-man .man ./usr/share/man/man9/kpause.9 comp-sys-man .man ./usr/share/man/man9/kpreempt.9 comp-sys-man .man @@ -20961,6 +20966,7 @@ ./usr/share/man/man9/vrecycle.9 comp-sys-man .man ./usr/share/man/man9/vref.9 comp-sys-man .man ./usr/share/man/man9/vrele.9 comp-sys-man .man +./usr/share/man/man9/vrele_async.9 comp-sys-man .man ./usr/share/man/man9/vslock.9 comp-obsolete obsolete ./usr/share/man/man9/vsnprintf.9 comp-sys-man .man ./usr/share/man/man9/vsprintf.9 comp-sys-man .man Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.314 src/share/man/man9/Makefile:1.315 --- src/share/man/man9/Makefile:1.314 Sat Feb 6 22:32:08 2010 +++ src/share/man/man9/Makefile Thu Feb 11 23:28:53 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.314 2010/02/06 22:32:08 dyoung Exp $ +# $NetBSD: Makefile,v 1.315 2010/02/11 23:28:53 haad Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -345,7 +345,7 @@ isapnp.9 isapnp_unconfig.9 MLINKS+=knote.9 KNOTE.9 \ kfilter_register.9 kfilter_unregister.9 -MLINKS+=kmem.9 kmem_alloc.9 kmem.9 kmem_free.9 kmem.9 kmem_zalloc.9 +MLINKS+=kmem.9 kmem_alloc.9 kmem.9 kmem_free.9 kmem.9 kmem_zalloc.9 kmem_asprintf.9 MAN+= kpreempt.9 MLINKS+=kpreempt.9 kpreempt_disable.9 \ kpreempt.9 kpreempt_disabled.9 \ @@ -756,6 +756,7 @@ vmem.9 vmem_xfree.9 MLINKS+=vnode.9 vref.9 \ vnode.9 vrele.9 \ + vnode.9 vrele_async.9 \ vnode.9 vget.9 \ vnode.9 vput.9 \ vnode.9 vhold.9 \
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: haad Date: Sun Jan 17 12:08:29 UTC 2010 Modified Files: src/sys/arch/xen/xen: xbdback_xenbus.c Log Message: Fix problem where xbdi-xbdi_size was set to 0 after succesfull DIOCGWEDGEINFO call. Problem reported in private mail. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/xen/xen/xbdback_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/xen/xen/xbdback_xenbus.c diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.29 src/sys/arch/xen/xen/xbdback_xenbus.c:1.30 --- src/sys/arch/xen/xen/xbdback_xenbus.c:1.29 Tue Dec 15 00:19:52 2009 +++ src/sys/arch/xen/xen/xbdback_xenbus.c Sun Jan 17 12:08:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: xbdback_xenbus.c,v 1.29 2009/12/15 00:19:52 haad Exp $ */ +/* $NetBSD: xbdback_xenbus.c,v 1.30 2010/01/17 12:08:29 haad Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.29 2009/12/15 00:19:52 haad Exp $); +__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.30 2010/01/17 12:08:29 haad Exp $); #include sys/types.h #include sys/param.h @@ -731,9 +731,9 @@ for domain %d\n, wi.dkw_devname, xbdi-xbdi_size, xbdi-xbdi_domid); } - /* ENOTTY should be returned only when device doesn't implement - DIOCGWEDGEINFO and we are working with non wedge like device. */ - if (err != ENOTTY) { + if ((err != 0) (err != ENOTTY)) { + /* ENOTTY should be returned only when device doesn't implement + DIOCGWEDGEINFO and we are working with non wedge like device. */ printf(xbdback %s: can't DIOCGWEDGEINFO device 0x%PRIx64: %d\n, xbusd-xbusd_path, xbdi-xbdi_dev, err);
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs
Module Name:src Committed By: haad Date: Sun Jan 10 01:35:39 UTC 2010 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_replay.c Log Message: Fix problem in ZFS ZIL layer where unclean shutdown of filesystem can change replayed file permissions to 777. Patch from FreeBSD. Original commit message: Be careful which vattr fields are set during setattr replay. Without this fix strange things can appear after unclean shutdown like files with mode set to 0. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c:1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c:1.3 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c:1.2 Fri Aug 7 20:16:45 2009 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c Sun Jan 10 01:35:39 2010 @@ -60,10 +60,14 @@ { VATTR_NULL(vap); vap-va_mask = (uint_t)mask; - vap-va_type = IFTOVT(mode); - vap-va_mode = mode MODEMASK; - vap-va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid; - vap-va_gid = (gid_t)(IS_EPHEMERAL(gid)) ? -1 : gid; + if (mask AT_TYPE) + vap-va_type = IFTOVT(mode); + if (mask AT_MODE) + vap-va_mode = mode MODEMASK; + if (mask AT_UID) + vap-va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid; + if (mask AT_GID) + vap-va_gid = (gid_t)(IS_EPHEMERAL(gid)) ? -1 : gid; vap-va_rdev = zfs_cmpldev(rdev); vap-va_nodeid = nodeid; }
CVS commit: src
Module Name:src Committed By: haad Date: Mon Jan 4 16:57:48 UTC 2010 Modified Files: src/distrib/sets/lists/man: mi src/share/man/man4: Makefile Log Message: Add device-mapper manual page to build and add it to apropriate lists. To generate a diff of this commit: cvs rdiff -u -r1.1178 -r1.1179 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.499 -r1.500 src/share/man/man4/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1178 src/distrib/sets/lists/man/mi:1.1179 --- src/distrib/sets/lists/man/mi:1.1178 Tue Dec 15 03:01:16 2009 +++ src/distrib/sets/lists/man/mi Mon Jan 4 16:57:48 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1178 2009/12/15 03:01:16 mrg Exp $ +# $NetBSD: mi,v 1.1179 2010/01/04 16:57:48 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -858,7 +858,8 @@ ./usr/share/man/cat4/depca.0 man-sys-catman .cat ./usr/share/man/cat4/dge.0 man-sys-catman .cat ./usr/share/man/cat4/dk.0 man-sys-catman .cat -./usr/share/man/cat4/dmoverio.0 man-sys-catman .cat +./usr/share/man/cat4/dm.0 man-sys-catman .cat +./usr/share/man/cat4/dmoverio.0 man-sys-catman .cat ./usr/share/man/cat4/dmphy.0 man-sys-catman .cat ./usr/share/man/cat4/dpt.0 man-sys-catman .cat ./usr/share/man/cat4/dpti.0 man-sys-catman .cat @@ -3489,6 +3490,7 @@ ./usr/share/man/html4/depca.html man-sys-htmlman html ./usr/share/man/html4/dge.html man-sys-htmlman html ./usr/share/man/html4/dk.html man-sys-htmlman html +./usr/share/man/html4/dm.html man-sys-htmlman html ./usr/share/man/html4/dmoverio.html man-sys-htmlman html ./usr/share/man/html4/dmphy.html man-sys-htmlman html ./usr/share/man/html4/dpt.html man-sys-htmlman html @@ -4654,7 +4656,7 @@ ./usr/share/man/html8/iteconfig.html man-sysutil-htmlman html ./usr/share/man/html8/iwictl.html man-sysutil-htmlman html ./usr/share/man/html8/kadmin.html man-krb5-htmlman kerberos,html -./usr/share/man/html8/kadmind.html man-krb5-htmlman kerberos,html +./usr/share/man/html8/kamind.html man-krb5-htmlman kerberos,html ./usr/share/man/html8/kcm.html man-krb5-htmlman kerberos,html ./usr/share/man/html8/kdc.html man-krb5-htmlman kerberos,html ./usr/share/man/html8/kerberos.html man-krb5-htmlman kerberos,html @@ -5898,6 +5900,7 @@ ./usr/share/man/man4/depca.4 man-sys-man .man ./usr/share/man/man4/dge.4 man-sys-man .man ./usr/share/man/man4/dk.4 man-sys-man .man +./usr/share/man/man4/dm.4 man-sys-man .man ./usr/share/man/man4/dmoverio.4 man-sys-man .man ./usr/share/man/man4/dmphy.4 man-sys-man .man ./usr/share/man/man4/dpt.4 man-sys-man .man Index: src/share/man/man4/Makefile diff -u src/share/man/man4/Makefile:1.499 src/share/man/man4/Makefile:1.500 --- src/share/man/man4/Makefile:1.499 Wed Sep 30 22:32:04 2009 +++ src/share/man/man4/Makefile Mon Jan 4 16:57:48 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.499 2009/09/30 22:32:04 jmcneill Exp $ +# $NetBSD: Makefile,v 1.500 2010/01/04 16:57:48 haad Exp $ # @(#)Makefile 8.1 (Berkeley) 6/18/93 MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 acpidalb.4 \ @@ -19,7 +19,7 @@ cec.4 cgd.4 cfb.4 ch.4 chipsfb.4 ciphy.4 ciss.4 clcs.4 clct.4 clnp.4 \ clockctl.4 cltp.4 cmdide.4 cmpci.4 cms.4 cnw.4 \ com.4 coretemp.4 crypto.4 cs80bus.4 cuda.4 cypide.4 \ - ddb.4 ddc.4 de.4 dge.4 dk.4 dmoverio.4 \ + ddb.4 ddc.4 de.4 dge.4 dk.4 dm.4 dmoverio.4 \ dmphy.4 dpt.4 dpti.4 drm.4 drum.4 \ eap.4 ebus.4 edc.4 elmc.4 emuxki.4 en.4 envsys.4 ep.4 esh.4 esis.4 \ esa.4 esiop.4 esm.4 eso.4 etherip.4 exphy.4 \
CVS commit: src/distrib/sets/lists/man
Module Name:src Committed By: haad Date: Mon Jan 4 20:18:02 UTC 2010 Modified Files: src/distrib/sets/lists/man: mi Log Message: Revert my unattended change to kadmind.html page To generate a diff of this commit: cvs rdiff -u -r1.1179 -r1.1180 src/distrib/sets/lists/man/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1179 src/distrib/sets/lists/man/mi:1.1180 --- src/distrib/sets/lists/man/mi:1.1179 Mon Jan 4 16:57:48 2010 +++ src/distrib/sets/lists/man/mi Mon Jan 4 20:18:02 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1179 2010/01/04 16:57:48 haad Exp $ +# $NetBSD: mi,v 1.1180 2010/01/04 20:18:02 haad Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -4656,7 +4656,7 @@ ./usr/share/man/html8/iteconfig.html man-sysutil-htmlman html ./usr/share/man/html8/iwictl.html man-sysutil-htmlman html ./usr/share/man/html8/kadmin.html man-krb5-htmlman kerberos,html -./usr/share/man/html8/kamind.html man-krb5-htmlman kerberos,html +./usr/share/man/html8/kadmind.html man-krb5-htmlman kerberos,html ./usr/share/man/html8/kcm.html man-krb5-htmlman kerberos,html ./usr/share/man/html8/kdc.html man-krb5-htmlman kerberos,html ./usr/share/man/html8/kerberos.html man-krb5-htmlman kerberos,html @@ -5900,7 +5900,7 @@ ./usr/share/man/man4/depca.4 man-sys-man .man ./usr/share/man/man4/dge.4 man-sys-man .man ./usr/share/man/man4/dk.4 man-sys-man .man -./usr/share/man/man4/dm.4 man-sys-man .man +./usr/share/man/man4/dm.4 man-sys-man .man ./usr/share/man/man4/dmoverio.4 man-sys-man .man ./usr/share/man/man4/dmphy.4 man-sys-man .man ./usr/share/man/man4/dpt.4 man-sys-man .man
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Sun Jan 3 12:53:00 UTC 2010 Modified Files: src/sys/dev/dm: dm_pdev.c Log Message: Replace aprint_Verbose with aprint_debug to shutup unnecessary logs. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/dm/dm_pdev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_pdev.c diff -u src/sys/dev/dm/dm_pdev.c:1.4 src/sys/dev/dm/dm_pdev.c:1.5 --- src/sys/dev/dm/dm_pdev.c:1.4 Wed Sep 9 22:38:49 2009 +++ src/sys/dev/dm/dm_pdev.c Sun Jan 3 12:53:00 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_pdev.c,v 1.4 2009/09/09 22:38:49 haad Exp $ */ +/*$NetBSD: dm_pdev.c,v 1.5 2010/01/03 12:53:00 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -94,7 +94,7 @@ if (dmp != NULL) { dmp-ref_cnt++; - aprint_verbose(dmp_pdev_insert pdev %s already in tree\n,dev_name); + aprint_debug(dmp_pdev_insert pdev %s already in tree\n,dev_name); mutex_exit(dm_pdev_mutex); return dmp; } @@ -105,7 +105,7 @@ error = dk_lookup(dev_name, curlwp, dmp-pdev_vnode, UIO_SYSSPACE); if (error) { - aprint_verbose(dk_lookup on device: %s failed with error %d!\n, + aprint_debug(dk_lookup on device: %s failed with error %d!\n, dev_name, error); kmem_free(dmp, sizeof(dm_pdev_t)); return NULL;
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Sun Jan 3 22:22:23 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c dm_ioctl.c files.dm Log Message: Hook device-mapper to autoconf framework. Add dm_attach, dm_match and dm_detach routines used by autoconf users. Change dm_dev_remove_ioctl to call dm_detach. This should be primary used by kernel to disable devices during shutdown of system with nested disk devices. Requested by dyo...@. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/dm/device-mapper.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/dm/dm_ioctl.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/dm/files.dm Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.11 src/sys/dev/dm/device-mapper.c:1.12 --- src/sys/dev/dm/device-mapper.c:1.11 Tue Dec 29 23:37:47 2009 +++ src/sys/dev/dm/device-mapper.c Sun Jan 3 22:22:23 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.11 2009/12/29 23:37:47 haad Exp $ */ +/*$NetBSD: device-mapper.c,v 1.12 2010/01/03 22:22:23 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -38,6 +38,7 @@ #include sys/buf.h #include sys/conf.h +#include sys/device.h #include sys/dkio.h #include sys/disk.h #include sys/disklabel.h @@ -58,14 +59,19 @@ static dev_type_size(dmsize); /* attach and detach routines */ -int dmattach(void); -int dmdestroy(void); +static int dmattach(void); +static int dmdestroy(void); static int dm_cmd_to_fun(prop_dictionary_t); static int disk_ioctl_switch(dev_t, u_long, void *); static int dm_ioctl_switch(u_long); static void dmminphys(struct buf *); +/* CF attach/detach functions used for power management */ +static int dm_detach(device_t, int); +static void dm_attach(device_t, device_t, void *); +static int dm_match(device_t, cfdata_t, void *); + /* ***Variable-definitions*** */ const struct bdevsw dm_bdevsw = { .d_open = dmopen, @@ -95,6 +101,14 @@ .d_strategy = dmstrategy }; +/* Autoconf defines */ +CFDRIVER_DECL(dm, DV_DISK, NULL); +CFATTACH_DECL3_NEW(dm, 0, + dm_match, dm_attach, dm_detach, NULL, NULL, NULL, + DVF_DETACH_SHUTDOWN); + +extern struct cfdriver dm_cd; + extern uint64_t dev_counter; /* @@ -134,11 +148,27 @@ { #ifdef _MODULE int bmajor = -1, cmajor = -1; + int error; + + error = 0; switch (cmd) { case MODULE_CMD_INIT: dmattach(); - return devsw_attach(dm, dm_bdevsw, bmajor, + + error = config_cfdriver_attach(dm_cd); + if (error) + break; + + error = config_cfattach_attach(dm_cd.cd_name, dm_ca); + if (error) { + config_cfdriver_detach(dm_cd); + aprint_error(Unable to register cfattach for dm driver\n); + + break; + } + + error = devsw_attach(dm, dm_bdevsw, bmajor, dm_cdevsw, cmajor); break; @@ -152,7 +182,14 @@ if (dev_counter 0) return EBUSY; dmdestroy(); - return devsw_detach(dm_bdevsw, dm_cdevsw); + + error = config_cfattach_detach(dm_cd.cd_name, dm_ca); + if (error) + break; + + config_cfdriver_detach(dm_cd); + + devsw_detach(dm_bdevsw, dm_cdevsw); break; case MODULE_CMD_STAT: return ENOTTY; @@ -161,7 +198,7 @@ return ENOTTY; } - return 0; + return error; #else if (cmd == MODULE_CMD_INIT) @@ -172,10 +209,75 @@ } +/* + * dm_match: + * + * Autoconfiguration match function for pseudo-device glue. + */ +static int +dm_match(device_t parent, cfdata_t match, +void *aux) +{ + + /* Pseudo-device; always present. */ + return (1); +} + +/* + * dm_attach: + * + * Autoconfiguration attach function for pseudo-device glue. + */ +static void +dm_attach(device_t parent, device_t self, +void *aux) +{ + return; +} + + +/* + * dm_detach: + * + * Autoconfiguration detach function for pseudo-device glue. + * This routine is called by dm_ioctl::dm_dev_remove_ioctl and by autoconf to + * remove devices created in device-mapper. + */ +static int +dm_detach(device_t self, int flags) +{ + dm_dev_t *dmv; + + /* Detach device from global device list */ + if ((dmv = dm_dev_detach(self)) == NULL) + return ENOENT; + + /* Destroy active table first. */ + dm_table_destroy(dmv-table_head, DM_TABLE_ACTIVE); + + /* Destroy inactive table if exits, too. */ + dm_table_destroy(dmv-table_head, DM_TABLE_INACTIVE); + + dm_table_head_destroy(dmv-table_head); + + /* Destroy disk device structure */ + disk_detach(dmv-diskp); + disk_destroy(dmv-diskp); + + /* Destroy device */ + (void)dm_dev_free(dmv); + + /* Decrement device counter After removing device */ + atomic_dec_64(dev_counter); + + return 0; +} + /* attach routine */ -int +static int dmattach(void) { + dm_target_init(); dm_dev_init(); dm_pdev_init(); @@ -184,9 +286,10 @@ } /* Destroy routine */ -int +static int dmdestroy(void) { + dm_dev_destroy(); dm_pdev_destroy(); dm_target_destroy(); @@ -197,6 +300,7 @@ static int dmopen(dev_t
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Sun Jan 3 22:44:10 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c Log Message: KNF police, remove unnecessary whitespaces and tabulators. Refactor dmioctl to not use prop_dictionary_copy* functions if NetBSD_DM_IOCTL command was not called on device. If disk_ioctl returms anything else then ENOTTY exit from dmioctl. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/dm/device-mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.12 src/sys/dev/dm/device-mapper.c:1.13 --- src/sys/dev/dm/device-mapper.c:1.12 Sun Jan 3 22:22:23 2010 +++ src/sys/dev/dm/device-mapper.c Sun Jan 3 22:44:10 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.12 2010/01/03 22:22:23 haad Exp $ */ +/*$NetBSD: device-mapper.c,v 1.13 2010/01/03 22:44:10 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -139,7 +139,6 @@ {NULL, NULL} }; - MODULE(MODULE_CLASS_DRIVER, dm, NULL); /* New module handle routine */ @@ -301,7 +300,7 @@ dmopen(dev_t dev, int flags, int mode, struct lwp *l) { - aprint_debug(open routine called % PRIu32 \n, minor(dev)); + aprint_debug(dm open routine called % PRIu32 \n, minor(dev)); return 0; } @@ -309,7 +308,7 @@ dmclose(dev_t dev, int flags, int mode, struct lwp *l) { - aprint_debug(CLOSE routine called\n); + aprint_debug(dm close routine called % PRIu32 \n, minor(dev)); return 0; } @@ -326,9 +325,14 @@ KASSERT(data != NULL); - if (disk_ioctl_switch(dev, cmd, data) != 0) { + if (( r = disk_ioctl_switch(dev, cmd, data)) == ENOTTY) { struct plistref *pref = (struct plistref *) data; + /* Check if we were called with NETBSD_DM_IOCTL ioctl + otherwise quit. */ + if ((r = dm_ioctl_switch(cmd)) != 0) + return r; + if((r = prop_dictionary_copyin_ioctl(pref, cmd, dm_dict_in)) != 0) return r; @@ -337,18 +341,12 @@ return r; } - /* call cmd selected function */ - if ((r = dm_ioctl_switch(cmd)) != 0) { - prop_object_release(dm_dict_in); - return r; - } - /* run ioctl routine */ if ((r = dm_cmd_to_fun(dm_dict_in)) != 0) { prop_object_release(dm_dict_in); return r; } - + r = prop_dictionary_copyout_ioctl(pref, cmd, dm_dict_in); prop_object_release(dm_dict_in); @@ -366,10 +364,10 @@ prop_string_t command; r = 0; - + if ((command = prop_dictionary_get(dm_dict, DM_IOCTL_COMMAND)) == NULL) return EINVAL; - + for(i = 0; cmd_fn[i].cmd != NULL; i++) if (prop_string_equals_cstring(command, cmd_fn[i].cmd)) break; @@ -379,7 +377,7 @@ aprint_debug(ioctl %s called\n, cmd_fn[i].cmd); r = cmd_fn[i].fn(dm_dict); - + return r; } @@ -387,23 +385,19 @@ static int dm_ioctl_switch(u_long cmd) { - int r; - - r = 0; switch(cmd) { - + case NETBSD_DM_IOCTL: - aprint_debug(NetBSD_DM_IOCTL called\n); + aprint_debug(dm NetBSD_DM_IOCTL called\n); break; - default: - aprint_debug(unknown ioctl called\n); + aprint_debug(dm unknown ioctl called\n); return ENOTTY; break; /* NOT REACHED */ } - return r; + return 0; } /* @@ -414,21 +408,21 @@ disk_ioctl_switch(dev_t dev, u_long cmd, void *data) { dm_dev_t *dmv; - + switch(cmd) { case DIOCGWEDGEINFO: { struct dkwedge_info *dkw = (void *) data; if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL) - return ENOENT; - + return ENODEV; + aprint_debug(DIOCGWEDGEINFO ioctl called\n); - + strlcpy(dkw-dkw_devname, dmv-name, 16); strlcpy(dkw-dkw_wname, dmv-name, DM_NAME_LEN); strlcpy(dkw-dkw_parent, dmv-name, 16); - + dkw-dkw_offset = 0; dkw-dkw_size = dm_table_size(dmv-table_head); strcpy(dkw-dkw_ptype, DKW_PTYPE_FFS); @@ -442,8 +436,8 @@ struct plistref *pref = (struct plistref *) data; if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL) - return ENOENT; - + return ENODEV; + if (dmv-diskp-dk_info == NULL) { dm_dev_unbusy(dmv); return ENOTSUP; @@ -452,16 +446,15 @@ dmv-diskp-dk_info); dm_dev_unbusy(dmv); - break; } default: aprint_debug(unknown disk_ioctl called\n); - return 1; + return ENOTTY; break; /* NOT REACHED */ } - + return 0; } @@ -481,7 +474,7 @@ uint64_t buf_start, buf_len, issued_len; uint64_t table_start, table_end; uint64_t start, end; - + buf_start = bp-b_blkno * DEV_BSIZE; buf_len = bp-b_bcount; @@ -513,14 +506,14 @@ mutex_enter(dmv-diskp_mtx); disk_busy(dmv-diskp); mutex_exit(dmv-diskp_mtx); - + /* Select active table */ tbl = dm_table_get_entry(dmv-table_head, DM_TABLE_ACTIVE); /* Nested buffers count down to zero therefore I have to set bp-b_resid to maximal value. */ bp-b_resid = bp-b_bcount; - + /* * Find out what tables I want to
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Sun Jan 3 22:55:26 UTC 2010 Modified Files: src/sys/dev/dm: device-mapper.c Log Message: Refactor dmioctl to by cleaner and to copyout dictionary in case when something went wrong. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/dev/dm/device-mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/device-mapper.c diff -u src/sys/dev/dm/device-mapper.c:1.13 src/sys/dev/dm/device-mapper.c:1.14 --- src/sys/dev/dm/device-mapper.c:1.13 Sun Jan 3 22:44:10 2010 +++ src/sys/dev/dm/device-mapper.c Sun Jan 3 22:55:25 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: device-mapper.c,v 1.13 2010/01/03 22:44:10 haad Exp $ */ +/*$NetBSD: device-mapper.c,v 1.14 2010/01/03 22:55:25 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -336,19 +336,15 @@ if((r = prop_dictionary_copyin_ioctl(pref, cmd, dm_dict_in)) != 0) return r; - if ((r = dm_check_version(dm_dict_in)) != 0) { - prop_object_release(dm_dict_in); - return r; - } + if ((r = dm_check_version(dm_dict_in)) != 0) + goto cleanup_exit; /* run ioctl routine */ - if ((r = dm_cmd_to_fun(dm_dict_in)) != 0) { - prop_object_release(dm_dict_in); - return r; - } + if ((r = dm_cmd_to_fun(dm_dict_in)) != 0) + goto cleanup_exit; +cleanup_exit: r = prop_dictionary_copyout_ioctl(pref, cmd, dm_dict_in); - prop_object_release(dm_dict_in); }
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Mon Jan 4 00:12:22 UTC 2010 Modified Files: src/sys/dev/dm: dm_target_error.c dm_target_mirror.c dm_target_snapshot.c dm_target_zero.c Log Message: Indent files remove unnecessary blank lines, white spaces and KNFize code. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/dm/dm_target_error.c \ src/sys/dev/dm/dm_target_zero.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/dm/dm_target_mirror.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/dm/dm_target_snapshot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_target_error.c diff -u src/sys/dev/dm/dm_target_error.c:1.9 src/sys/dev/dm/dm_target_error.c:1.10 --- src/sys/dev/dm/dm_target_error.c:1.9 Tue Dec 1 23:12:10 2009 +++ src/sys/dev/dm/dm_target_error.c Mon Jan 4 00:12:22 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target_error.c,v 1.9 2009/12/01 23:12:10 haad Exp $ */ +/*$NetBSD: dm_target_error.c,v 1.10 2010/01/04 00:12:22 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -58,15 +58,15 @@ dm_target_t *dmt; int r; dmt = NULL; - + switch (cmd) { case MODULE_CMD_INIT: - if ((dmt = dm_target_lookup(error)) != NULL){ + if ((dmt = dm_target_lookup(error)) != NULL) { dm_target_unbusy(dmt); return EEXIST; } dmt = dm_target_alloc(error); - + dmt-version[0] = 1; dmt-version[1] = 0; dmt-version[2] = 0; @@ -79,7 +79,7 @@ dmt-upcall = dm_target_error_upcall; r = dm_target_insert(dmt); - + break; case MODULE_CMD_FINI: @@ -95,12 +95,11 @@ return r; } - #endif /* Init function called from dm_table_load_ioctl. */ int -dm_target_error_init(dm_dev_t *dmv, void **target_config, char *argv) +dm_target_error_init(dm_dev_t * dmv, void **target_config, char *argv) { printf(Error target init function called!!\n); @@ -108,20 +107,18 @@ *target_config = NULL; dmv-dev_type = DM_ERROR_DEV; - + return 0; } - /* Status routine called to get params string. */ char * dm_target_error_status(void *target_config) { return NULL; -} - +} /* Strategy routine called from dm_strategy. */ int -dm_target_error_strategy(dm_table_entry_t *table_en, struct buf *bp) +dm_target_error_strategy(dm_table_entry_t * table_en, struct buf * bp) { printf(Error target read function called!!\n); @@ -130,32 +127,29 @@ bp-b_resid = 0; biodone(bp); - + return 0; } - /* Doesn't do anything here. */ int -dm_target_error_destroy(dm_table_entry_t *table_en) +dm_target_error_destroy(dm_table_entry_t * table_en) { table_en-target_config = NULL; /* Unbusy target so we can unload it */ dm_target_unbusy(table_en-target); - + return 0; } - /* Doesn't not need to do anything here. */ int -dm_target_error_deps(dm_table_entry_t *table_en, prop_array_t prop_array) -{ +dm_target_error_deps(dm_table_entry_t * table_en, prop_array_t prop_array) +{ return 0; } - /* Unsupported for this target. */ int -dm_target_error_upcall(dm_table_entry_t *table_en, struct buf *bp) +dm_target_error_upcall(dm_table_entry_t * table_en, struct buf * bp) { return 0; } Index: src/sys/dev/dm/dm_target_zero.c diff -u src/sys/dev/dm/dm_target_zero.c:1.9 src/sys/dev/dm/dm_target_zero.c:1.10 --- src/sys/dev/dm/dm_target_zero.c:1.9 Tue Dec 1 23:12:10 2009 +++ src/sys/dev/dm/dm_target_zero.c Mon Jan 4 00:12:22 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target_zero.c,v 1.9 2009/12/01 23:12:10 haad Exp $ */ +/*$NetBSD: dm_target_zero.c,v 1.10 2010/01/04 00:12:22 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -59,15 +59,15 @@ dm_target_t *dmt; int r; dmt = NULL; - + switch (cmd) { case MODULE_CMD_INIT: - if ((dmt = dm_target_lookup(zero)) != NULL){ + if ((dmt = dm_target_lookup(zero)) != NULL) { dm_target_unbusy(dmt); return EEXIST; } dmt = dm_target_alloc(zero); - + dmt-version[0] = 1; dmt-version[1] = 0; dmt-version[2] = 0; @@ -96,7 +96,6 @@ return r; } - #endif /* @@ -104,67 +103,62 @@ * target specific config area. */ int -dm_target_zero_init(dm_dev_t *dmv, void **target_config, char *argv) +dm_target_zero_init(dm_dev_t * dmv, void **target_config, char *argv) { printf(Zero target init function called!!\n); dmv-dev_type = DM_ZERO_DEV; - + *target_config = NULL; - + return 0; } - /* Status routine called to get params string. */ char * dm_target_zero_status(void *target_config) { return NULL; -} - +} + /* * This routine does IO operations. */ int -dm_target_zero_strategy(dm_table_entry_t *table_en, struct buf *bp) +dm_target_zero_strategy(dm_table_entry_t * table_en, struct buf * bp) { /* printf(Zero target read function called %d!!\n, bp-b_bcount); */ - memset(bp-b_data, 0, bp-b_bcount); - bp-b_resid = 0; /* nestiobuf_done wants b_resid = 0 to be
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Mon Jan 4 00:14:41 UTC 2010 Modified Files: src/sys/dev/dm: dm_target.c dm_target_linear.c dm_target_stripe.c Log Message: Indent files remove unnecessary blank lines, white spaces and KNFize code. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/dm/dm_target.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/dm/dm_target_linear.c \ src/sys/dev/dm/dm_target_stripe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_target.c diff -u src/sys/dev/dm/dm_target.c:1.11 src/sys/dev/dm/dm_target.c:1.12 --- src/sys/dev/dm/dm_target.c:1.11 Wed Sep 9 22:38:49 2009 +++ src/sys/dev/dm/dm_target.c Mon Jan 4 00:14:41 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target.c,v 1.11 2009/09/09 22:38:49 haad Exp $ */ +/*$NetBSD: dm_target.c,v 1.12 2010/01/04 00:14:41 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include netbsd-dm.h #include dm.h -static dm_target_t* dm_target_lookup_name(const char *); +static dm_target_t *dm_target_lookup_name(const char *); TAILQ_HEAD(dm_target_head, dm_target); @@ -52,21 +52,19 @@ * Called indirectly from dm_table_load_ioctl to mark target as used. */ void -dm_target_busy(dm_target_t *target) +dm_target_busy(dm_target_t * target) { atomic_inc_32(target-ref_cnt); } - /* * Release reference counter on target. */ void -dm_target_unbusy(dm_target_t *target) +dm_target_unbusy(dm_target_t * target) { KASSERT(target-ref_cnt 0); atomic_dec_32(target-ref_cnt); } - /* * Try to autoload target module if it was not found in current * target list. @@ -79,26 +77,25 @@ dm_target_t *dmt; snprintf(name, sizeof(name), dm_target_%s, dm_target_name); - name[29]='\0'; - + name[29] = '\0'; + do { gen = module_gen; - + /* Try to autoload target module */ mutex_enter(module_lock); (void) module_autoload(name, MODULE_CLASS_MISC); mutex_exit(module_lock); - } while (gen != module_gen); + } while (gen != module_gen); mutex_enter(dm_target_mutex); dmt = dm_target_lookup_name(dm_target_name); if (dmt != NULL) dm_target_busy(dmt); mutex_exit(dm_target_mutex); - + return dmt; } - /* * Lookup for target in global target list. */ @@ -117,20 +114,20 @@ dmt = dm_target_lookup_name(dm_target_name); if (dmt != NULL) dm_target_busy(dmt); - + mutex_exit(dm_target_mutex); - - return dmt; + + return dmt; } - /* * Search for name in TAIL and return apropriate pointer. */ -static dm_target_t* +static dm_target_t * dm_target_lookup_name(const char *dm_target_name) { dm_target_t *dm_target; -int dlen; int slen; + int dlen; + int slen; slen = strlen(dm_target_name) + 1; @@ -138,24 +135,23 @@ dlen = strlen(dm_target-name) + 1; if (dlen != slen) continue; - + if (strncmp(dm_target_name, dm_target-name, slen) == 0) return dm_target; } return NULL; } - /* * Insert new target struct into the TAIL. * dm_target * contains name, version, function pointer to specifif target functions. */ int -dm_target_insert(dm_target_t *dm_target) +dm_target_insert(dm_target_t * dm_target) { dm_target_t *dmt; - + mutex_enter(dm_target_mutex); dmt = dm_target_lookup_name(dm_target-name); @@ -163,11 +159,10 @@ mutex_exit(dm_target_mutex); return EEXIST; } - TAILQ_INSERT_TAIL(dm_target_list, dm_target, dm_target_next); mutex_exit(dm_target_mutex); - + return 0; } @@ -179,32 +174,29 @@ dm_target_rem(char *dm_target_name) { dm_target_t *dmt; - + KASSERT(dm_target_name != NULL); mutex_enter(dm_target_mutex); - + dmt = dm_target_lookup_name(dm_target_name); if (dmt == NULL) { mutex_exit(dm_target_mutex); return ENOENT; } - if (dmt-ref_cnt 0) { mutex_exit(dm_target_mutex); return EBUSY; } - TAILQ_REMOVE(dm_target_list, dmt, dm_target_next); mutex_exit(dm_target_mutex); - - (void)kmem_free(dmt, sizeof(dm_target_t)); + + (void) kmem_free(dmt, sizeof(dm_target_t)); return 0; } - /* * Destroy all targets and remove them from queue. * This routine is called from dm_detach, before module @@ -216,38 +208,36 @@ dm_target_t *dm_target; mutex_enter(dm_target_mutex); - while (TAILQ_FIRST(dm_target_list) != NULL){ + while (TAILQ_FIRST(dm_target_list) != NULL) { dm_target = TAILQ_FIRST(dm_target_list); - + TAILQ_REMOVE(dm_target_list, TAILQ_FIRST(dm_target_list), - dm_target_next); - - (void)kmem_free(dm_target, sizeof(dm_target_t)); + dm_target_next); + + (void) kmem_free(dm_target, sizeof(dm_target_t)); } mutex_exit(dm_target_mutex); - + mutex_destroy(dm_target_mutex); - + return 0; } - /* * Allocate new target entry. */ -dm_target_t* +dm_target_t * dm_target_alloc(const char *name) { return kmem_zalloc(sizeof(dm_target_t), KM_SLEEP);
CVS commit: src/sys/dev/dm
Module Name:src Committed By: haad Date: Mon Jan 4 00:19:08 UTC 2010 Modified Files: src/sys/dev/dm: dm_dev.c dm_ioctl.c dm_pdev.c dm_table.c Log Message: Indent files remove unnecessary blank lines, white spaces and KNFize code. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/dm/dm_dev.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/dm/dm_ioctl.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/dm/dm_pdev.c cvs rdiff -u -r1.4 -r1.5 src/sys/dev/dm/dm_table.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/dm/dm_dev.c diff -u src/sys/dev/dm/dm_dev.c:1.7 src/sys/dev/dm/dm_dev.c:1.8 --- src/sys/dev/dm/dm_dev.c:1.7 Tue Dec 29 23:37:48 2009 +++ src/sys/dev/dm/dm_dev.c Mon Jan 4 00:19:08 2010 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_dev.c,v 1.7 2009/12/29 23:37:48 haad Exp $ */ +/*$NetBSD: dm_dev.c,v 1.8 2010/01/04 00:19:08 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -41,9 +41,9 @@ #include netbsd-dm.h #include dm.h -static dm_dev_t* dm_dev_lookup_name(const char *); -static dm_dev_t* dm_dev_lookup_uuid(const char *); -static dm_dev_t* dm_dev_lookup_minor(int); +static dm_dev_t *dm_dev_lookup_name(const char *); +static dm_dev_t *dm_dev_lookup_uuid(const char *); +static dm_dev_t *dm_dev_lookup_minor(int); static struct dm_dev_head dm_dev_list = TAILQ_HEAD_INITIALIZER(dm_dev_list); @@ -52,90 +52,88 @@ /* dm_dev_mutex must be holdby caller before using disable_dev. */ __inline static void -disable_dev(dm_dev_t *dmv) +disable_dev(dm_dev_t * dmv) { - TAILQ_REMOVE(dm_dev_list, dmv, next_devlist); -mutex_enter(dmv-dev_mtx); -mutex_exit(dm_dev_mutex); -while(dmv-ref_cnt != 0) - cv_wait(dmv-dev_cv, dmv-dev_mtx); -mutex_exit(dmv-dev_mtx); -} - + TAILQ_REMOVE(dm_dev_list, dmv, next_devlist); + mutex_enter(dmv-dev_mtx); + mutex_exit(dm_dev_mutex); + while (dmv-ref_cnt != 0) + cv_wait(dmv-dev_cv, dmv-dev_mtx); + mutex_exit(dmv-dev_mtx); +} /* - * Generic function used to lookup dm_dev_t. Calling with dm_dev_name + * Generic function used to lookup dm_dev_t. Calling with dm_dev_name * and dm_dev_uuid NULL is allowed. */ -dm_dev_t* +dm_dev_t * dm_dev_lookup(const char *dm_dev_name, const char *dm_dev_uuid, - int dm_dev_minor) +int dm_dev_minor) { dm_dev_t *dmv; - + dmv = NULL; mutex_enter(dm_dev_mutex); - - /* KASSERT(dm_dev_name != NULL dm_dev_uuid != NULL dm_dev_minor 0); */ + + /* KASSERT(dm_dev_name != NULL dm_dev_uuid != NULL dm_dev_minor + * 0); */ if (dm_dev_minor 0) - if ((dmv = dm_dev_lookup_minor(dm_dev_minor)) != NULL){ + if ((dmv = dm_dev_lookup_minor(dm_dev_minor)) != NULL) { dm_dev_busy(dmv); mutex_exit(dm_dev_mutex); return dmv; } - - if (dm_dev_name != NULL) - if ((dmv = dm_dev_lookup_name(dm_dev_name)) != NULL){ + if (dm_dev_name != NULL) + if ((dmv = dm_dev_lookup_name(dm_dev_name)) != NULL) { dm_dev_busy(dmv); mutex_exit(dm_dev_mutex); - return dmv; + return dmv; } - if (dm_dev_uuid != NULL) - if ((dmv = dm_dev_lookup_uuid(dm_dev_uuid)) != NULL){ + if ((dmv = dm_dev_lookup_uuid(dm_dev_uuid)) != NULL) { dm_dev_busy(dmv); mutex_exit(dm_dev_mutex); return dmv; } - mutex_exit(dm_dev_mutex); - return NULL; + mutex_exit(dm_dev_mutex); + return NULL; } - + /* * Lookup device with its minor number. */ -static dm_dev_t* +static dm_dev_t * dm_dev_lookup_minor(int dm_dev_minor) { dm_dev_t *dmv; - - TAILQ_FOREACH(dmv, dm_dev_list, next_devlist){ + + TAILQ_FOREACH(dmv, dm_dev_list, next_devlist) { if (dm_dev_minor == dmv-minor) return dmv; } - + return NULL; } - /* * Lookup device with it's device name. */ -static dm_dev_t* +static dm_dev_t * dm_dev_lookup_name(const char *dm_dev_name) { dm_dev_t *dmv; - int dlen; int slen; + int dlen; + int slen; slen = strlen(dm_dev_name); if (slen == 0) return NULL; - - TAILQ_FOREACH(dmv, dm_dev_list, next_devlist){ + + TAILQ_FOREACH(dmv, dm_dev_list, next_devlist) { dlen = strlen(dmv-name); - - if(slen != dlen) + + if (slen != dlen) continue; if (strncmp(dm_dev_name, dmv-name, slen) == 0) @@ -144,62 +142,59 @@ return NULL; } - /* * Lookup device with it's device uuid. Used mostly by LVM2tools. */ -static dm_dev_t* +static dm_dev_t * dm_dev_lookup_uuid(const char *dm_dev_uuid) { dm_dev_t *dmv; size_t len; - + len = 0; len = strlen(dm_dev_uuid); - + if (len == 0) return NULL; - TAILQ_FOREACH(dmv, dm_dev_list, next_devlist){ + TAILQ_FOREACH(dmv, dm_dev_list, next_devlist) { if (strlen(dmv-uuid) != len) continue; - + if (strncmp(dm_dev_uuid, dmv-uuid, strlen(dmv-uuid)) == 0) return dmv; } return NULL; } - /* * Insert new device to the global list of devices. */ int -dm_dev_insert(dm_dev_t *dev)