From owner-svn-src-projects@FreeBSD.ORG Sun Mar 3 09:13:21 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 53DBC7AC; Sun, 3 Mar 2013 09:13:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4551CBDA; Sun, 3 Mar 2013 09:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239DLTi067705; Sun, 3 Mar 2013 09:13:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239DI17067682; Sun, 3 Mar 2013 09:13:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303030913.r239DI17067682@svn.freebsd.org> From: Alexander Motin Date: Sun, 3 Mar 2013 09:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247699 - in projects/calloutng/sys: dev/random dev/syscons kern sys X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 09:13:21 -0000 Author: mav Date: Sun Mar 3 09:13:17 2013 New Revision: 247699 URL: http://svnweb.freebsd.org/changeset/base/247699 Log: Remove unused TIME_T_MAX macro from kern_timeout.c. Tune some style. Modified: projects/calloutng/sys/dev/random/randomdev_soft.c projects/calloutng/sys/dev/syscons/syscons.c projects/calloutng/sys/kern/kern_clocksource.c projects/calloutng/sys/kern/kern_event.c projects/calloutng/sys/kern/kern_synch.c projects/calloutng/sys/kern/kern_timeout.c projects/calloutng/sys/kern/sys_generic.c projects/calloutng/sys/sys/condvar.h projects/calloutng/sys/sys/mutex.h projects/calloutng/sys/sys/rwlock.h projects/calloutng/sys/sys/sleepqueue.h projects/calloutng/sys/sys/sx.h projects/calloutng/sys/sys/systm.h projects/calloutng/sys/sys/time.h Modified: projects/calloutng/sys/dev/random/randomdev_soft.c ============================================================================== --- projects/calloutng/sys/dev/random/randomdev_soft.c Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/dev/random/randomdev_soft.c Sun Mar 3 09:13:17 2013 (r247699) @@ -283,7 +283,7 @@ random_kthread(void *arg __unused) /* Work done, so don't belabour the issue */ msleep_spin_sbt(&random_kthread_control, &harvest_mtx, - "-", (SBT_1S / 10), 0, C_PREL(1)); + "-", SBT_1S / 10, 0, C_PREL(1)); } mtx_unlock_spin(&harvest_mtx); Modified: projects/calloutng/sys/dev/syscons/syscons.c ============================================================================== --- projects/calloutng/sys/dev/syscons/syscons.c Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/dev/syscons/syscons.c Sun Mar 3 09:13:17 2013 (r247699) @@ -1918,7 +1918,7 @@ done: rate = 2; else rate = 30; - callout_reset_sbt(&sc->ctimeout, (SBT_1S / rate), 0, + callout_reset_sbt(&sc->ctimeout, SBT_1S / rate, 0, scrn_timer, sc, C_PREL(1)); } } @@ -3864,7 +3864,7 @@ blink_screen(void *arg) (*scp->rndr->draw)(scp, 0, scp->xsize*scp->ysize, scp->sc->blink_in_progress & 1); scp->sc->blink_in_progress--; - callout_reset_sbt(&scp->sc->cblink, (SBT_1S / 15), 0, + callout_reset_sbt(&scp->sc->cblink, SBT_1S / 15, 0, blink_screen, scp, C_PREL(0)); } } Modified: projects/calloutng/sys/kern/kern_clocksource.c ============================================================================== --- projects/calloutng/sys/kern/kern_clocksource.c Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/kern/kern_clocksource.c Sun Mar 3 09:13:17 2013 (r247699) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -252,7 +251,7 @@ getnextcpuevent(int idle) u_int hardfreq; state = DPCPU_PTR(timerstate); - /* Handle hardclock() events, skipping some is CPU is idle. */ + /* Handle hardclock() events, skipping some if CPU is idle. */ event = state->nexthard; if (idle) { hardfreq = (u_int)hz / 2; Modified: projects/calloutng/sys/kern/kern_event.c ============================================================================== --- projects/calloutng/sys/kern/kern_event.c Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/kern/kern_event.c Sun Mar 3 09:13:17 2013 (r247699) @@ -517,11 +517,11 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ -static __inline sbintime_t +static __inline sbintime_t timer2sbintime(intptr_t data) { - return (SBT_1MS * data); + return (SBT_1MS * data); } static void Modified: projects/calloutng/sys/kern/kern_synch.c ============================================================================== --- projects/calloutng/sys/kern/kern_synch.c Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/kern/kern_synch.c Sun Mar 3 09:13:17 2013 (r247699) @@ -353,7 +353,7 @@ pause_sbt(const char *wmesg, sbintime_t { int sbt_sec; - sbt_sec = sbintime_getsec(sbt); + sbt_sec = sbintime_getsec(sbt); KASSERT(sbt_sec >= 0, ("pause: timo must be >= 0")); /* silently convert invalid timeouts */ Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/kern/kern_timeout.c Sun Mar 3 09:13:17 2013 (r247699) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef SMP #include @@ -176,9 +175,6 @@ struct callout_cpu cc_cpu; #define CC_UNLOCK(cc) mtx_unlock_spin(&(cc)->cc_lock) #define CC_LOCK_ASSERT(cc) mtx_assert(&(cc)->cc_lock, MA_OWNED) -#define TIME_T_MAX \ - (sizeof(time_t) == (sizeof(int64_t)) ? INT64_MAX : INT32_MAX) - static int timeout_cpu; static void softclock_call_cc(struct callout *c, struct callout_cpu *cc, @@ -553,7 +549,7 @@ callout_cc_add(struct callout *c, struct c->c_precision = precision; bucket = callout_get_bucket(c->c_time); CTR3(KTR_CALLOUT, "precision set for %p: %d.%08x", - c, (int)(c->c_precision >> 32), + c, (int)(c->c_precision >> 32), (u_int)(c->c_precision & 0xffffffff)); LIST_INSERT_HEAD(&cc->cc_callwheel[bucket], c, c_links.le); if (cc->cc_bucket == bucket) @@ -1008,7 +1004,7 @@ callout_reset_sbt_on(struct callout *c, callout_cc_add(c, cc, to_sbt, precision, ftn, arg, cpu, flags); CTR6(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d.%08x", - cancelled ? "re" : "", c, c->c_func, c->c_arg,(int)(to_sbt >> 32), + cancelled ? "re" : "", c, c->c_func, c->c_arg, (int)(to_sbt >> 32), (u_int)(to_sbt & 0xffffffff)); CC_UNLOCK(cc); Modified: projects/calloutng/sys/kern/sys_generic.c ============================================================================== --- projects/calloutng/sys/kern/sys_generic.c Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/kern/sys_generic.c Sun Mar 3 09:13:17 2013 (r247699) @@ -1056,7 +1056,7 @@ kern_select(struct thread *td, int nd, f precision >>= tc_precexp; if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - asbt += rsbt; + asbt += rsbt; } else asbt = -1; seltdinit(td); @@ -1295,7 +1295,7 @@ sys_poll(td, uap) error = EINVAL; goto done; } - rsbt = SBT_1MS * uap->timeout; + rsbt = SBT_1MS * uap->timeout; precision = rsbt; precision >>= tc_precexp; if (TIMESEL(&asbt, rsbt)) Modified: projects/calloutng/sys/sys/condvar.h ============================================================================== --- projects/calloutng/sys/sys/condvar.h Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/sys/condvar.h Sun Mar 3 09:13:17 2013 (r247699) @@ -71,12 +71,12 @@ void cv_broadcastpri(struct cv *cvp, int _cv_wait_sig((cvp), &(lock)->lock_object) #define cv_timedwait(cvp, lock, timo) \ _cv_timedwait_sbt((cvp), &(lock)->lock_object, \ - (tick_sbt * (timo)), 0, C_HARDCLOCK) + tick_sbt * (timo), 0, C_HARDCLOCK) #define cv_timedwait_sbt(cvp, lock, sbt, pr, flags) \ _cv_timedwait_sbt((cvp), &(lock)->lock_object, (sbt), (pr), (flags)) #define cv_timedwait_sig(cvp, lock, timo) \ _cv_timedwait_sig_sbt((cvp), &(lock)->lock_object, \ - (tick_sbt * (timo)), 0, C_HARDCLOCK) + tick_sbt * (timo), 0, C_HARDCLOCK) #define cv_timedwait_sig_sbt(cvp, lock, sbt, pr, flags) \ _cv_timedwait_sig_sbt((cvp), &(lock)->lock_object, (sbt), (pr), (flags)) Modified: projects/calloutng/sys/sys/mutex.h ============================================================================== --- projects/calloutng/sys/sys/mutex.h Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/sys/mutex.h Sun Mar 3 09:13:17 2013 (r247699) @@ -377,7 +377,7 @@ extern struct mtx_pool *mtxpool_sleep; #define mtx_sleep(chan, mtx, pri, wmesg, timo) \ _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \ - (tick_sbt * (timo)), 0, C_HARDCLOCK) + tick_sbt * (timo), 0, C_HARDCLOCK) #define mtx_initialized(m) lock_initalized(&(m)->lock_object) Modified: projects/calloutng/sys/sys/rwlock.h ============================================================================== --- projects/calloutng/sys/sys/rwlock.h Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/sys/rwlock.h Sun Mar 3 09:13:17 2013 (r247699) @@ -212,7 +212,7 @@ void __rw_assert(const volatile uintptr_ } while (0) #define rw_sleep(chan, rw, pri, wmesg, timo) \ _sleep((chan), &(rw)->lock_object, (pri), (wmesg), \ - (tick_sbt * (timo)), 0, C_HARDCLOCK) + tick_sbt * (timo), 0, C_HARDCLOCK) #define rw_initialized(rw) lock_initalized(&(rw)->lock_object) Modified: projects/calloutng/sys/sys/sleepqueue.h ============================================================================== --- projects/calloutng/sys/sys/sleepqueue.h Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/sys/sleepqueue.h Sun Mar 3 09:13:17 2013 (r247699) @@ -111,7 +111,7 @@ int sleepq_signal(void *wchan, int flags void sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, sbintime_t pr, int flags); #define sleepq_set_timeout(wchan, timo) \ - sleepq_set_timeout_sbt((wchan), (tick_sbt * (timo)), 0, C_HARDCLOCK) + sleepq_set_timeout_sbt((wchan), tick_sbt * (timo), 0, C_HARDCLOCK) u_int sleepq_sleepcnt(void *wchan, int queue); int sleepq_timedwait(void *wchan, int pri); int sleepq_timedwait_sig(void *wchan, int pri); Modified: projects/calloutng/sys/sys/sx.h ============================================================================== --- projects/calloutng/sys/sys/sx.h Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/sys/sx.h Sun Mar 3 09:13:17 2013 (r247699) @@ -276,7 +276,7 @@ __sx_sunlock(struct sx *sx, const char * #define sx_sleep(chan, sx, pri, wmesg, timo) \ _sleep((chan), &(sx)->lock_object, (pri), (wmesg), \ - (tick_sbt * (timo)), 0, C_HARDCLOCK) + tick_sbt * (timo), 0, C_HARDCLOCK) /* * Options passed to sx_init_flags(). Modified: projects/calloutng/sys/sys/systm.h ============================================================================== --- projects/calloutng/sys/sys/systm.h Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/sys/systm.h Sun Mar 3 09:13:17 2013 (r247699) @@ -344,21 +344,21 @@ int _sleep(void *chan, struct lock_objec sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1); #define msleep(chan, mtx, pri, wmesg, timo) \ _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \ - (tick_sbt * (timo)), 0, C_HARDCLOCK) + tick_sbt * (timo), 0, C_HARDCLOCK) #define msleep_sbt(chan, mtx, pri, wmesg, bt, pr, flags) \ _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (bt), (pr), \ (flags)) int msleep_spin_sbt(void *chan, struct mtx *mtx, const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1); #define msleep_spin(chan, mtx, wmesg, timo) \ - msleep_spin_sbt((chan), (mtx), (wmesg), (tick_sbt * (timo)), \ + msleep_spin_sbt((chan), (mtx), (wmesg), tick_sbt * (timo), \ 0, C_HARDCLOCK) int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags); #define pause(wmesg, timo) \ - pause_sbt((wmesg), (tick_sbt * (timo)), 0, C_HARDCLOCK) + pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK) #define tsleep(chan, pri, wmesg, timo) \ - _sleep((chan), NULL, (pri), (wmesg), (tick_sbt * (timo)), \ + _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \ 0, C_HARDCLOCK) #define tsleep_sbt(chan, pri, wmesg, bt, pr, flags) \ _sleep((chan), NULL, (pri), (wmesg), (bt), (pr), (flags)) Modified: projects/calloutng/sys/sys/time.h ============================================================================== --- projects/calloutng/sys/sys/time.h Sun Mar 3 09:11:24 2013 (r247698) +++ projects/calloutng/sys/sys/time.h Sun Mar 3 09:13:17 2013 (r247699) @@ -154,13 +154,6 @@ sbttobt(sbintime_t sbt) return (bt); } -#ifdef _KERNEL - -extern struct bintime tick_bt; -extern sbintime_t tick_sbt; - -#endif /* KERNEL */ - /*- * Background information: * @@ -378,9 +371,11 @@ void resettodr(void); extern volatile time_t time_second; extern volatile time_t time_uptime; extern struct bintime boottimebin; +extern struct timeval boottime; extern struct bintime tc_tick_bt; extern sbintime_t tc_tick_sbt; -extern struct timeval boottime; +extern struct bintime tick_bt; +extern sbintime_t tick_sbt; extern int tc_precexp; extern int tc_timepercentage; extern struct bintime bt_timethreshold; From owner-svn-src-projects@FreeBSD.ORG Sun Mar 3 09:18:16 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC746A7F; Sun, 3 Mar 2013 09:18:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C0BF7C11; Sun, 3 Mar 2013 09:18:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r239IGMx068429; Sun, 3 Mar 2013 09:18:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r239IFqg068424; Sun, 3 Mar 2013 09:18:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201303030918.r239IFqg068424@svn.freebsd.org> From: Alexander Motin Date: Sun, 3 Mar 2013 09:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247701 - in projects/calloutng: lib/libedit sys/cddl/compat/opensolaris/sys sys/i386/xen sys/ofed/include/linux tools/regression/capsicum/syscalls X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 09:18:16 -0000 Author: mav Date: Sun Mar 3 09:18:15 2013 New Revision: 247701 URL: http://svnweb.freebsd.org/changeset/base/247701 Log: MFC @r247700 Modified: projects/calloutng/lib/libedit/Makefile projects/calloutng/sys/cddl/compat/opensolaris/sys/kcondvar.h projects/calloutng/sys/i386/xen/pmap.c projects/calloutng/sys/ofed/include/linux/timer.h projects/calloutng/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Directory Properties: projects/calloutng/ (props changed) projects/calloutng/sys/ (props changed) Modified: projects/calloutng/lib/libedit/Makefile ============================================================================== --- projects/calloutng/lib/libedit/Makefile Sun Mar 3 09:13:18 2013 (r247700) +++ projects/calloutng/lib/libedit/Makefile Sun Mar 3 09:18:15 2013 (r247701) @@ -11,7 +11,6 @@ OSRCS= chared.c common.c el.c emacs.c fc parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} -LDADD= -lncurses MAN= editline.3 editrc.5 Modified: projects/calloutng/sys/cddl/compat/opensolaris/sys/kcondvar.h ============================================================================== --- projects/calloutng/sys/cddl/compat/opensolaris/sys/kcondvar.h Sun Mar 3 09:13:18 2013 (r247700) +++ projects/calloutng/sys/cddl/compat/opensolaris/sys/kcondvar.h Sun Mar 3 09:18:15 2013 (r247701) @@ -55,7 +55,7 @@ typedef enum { _name = #cv; \ cv_init((cv), _name); \ } while (0) -#define cv_init(cv, name, type, arg) zfs_cv_init((cv), (name), (type), (arg)) +#define cv_init(cv, name, type, arg) zfs_cv_init(cv, name, type, arg) #endif /* _KERNEL */ Modified: projects/calloutng/sys/i386/xen/pmap.c ============================================================================== --- projects/calloutng/sys/i386/xen/pmap.c Sun Mar 3 09:13:18 2013 (r247700) +++ projects/calloutng/sys/i386/xen/pmap.c Sun Mar 3 09:18:15 2013 (r247701) @@ -2038,7 +2038,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) vm_page_dirty(m); if ((tpte & PG_A) != 0) vm_page_aflag_set(m, PGA_REFERENCED); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); pc->pc_map[field] |= 1UL << bit; @@ -2239,9 +2239,9 @@ pmap_pvh_remove(struct md_page *pvh, pma pv_entry_t pv; rw_assert(&pvh_global_lock, RA_WLOCKED); - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { - TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); + TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); break; } } @@ -2281,7 +2281,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm if (pv_entry_count < pv_entry_high_water && (pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); return (TRUE); } else return (FALSE); @@ -2503,7 +2503,7 @@ pmap_remove_all(vm_page_t m) vm_page_dirty(m); pmap_unuse_pt(pmap, pv->pv_va, &free); pmap_invalidate_page(pmap, pv->pv_va); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } @@ -2770,7 +2770,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pv == NULL) pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pa |= PG_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -3465,7 +3465,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; rw_wlock(&pvh_global_lock); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { if (PV_PMAP(pv) == pmap) { rv = TRUE; break; @@ -3497,7 +3497,7 @@ pmap_page_wired_mappings(vm_page_t m) return (count); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3602,7 +3602,7 @@ pmap_remove_pages(pmap_t pmap) if (tpte & PG_M) vm_page_dirty(m); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -3662,7 +3662,7 @@ pmap_is_modified(vm_page_t m) return (rv); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3723,7 +3723,7 @@ pmap_is_referenced(vm_page_t m) rv = FALSE; rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3793,7 +3793,7 @@ pmap_remove_write(vm_page_t m) return; rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3852,9 +3852,9 @@ pmap_ts_referenced(vm_page_t m) if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pvf = pv; do { - pvn = TAILQ_NEXT(pv, pv_list); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + pvn = TAILQ_NEXT(pv, pv_next); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3901,7 +3901,7 @@ pmap_clear_modify(vm_page_t m) return; rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3936,7 +3936,7 @@ pmap_clear_reference(vm_page_t m) ("pmap_clear_reference: page %p is not managed", m)); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -4418,7 +4418,7 @@ pmap_pvdump(vm_paddr_t pa) printf("pa %x", pa); m = PHYS_TO_VM_PAGE(pa); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); printf(" -> pmap %p, va %x", (void *)pmap, pv->pv_va); pads(pmap); Modified: projects/calloutng/sys/ofed/include/linux/timer.h ============================================================================== --- projects/calloutng/sys/ofed/include/linux/timer.h Sun Mar 3 09:13:18 2013 (r247700) +++ projects/calloutng/sys/ofed/include/linux/timer.h Sun Mar 3 09:18:15 2013 (r247701) @@ -66,7 +66,7 @@ do { \ #define mod_timer(timer, exp) \ do { \ - (timer)->expires = exp; \ + (timer)->expires = (exp); \ callout_reset(&(timer)->timer_callout, (exp) - jiffies, \ _timer_fn, (timer)); \ } while (0) Modified: projects/calloutng/tools/regression/capsicum/syscalls/cap_ioctls_limit.c ============================================================================== --- projects/calloutng/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Sun Mar 3 09:13:18 2013 (r247700) +++ projects/calloutng/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Sun Mar 3 09:18:15 2013 (r247701) @@ -51,7 +51,7 @@ ioctl_tests_0(int fd) { unsigned long cmds[2]; - CHECK(cap_ioctls_get(fd, NULL, 0) == INT_MAX); + CHECK(cap_ioctls_get(fd, NULL, 0) == CAP_IOCTLS_ALL); CHECK(fcntl(fd, F_GETFD) == 0); CHECK(ioctl(fd, FIOCLEX) == 0); @@ -241,7 +241,7 @@ ioctl_tests_recv_0(int sock) CHECK(descriptor_recv(sock, &fd) == 0); - CHECK(cap_ioctls_get(fd, NULL, 0) == INT_MAX); + CHECK(cap_ioctls_get(fd, NULL, 0) == CAP_IOCTLS_ALL); CHECK(fcntl(fd, F_GETFD) == 0); CHECK(ioctl(fd, FIOCLEX) == 0); From owner-svn-src-projects@FreeBSD.ORG Sun Mar 3 10:52:42 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8400D1C3; Sun, 3 Mar 2013 10:52:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46ABEED9; Sun, 3 Mar 2013 10:52:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23Aqfck098112; Sun, 3 Mar 2013 10:52:41 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23Aqflm098111; Sun, 3 Mar 2013 10:52:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303031052.r23Aqflm098111@svn.freebsd.org> From: Martin Matuska Date: Sun, 3 Mar 2013 10:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247708 - projects/libzfs_core X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 10:52:42 -0000 Author: mm Date: Sun Mar 3 10:52:41 2013 New Revision: 247708 URL: http://svnweb.freebsd.org/changeset/base/247708 Log: Create project branch for porting libzfs_core Added: - copied from r247707, head/ Directory Properties: projects/libzfs_core/ (props changed) From owner-svn-src-projects@FreeBSD.ORG Sun Mar 3 13:39:55 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47162310; Sun, 3 Mar 2013 13:39:55 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 22BA47D5; Sun, 3 Mar 2013 13:39:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23DdtOj047738; Sun, 3 Mar 2013 13:39:55 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23DdsBU047737; Sun, 3 Mar 2013 13:39:54 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303031339.r23DdsBU047737@svn.freebsd.org> From: Davide Italiano Date: Sun, 3 Mar 2013 13:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247710 - projects/calloutng/sys/kern X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 13:39:55 -0000 Author: davide Date: Sun Mar 3 13:39:54 2013 New Revision: 247710 URL: http://svnweb.freebsd.org/changeset/base/247710 Log: - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables. - Remove useless braces. - Now that 'callout migration entity' has been replaced by 'callout execution entity' rename functions and modify comments accordingly. - Move DCPU_DECLARE at the beginning of the file. Requested by: attilio Modified: projects/calloutng/sys/kern/kern_timeout.c Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Sun Mar 3 11:09:55 2013 (r247709) +++ projects/calloutng/sys/kern/kern_timeout.c Sun Mar 3 13:39:54 2013 (r247710) @@ -63,6 +63,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifndef NO_EVENTTIMERS +DPCPU_DECLARE(sbintime_t, hardclocktime); +#endif + SDT_PROVIDER_DEFINE(callout_execute); SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start, callout-start); SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0, @@ -176,12 +180,12 @@ struct callout_cpu cc_cpu; #define CC_LOCK_ASSERT(cc) mtx_assert(&(cc)->cc_lock, MA_OWNED) static int timeout_cpu; -static void -softclock_call_cc(struct callout *c, struct callout_cpu *cc, + +static void softclock_call_cc(struct callout *c, struct callout_cpu *cc, #ifdef CALLOUT_PROFILING - int *mpcalls, int *lockcalls, int *gcalls, + int *mpcalls, int *lockcalls, int *gcalls, #endif - int direct); + int direct); static MALLOC_DEFINE(M_CALLOUT, "callout", "Callout datastructures"); @@ -203,16 +207,16 @@ static MALLOC_DEFINE(M_CALLOUT, "callout */ /* - * Resets the migration entity tied to a specific callout cpu. + * Resets the execution entity tied to a specific callout cpu. */ static void -cc_cme_cleanup(struct callout_cpu *cc, int direct) +cc_cce_cleanup(struct callout_cpu *cc, int direct) { cc->cc_exec_entity[direct].cc_curr = NULL; cc->cc_exec_entity[direct].cc_next = NULL; - cc->cc_exec_entity[direct].cc_cancel = 0; - cc->cc_exec_entity[direct].cc_waiting = 0; + cc->cc_exec_entity[direct].cc_cancel = FALSE; + cc->cc_exec_entity[direct].cc_waiting = FALSE; #ifdef SMP cc->cc_exec_entity[direct].ce_migration_cpu = CPUBLOCK; cc->cc_exec_entity[direct].ce_migration_time = 0; @@ -225,7 +229,7 @@ cc_cme_cleanup(struct callout_cpu *cc, i * Checks if migration is requested by a specific callout cpu. */ static int -cc_cme_migrating(struct callout_cpu *cc, int direct) +cc_cce_migrating(struct callout_cpu *cc, int direct) { #ifdef SMP @@ -275,7 +279,7 @@ callout_cpu_init(struct callout_cpu *cc) TAILQ_INIT(&cc->cc_expireq); cc->cc_firstevent = INT64_MAX; for (i = 0; i < 2; i++) - cc_cme_cleanup(cc, i); + cc_cce_cleanup(cc, i); if (cc->cc_callout == NULL) return; for (i = 0; i < ncallout; i++) { @@ -596,7 +600,7 @@ softclock_call_cc(struct callout *c, str int flags, new_cpu; sbintime_t new_time; #endif -#ifdef DIAGNOSTIC +#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) sbintime_t bt1, bt2; struct timespec ts2; static sbintime_t maxdt = 2 * SBT_1MS; /* 2 msec */ @@ -617,7 +621,7 @@ softclock_call_cc(struct callout *c, str else c->c_flags &= ~CALLOUT_PENDING; cc->cc_exec_entity[direct].cc_curr = c; - cc->cc_exec_entity[direct].cc_cancel = 0; + cc->cc_exec_entity[direct].cc_cancel = FALSE; CC_UNLOCK(cc); if (c_lock != NULL) { class->lc_lock(c_lock, sharedlock); @@ -630,7 +634,7 @@ softclock_call_cc(struct callout *c, str goto skip; } /* The callout cannot be stopped now. */ - cc->cc_exec_entity[direct].cc_cancel = 1; + cc->cc_exec_entity[direct].cc_cancel = TRUE; if (c_lock == &Giant.lock_object) { #ifdef CALLOUT_PROFILING (*gcalls)++; @@ -687,8 +691,8 @@ skip: * If the callout was scheduled for * migration just cancel it. */ - if (cc_cme_migrating(cc, direct)) { - cc_cme_cleanup(cc, direct); + if (cc_cce_migrating(cc, direct)) { + cc_cce_cleanup(cc, direct); /* * It should be assert here that the callout is not @@ -696,11 +700,11 @@ skip: */ c->c_flags &= ~CALLOUT_DFRMIGRATION; } - cc->cc_exec_entity[direct].cc_waiting = 0; + cc->cc_exec_entity[direct].cc_waiting = FALSE; CC_UNLOCK(cc); wakeup(&cc->cc_exec_entity[direct].cc_waiting); CC_LOCK(cc); - } else if (cc_cme_migrating(cc, direct)) { + } else if (cc_cce_migrating(cc, direct)) { KASSERT((c_flags & CALLOUT_LOCAL_ALLOC) == 0, ("Migrating legacy callout %p", c)); #ifdef SMP @@ -712,7 +716,7 @@ skip: new_time = cc->cc_exec_entity[direct].ce_migration_time; new_func = cc->cc_exec_entity[direct].ce_migration_func; new_arg = cc->cc_exec_entity[direct].ce_migration_arg; - cc_cme_cleanup(cc, direct); + cc_cce_cleanup(cc, direct); /* * It should be assert here that the callout is not destroyed @@ -870,10 +874,6 @@ callout_handle_init(struct callout_handl handle->callout = NULL; } -#ifndef NO_EVENTTIMERS -DPCPU_DECLARE(sbintime_t, hardclocktime); -#endif - /* * New interface; clients allocate their own callout structures. * @@ -908,8 +908,9 @@ callout_reset_sbt_on(struct callout *c, #ifdef NO_EVENTTIMERS sbt >= sbt_timethreshold) { to_sbt = getsbinuptime(); + /* Add safety belt for the case of hz > 1000. */ - to_sbt += (tc_tick_sbt - tick_sbt); + to_sbt += tc_tick_sbt - tick_sbt; #else sbt >= sbt_tickthreshold) { /* @@ -953,7 +954,7 @@ callout_reset_sbt_on(struct callout *c, * can cancel the callout if it has not really started. */ if (c->c_lock != NULL && !cc->cc_exec_entity[direct].cc_cancel) - cancelled = cc->cc_exec_entity[direct].cc_cancel = 1; + cancelled = cc->cc_exec_entity[direct].cc_cancel = TRUE; if (cc->cc_exec_entity[direct].cc_waiting) { /* * Someone has called callout_drain to kill this @@ -1134,7 +1135,7 @@ again: * will be packed up, just let softclock() * take care of it. */ - cc->cc_exec_entity[direct].cc_waiting = 1; + cc->cc_exec_entity[direct].cc_waiting = FALSE; DROP_GIANT(); CC_UNLOCK(cc); sleepq_add( @@ -1160,10 +1161,10 @@ again: * lock, the callout will be skipped in * softclock(). */ - cc->cc_exec_entity[direct].cc_cancel = 1; + cc->cc_exec_entity[direct].cc_cancel = TRUE; CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", c, c->c_func, c->c_arg); - KASSERT(!cc_cme_migrating(cc, direct), + KASSERT(!cc_cce_migrating(cc, direct), ("callout wrongly scheduled for migration")); CC_UNLOCK(cc); KASSERT(!sq_locked, ("sleepqueue chain locked")); @@ -1183,6 +1184,7 @@ again: } if (sq_locked) sleepq_release(&cc->cc_exec_entity[direct].cc_waiting); + c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", From owner-svn-src-projects@FreeBSD.ORG Sun Mar 3 13:53:59 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 25C338CD; Sun, 3 Mar 2013 13:53:59 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 02888852; Sun, 3 Mar 2013 13:53:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23Drw6t052893; Sun, 3 Mar 2013 13:53:58 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23DrwTV052892; Sun, 3 Mar 2013 13:53:58 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303031353.r23DrwTV052892@svn.freebsd.org> From: Davide Italiano Date: Sun, 3 Mar 2013 13:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247711 - projects/calloutng/sys/kern X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 13:53:59 -0000 Author: davide Date: Sun Mar 3 13:53:58 2013 New Revision: 247711 URL: http://svnweb.freebsd.org/changeset/base/247711 Log: Fix a braino. Pointy hat to me, I've realized I was wrong after a cup of coffe. Modified: projects/calloutng/sys/kern/kern_timeout.c Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Sun Mar 3 13:39:54 2013 (r247710) +++ projects/calloutng/sys/kern/kern_timeout.c Sun Mar 3 13:53:58 2013 (r247711) @@ -1135,7 +1135,7 @@ again: * will be packed up, just let softclock() * take care of it. */ - cc->cc_exec_entity[direct].cc_waiting = FALSE; + cc->cc_exec_entity[direct].cc_waiting = TRUE; DROP_GIANT(); CC_UNLOCK(cc); sleepq_add( From owner-svn-src-projects@FreeBSD.ORG Sun Mar 3 15:19:52 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 665838EB; Sun, 3 Mar 2013 15:19:52 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D14DB5B; Sun, 3 Mar 2013 15:19:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23FJqei079377; Sun, 3 Mar 2013 15:19:52 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23FJoed079365; Sun, 3 Mar 2013 15:19:50 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303031519.r23FJoed079365@svn.freebsd.org> From: Davide Italiano Date: Sun, 3 Mar 2013 15:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247717 - in projects/calloutng: . lib/libedit sbin/ipfw sys/sys usr.sbin/pc-sysinstall/backend usr.sbin/pc-sysinstall/examples X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 15:19:52 -0000 Author: davide Date: Sun Mar 3 15:19:49 2013 New Revision: 247717 URL: http://svnweb.freebsd.org/changeset/base/247717 Log: Merge head r236314 through r247716. Modified: projects/calloutng/MAINTAINERS (contents, props changed) projects/calloutng/ObsoleteFiles.inc projects/calloutng/lib/libedit/Makefile projects/calloutng/sbin/ipfw/ipfw2.c projects/calloutng/sbin/ipfw/ipfw2.h projects/calloutng/sbin/ipfw/ipv6.c projects/calloutng/sys/sys/systm.h projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-parse.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/parseconfig.sh projects/calloutng/usr.sbin/pc-sysinstall/examples/README Directory Properties: projects/calloutng/ (props changed) projects/calloutng/sbin/ (props changed) projects/calloutng/sbin/ipfw/ (props changed) projects/calloutng/sys/ (props changed) Modified: projects/calloutng/MAINTAINERS ============================================================================== --- projects/calloutng/MAINTAINERS Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/MAINTAINERS Sun Mar 3 15:19:49 2013 (r247717) @@ -124,3 +124,6 @@ isci(4) jimharris Pre-commit review req cmx daniel@roe.ch Pre-commit review preferred. filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. +sh(1) jilles Pre-commit review requested. This also applies + to kill(1), printf(1) and test(1) which are + compiled in as builtins. Modified: projects/calloutng/ObsoleteFiles.inc ============================================================================== --- projects/calloutng/ObsoleteFiles.inc Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/ObsoleteFiles.inc Sun Mar 3 15:19:49 2013 (r247717) @@ -39,6 +39,8 @@ # done # 20130302: NTFS support removed +OLD_FILES+=rescue/mount_ntfs +OLD_FILES+=sbin/mount_ntfs OLD_FILES+=usr/include/fs/ntfs/ntfs.h OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h @@ -51,6 +53,7 @@ OLD_FILES+=usr/share/man/man8/mount_ntfs # 20130302: PORTALFS support removed OLD_FILES+=usr/include/fs/portalfs/portal.h OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/sbin/mount_portalfs OLD_FILES+=usr/share/examples/portal/README OLD_FILES+=usr/share/examples/portal/portal.conf OLD_DIRS+=usr/share/examples/portal @@ -79,9 +82,10 @@ OLD_DIRS+=var/remote # 20121114: zpool-features manual page moved from section 5 to 7 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz # 20121022: remove harp, hfa and idt man page -OLD_FILES+=share/man/man4/harp.4 -OLD_FILES+=share/man/man4/hfa.4 -OLD_FILES+=share/man/man4/idt.4 +OLD_FILES+=usr/share/man/man4/harp.4.gz +OLD_FILES+=usr/share/man/man4/hfa.4.gz +OLD_FILES+=usr/share/man/man4/idt.4.gz +OLD_FILES+=usr/share/man/man4/if_idt.4.gz # 20121022: VFS_LOCK_GIANT elimination OLD_FILES+=usr/share/man/man9/VFS_LOCK_GIANT.9.gz OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz Modified: projects/calloutng/lib/libedit/Makefile ============================================================================== --- projects/calloutng/lib/libedit/Makefile Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/lib/libedit/Makefile Sun Mar 3 15:19:49 2013 (r247717) @@ -11,6 +11,7 @@ OSRCS= chared.c common.c el.c emacs.c fc parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} +LDADD= -lncurses MAN= editline.3 editrc.5 Modified: projects/calloutng/sbin/ipfw/ipfw2.c ============================================================================== --- projects/calloutng/sbin/ipfw/ipfw2.c Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/sbin/ipfw/ipfw2.c Sun Mar 3 15:19:49 2013 (r247717) @@ -64,6 +64,22 @@ int ipfw_socket = -1; #define s6_addr32 __u6_addr.__u6_addr32 #endif +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) +/* + * Check if we have enough space in cmd buffer. Note that since + * first 8? u32 words are reserved by reserved header, full cmd + * buffer can't be used, so we need to protect from buffer overrun + * only. At the beginnig, cblen is less than actual buffer size by + * size of ipfw_insn_u32 instruction + 1 u32 work. This eliminates need + * for checking small instructions fitting in given range. + * We also (ab)use the fact that ipfw_insn is always the first field + * for any custom instruction. + */ +#define CHECK_CMDLEN CHECK_LENGTH(cblen, F_LEN((ipfw_insn *)cmd)) + #define GET_UINT_ARG(arg, min, max, tok, s_x) do { \ if (!av[0]) \ errx(EX_USAGE, "%s: missing argument", match_value(s_x, tok)); \ @@ -653,7 +669,7 @@ strtoport(char *s, char **end, int base, * Fill the body of the command with the list of port ranges. */ static int -fill_newports(ipfw_insn_u16 *cmd, char *av, int proto) +fill_newports(ipfw_insn_u16 *cmd, char *av, int proto, int cblen) { uint16_t a, b, *p = cmd->ports; int i = 0; @@ -664,6 +680,8 @@ fill_newports(ipfw_insn_u16 *cmd, char * if (s == av) /* empty or invalid argument */ return (0); + CHECK_LENGTH(cblen, i + 2); + switch (*s) { case '-': /* a range */ av = s + 1; @@ -2068,7 +2086,7 @@ lookup_host (char *host, struct in_addr * We can have multiple comma-separated address/mask entries. */ static void -fill_ip(ipfw_insn_ip *cmd, char *av) +fill_ip(ipfw_insn_ip *cmd, char *av, int cblen) { int len = 0; uint32_t *d = ((ipfw_insn_u32 *)cmd)->d; @@ -2108,6 +2126,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av) int masklen; char md, nd = '\0'; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn) + 2 + len); + if (p) { md = *p; *p++ = '\0'; @@ -2366,11 +2386,13 @@ ipfw_delete(char *av[]) * patterns which match interfaces. */ static void -fill_iface(ipfw_insn_if *cmd, char *arg) +fill_iface(ipfw_insn_if *cmd, char *arg, int cblen) { cmd->name[0] = '\0'; cmd->o.len |= F_INSN_SIZE(ipfw_insn_if); + CHECK_CMDLEN; + /* Parse the interface or address */ if (strcmp(arg, "any") == 0) cmd->o.len = 0; /* effectively ignore this command */ @@ -2441,8 +2463,10 @@ get_mac_addr_mask(const char *p, uint8_t * the new command in case it has been clobbered before. */ static ipfw_insn * -next_cmd(ipfw_insn *cmd) +next_cmd(ipfw_insn *cmd, int *len) { + *len -= F_LEN(cmd); + CHECK_LENGTH(*len, 0); cmd += F_LEN(cmd); bzero(cmd, sizeof(*cmd)); return cmd; @@ -2452,7 +2476,7 @@ next_cmd(ipfw_insn *cmd) * Takes arguments and copies them into a comment */ static void -fill_comment(ipfw_insn *cmd, char **av) +fill_comment(ipfw_insn *cmd, char **av, int cblen) { int i, l; char *p = (char *)(cmd + 1); @@ -2470,6 +2494,8 @@ fill_comment(ipfw_insn *cmd, char **av) "comment too long (max 80 chars)"); l = 1 + (l+3)/4; cmd->len = (cmd->len & (F_NOT | F_OR)) | l; + CHECK_CMDLEN; + for (i = 0; av[i] != NULL; i++) { strcpy(p, av[i]); p += strlen(av[i]); @@ -2495,7 +2521,7 @@ fill_cmd(ipfw_insn *cmd, enum ipfw_opcod * two microinstructions, and returns the pointer to the last one. */ static ipfw_insn * -add_mac(ipfw_insn *cmd, char *av[]) +add_mac(ipfw_insn *cmd, char *av[], int cblen) { ipfw_insn_mac *mac; @@ -2504,6 +2530,7 @@ add_mac(ipfw_insn *cmd, char *av[]) cmd->opcode = O_MACADDR2; cmd->len = (cmd->len & (F_NOT | F_OR)) | F_INSN_SIZE(ipfw_insn_mac); + CHECK_CMDLEN; mac = (ipfw_insn_mac *)cmd; get_mac_addr_mask(av[0], mac->addr, mac->mask); /* dst */ @@ -2513,12 +2540,13 @@ add_mac(ipfw_insn *cmd, char *av[]) } static ipfw_insn * -add_mactype(ipfw_insn *cmd, char *av) +add_mactype(ipfw_insn *cmd, char *av, int cblen) { if (!av) errx(EX_DATAERR, "missing MAC type"); if (strcmp(av, "any") != 0) { /* we have a non-null type */ - fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE); + fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE, + cblen); cmd->opcode = O_MAC_TYPE; return cmd; } else @@ -2587,9 +2615,9 @@ add_proto_compat(ipfw_insn *cmd, char *a } static ipfw_insn * -add_srcip(ipfw_insn *cmd, char *av) +add_srcip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2604,9 +2632,9 @@ add_srcip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_dstip(ipfw_insn *cmd, char *av) +add_dstip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2621,12 +2649,12 @@ add_dstip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode) +add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode, int cblen) { /* XXX "any" is trapped before. Perhaps "to" */ if (_substrcmp(av, "any") == 0) { return NULL; - } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto)) { + } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto, cblen)) { /* XXX todo: check that we have a protocol with ports */ cmd->opcode = opcode; return cmd; @@ -2635,7 +2663,7 @@ add_ports(ipfw_insn *cmd, char *av, u_ch } static ipfw_insn * -add_src(ipfw_insn *cmd, char *av, u_char proto) +add_src(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2648,11 +2676,11 @@ add_src(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_srcip6(cmd, av); + ret = add_srcip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_srcip(cmd, av); + ret = add_srcip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2661,7 +2689,7 @@ add_src(ipfw_insn *cmd, char *av, u_char } static ipfw_insn * -add_dst(ipfw_insn *cmd, char *av, u_char proto) +add_dst(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2674,11 +2702,11 @@ add_dst(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_dstip6(cmd, av); + ret = add_dstip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_dstip(cmd, av); + ret = add_dstip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2708,6 +2736,7 @@ ipfw_add(char *av[]) * go into actbuf[]. */ static uint32_t rulebuf[255], actbuf[255], cmdbuf[255]; + int rblen, ablen, cblen; ipfw_insn *src, *dst, *cmd, *action, *prev=NULL; ipfw_insn *first_cmd; /* first match pattern */ @@ -2738,6 +2767,15 @@ ipfw_add(char *av[]) cmd = (ipfw_insn *)cmdbuf; action = (ipfw_insn *)actbuf; + rblen = sizeof(rulebuf) / sizeof(rulebuf[0]); + rblen -= offsetof(struct ip_fw, cmd) / sizeof(rulebuf[0]); + ablen = sizeof(actbuf) / sizeof(actbuf[0]); + cblen = sizeof(cmdbuf) / sizeof(cmdbuf[0]); + cblen -= F_INSN_SIZE(ipfw_insn_u32) + 1; + +#define CHECK_RBUFLEN(len) { CHECK_LENGTH(rblen, len); rblen -= len; } +#define CHECK_ACTLEN CHECK_LENGTH(ablen, action->len) + av++; /* [rule N] -- Rule number optional */ @@ -2769,6 +2807,7 @@ ipfw_add(char *av[]) i = match_token(rule_actions, *av); av++; action->len = 1; /* default */ + CHECK_ACTLEN; switch(i) { case TOK_CHECKSTATE: have_state = action; @@ -2820,6 +2859,7 @@ ipfw_add(char *av[]) case TOK_NAT: action->opcode = O_NAT; action->len = F_INSN_SIZE(ipfw_insn_nat); + CHECK_ACTLEN; if (_substrcmp(*av, "global") == 0) { action->arg1 = 0; av++; @@ -2936,6 +2976,7 @@ chkarg: action->opcode = O_FORWARD_IP; action->len = F_INSN_SIZE(ipfw_insn_sa); + CHECK_ACTLEN; /* * In the kernel we assume AF_INET and use only @@ -2952,6 +2993,7 @@ chkarg: action->opcode = O_FORWARD_IP6; action->len = F_INSN_SIZE(ipfw_insn_sa6); + CHECK_ACTLEN; p->sa.sin6_len = sizeof(struct sockaddr_in6); p->sa.sin6_family = AF_INET6; @@ -3005,7 +3047,7 @@ chkarg: default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); } - action = next_cmd(action); + action = next_cmd(action, &ablen); /* * [altq queuename] -- altq tag, optional @@ -3027,6 +3069,7 @@ chkarg: "log cannot be specified more than once"); have_log = (ipfw_insn *)c; cmd->len = F_INSN_SIZE(ipfw_insn_log); + CHECK_CMDLEN; cmd->opcode = O_LOG; if (av[0] && _substrcmp(*av, "logamount") == 0) { av++; @@ -3058,6 +3101,7 @@ chkarg: "altq cannot be specified more than once"); have_altq = (ipfw_insn *)a; cmd->len = F_INSN_SIZE(ipfw_insn_altq); + CHECK_CMDLEN; cmd->opcode = O_ALTQ; a->qid = altq_name_to_qid(*av); av++; @@ -3083,7 +3127,7 @@ chkarg: default: abort(); } - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } if (have_state) /* must be a check-state, we are done */ @@ -3168,7 +3212,7 @@ chkarg: av++; if (F_LEN(cmd) != 0) { prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); @@ -3189,11 +3233,11 @@ chkarg: OR_START(source_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing source address"); - if (add_src(cmd, *av, proto)) { + if (add_src(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx(EX_USAGE, "bad source address %s", *av); @@ -3205,10 +3249,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if ( av[0] != NULL ) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3225,11 +3269,11 @@ chkarg: OR_START(dest_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing dst address"); - if (add_dst(cmd, *av, proto)) { + if (add_dst(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx( EX_USAGE, "bad destination address %s", *av); @@ -3241,10 +3285,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if (av[0]) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3332,7 +3376,7 @@ read_options: case TOK_VIA: NEED1("recv, xmit, via require interface name" " or address"); - fill_iface((ipfw_insn_if *)cmd, av[0]); + fill_iface((ipfw_insn_if *)cmd, av[0], cblen); av++; if (F_LEN(cmd) == 0) /* not a valid address */ break; @@ -3352,14 +3396,14 @@ read_options: case TOK_ICMP6TYPES: NEED1("icmptypes requires list of types"); - fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av); + fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av, cblen); av++; break; case TOK_IPTTL: NEED1("ipttl requires TTL"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPTTL)) + if (!add_ports(cmd, *av, 0, O_IPTTL, cblen)) errx(EX_DATAERR, "invalid ipttl %s", *av); } else fill_cmd(cmd, O_IPTTL, 0, strtoul(*av, NULL, 0)); @@ -3369,7 +3413,7 @@ read_options: case TOK_IPID: NEED1("ipid requires id"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPID)) + if (!add_ports(cmd, *av, 0, O_IPID, cblen)) errx(EX_DATAERR, "invalid ipid %s", *av); } else fill_cmd(cmd, O_IPID, 0, strtoul(*av, NULL, 0)); @@ -3379,7 +3423,7 @@ read_options: case TOK_IPLEN: NEED1("iplen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPLEN)) + if (!add_ports(cmd, *av, 0, O_IPLEN, cblen)) errx(EX_DATAERR, "invalid ip len %s", *av); } else fill_cmd(cmd, O_IPLEN, 0, strtoul(*av, NULL, 0)); @@ -3475,7 +3519,7 @@ read_options: case TOK_TCPDATALEN: NEED1("tcpdatalen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPDATALEN)) + if (!add_ports(cmd, *av, 0, O_TCPDATALEN, cblen)) errx(EX_DATAERR, "invalid tcpdata len %s", *av); } else fill_cmd(cmd, O_TCPDATALEN, 0, @@ -3501,7 +3545,7 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPWIN)) + if (!add_ports(cmd, *av, 0, O_TCPWIN, cblen)) errx(EX_DATAERR, "invalid tcpwin len %s", *av); } else fill_cmd(cmd, O_TCPWIN, 0, @@ -3540,6 +3584,7 @@ read_options: have_state = cmd; cmd->len = F_INSN_SIZE(ipfw_insn_limit); + CHECK_CMDLEN; cmd->opcode = O_LIMIT; c->limit_mask = c->conn_limit = 0; @@ -3571,28 +3616,28 @@ read_options: case TOK_SRCIP: NEED1("missing source IP"); - if (add_srcip(cmd, *av)) { + if (add_srcip(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP: NEED1("missing destination IP"); - if (add_dstip(cmd, *av)) { + if (add_dstip(cmd, *av, cblen)) { av++; } break; case TOK_SRCIP6: NEED1("missing source IP6"); - if (add_srcip6(cmd, *av)) { + if (add_srcip6(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP6: NEED1("missing destination IP6"); - if (add_dstip6(cmd, *av)) { + if (add_dstip6(cmd, *av, cblen)) { av++; } break; @@ -3600,7 +3645,7 @@ read_options: case TOK_SRCPORT: NEED1("missing source port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid source port %s", *av); @@ -3609,7 +3654,7 @@ read_options: case TOK_DSTPORT: NEED1("missing destination port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid destination port %s", @@ -3617,13 +3662,13 @@ read_options: break; case TOK_MAC: - if (add_mac(cmd, av)) + if (add_mac(cmd, av, cblen)) av += 2; break; case TOK_MACTYPE: NEED1("missing mac type"); - if (!add_mactype(cmd, *av)) + if (!add_mactype(cmd, *av, cblen)) errx(EX_DATAERR, "invalid mac type %s", *av); av++; break; @@ -3661,18 +3706,18 @@ read_options: if (proto != IPPROTO_IPV6 ) errx( EX_USAGE, "flow-id filter is active " "only for ipv6 protocol\n"); - fill_flow6( (ipfw_insn_u32 *) cmd, *av ); + fill_flow6( (ipfw_insn_u32 *) cmd, *av, cblen); av++; break; case TOK_COMMENT: - fill_comment(cmd, av); + fill_comment(cmd, av, cblen); av[0]=NULL; break; case TOK_TAGGED: if (av[0] && strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TAGGED)) + if (!add_ports(cmd, *av, 0, O_TAGGED, cblen)) errx(EX_DATAERR, "tagged: invalid tag" " list: %s", *av); } @@ -3725,7 +3770,7 @@ read_options: } if (F_LEN(cmd) > 0) { /* prepare to advance */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3754,12 +3799,13 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { fill_cmd(dst, O_PROBE_STATE, 0, 0); - dst = next_cmd(dst); + dst = next_cmd(dst, &rblen); } /* copy all commands but O_LOG, O_KEEP_STATE, O_LIMIT, O_ALTQ, O_TAG */ for (src = (ipfw_insn *)cmdbuf; src != cmd; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); switch (src->opcode) { case O_LOG: @@ -3779,6 +3825,7 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { i = F_LEN(have_state); + CHECK_RBUFLEN(i); bcopy(have_state, dst, i * sizeof(uint32_t)); dst += i; } @@ -3790,24 +3837,29 @@ done: /* put back O_LOG, O_ALTQ, O_TAG if necessary */ if (have_log) { i = F_LEN(have_log); + CHECK_RBUFLEN(i); bcopy(have_log, dst, i * sizeof(uint32_t)); dst += i; } if (have_altq) { i = F_LEN(have_altq); + CHECK_RBUFLEN(i); bcopy(have_altq, dst, i * sizeof(uint32_t)); dst += i; } if (have_tag) { i = F_LEN(have_tag); + CHECK_RBUFLEN(i); bcopy(have_tag, dst, i * sizeof(uint32_t)); dst += i; } + /* * copy all other actions */ for (src = (ipfw_insn *)actbuf; src != action; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); bcopy(src, dst, i * sizeof(uint32_t)); dst += i; } Modified: projects/calloutng/sbin/ipfw/ipfw2.h ============================================================================== --- projects/calloutng/sbin/ipfw/ipfw2.h Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/sbin/ipfw/ipfw2.h Sun Mar 3 15:19:49 2013 (r247717) @@ -283,10 +283,10 @@ void print_flow6id(struct _ipfw_insn_u32 void print_icmp6types(struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct _ipfw_insn *cmd ); -struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av); -struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av); +struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av, int cblen); +struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av, int cblen); -void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av ); +void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av, int cblen); void fill_unreach6_code(u_short *codep, char *str); -void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av); +void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av, int cblen); int fill_ext6hdr(struct _ipfw_insn *cmd, char *av); Modified: projects/calloutng/sbin/ipfw/ipv6.c ============================================================================== --- projects/calloutng/sbin/ipfw/ipv6.c Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/sbin/ipfw/ipv6.c Sun Mar 3 15:19:49 2013 (r247717) @@ -42,6 +42,11 @@ #include #include +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) + static struct _s_x icmp6codes[] = { { "no-route", ICMP6_DST_UNREACH_NOROUTE }, { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, @@ -131,10 +136,12 @@ print_ip6(ipfw_insn_ip6 *cmd, char const } void -fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av) +fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cblen) { uint8_t type; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_icmp6)); + bzero(cmd, sizeof(*cmd)); while (*av) { if (*av == ',') @@ -327,7 +334,7 @@ lookup_host6 (char *host, struct in6_add * Return 1 on success, 0 on failure. */ static int -fill_ip6(ipfw_insn_ip6 *cmd, char *av) +fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen) { int len = 0; struct in6_addr *d = &(cmd->addr6); @@ -379,6 +386,8 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) int masklen; char md = '\0'; + CHECK_LENGTH(cblen, 1 + len + 2 * F_INSN_SIZE(struct in6_addr)); + if ((p = strpbrk(av, "/,")) ) { md = *p; /* save the separator */ *p = '\0'; /* terminate address string */ @@ -453,7 +462,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) * additional flow-id we want to filter, the basic is 1 */ void -fill_flow6( ipfw_insn_u32 *cmd, char *av ) +fill_flow6( ipfw_insn_u32 *cmd, char *av, int cblen) { u_int32_t type; /* Current flow number */ u_int16_t nflow = 0; /* Current flow index */ @@ -461,6 +470,8 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av cmd->d[0] = 0; /* Initializing the base number*/ while (s) { + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_u32) + nflow + 1); + av = strsep( &s, ",") ; type = strtoul(av, &av, 0); if (*av != ',' && *av != '\0') @@ -481,10 +492,10 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av } ipfw_insn * -add_srcip6(ipfw_insn *cmd, char *av) +add_srcip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -503,10 +514,10 @@ add_srcip6(ipfw_insn *cmd, char *av) } ipfw_insn * -add_dstip6(ipfw_insn *cmd, char *av) +add_dstip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ Modified: projects/calloutng/sys/sys/systm.h ============================================================================== --- projects/calloutng/sys/sys/systm.h Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/sys/sys/systm.h Sun Mar 3 15:19:49 2013 (r247717) @@ -44,7 +44,6 @@ #include #include #include /* for people using printf mainly */ -#include extern int cold; /* nonzero if we are doing a cold boot */ extern int rebooting; /* kern_reboot() has been called. */ Modified: projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh ============================================================================== --- projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Sun Mar 3 15:19:49 2013 (r247717) @@ -29,23 +29,60 @@ . ${BACKEND}/functions-mountoptical.sh +# Performs the extraction of data to disk from FreeBSD dist files +start_extract_dist() +{ + if [ -z "$1" ] ; then exit_err "Called dist extraction with no directory set!"; fi + if [ -z "$INSFILE" ]; then exit_err "Called extraction with no install file set!"; fi + local DDIR="$1" + + # Check if we are doing an upgrade, and if so use our exclude list + if [ "${INSTALLMODE}" = "upgrade" ]; then + TAROPTS="-X ${PROGDIR}/conf/exclude-from-upgrade" + else + TAROPTS="" + fi + + # Loop though and extract dist files + for di in $INSFILE + do + # Check the MANIFEST see if we have an archive size / count + if [ -e "${DDIR}/MANIFEST" ]; then + count=`grep "^${di}.txz" ${DDIR}/MANIFEST | awk '{print $3}'` + if [ ! -z "$count" ] ; then + echo "INSTALLCOUNT: $count" + fi + fi + echo_log "pc-sysinstall: Starting Extraction (${di})" + tar -xpv -C ${FSMNT} -f ${DDIR}/${di}.txz ${TAROPTS} >&1 2>&1 + if [ $? -ne 0 ]; then + exit_err "ERROR: Failed extracting the dist file: $di" + fi + done + + # Check if this was a FTP download and clean it up now + if [ "${INSTALLMEDIUM}" = "ftp" ]; then + echo_log "Cleaning up downloaded archives" + rm -rf ${DDIR} + fi + + echo_log "pc-sysinstall: Extraction Finished" +} + # Performs the extraction of data to disk from a uzip or tar archive start_extract_uzip_tar() { - if [ -z "$INSFILE" ] - then + if [ -z "$INSFILE" ]; then exit_err "ERROR: Called extraction with no install file set!" fi # Check if we have a .count file, and echo it out for a front-end to use in progress bars - if [ -e "${INSFILE}.count" ] - then + if [ -e "${INSFILE}.count" ]; then echo "INSTALLCOUNT: `cat ${INSFILE}.count`" fi # Check if we are doing an upgrade, and if so use our exclude list - if [ "${INSTALLMODE}" = "upgrade" ] - then + if [ "${INSTALLMODE}" = "upgrade" ]; then TAROPTS="-X ${PROGDIR}/conf/exclude-from-upgrade" else TAROPTS="" @@ -87,9 +124,8 @@ start_extract_uzip_tar() mdconfig -d -u ${MDDEVICE} ;; tar) - tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 - if [ $? -ne 0 ] - then + tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 + if [ $? -ne 0 ]; then exit_err "ERROR: Failed extracting the tar image" fi ;; @@ -176,6 +212,38 @@ start_extract_split() echo_log "pc-sysinstall: Extraction Finished" }; +# Function which will attempt to fetch the dist file(s) before we start +fetch_dist_file() +{ + get_value_from_cfg ftpPath + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpPath was provided!" + fi + + FTPPATH="${VAL}" + + # Check if we have a /usr partition to save the download + if [ -d "${FSMNT}/usr" ] + then + DLDIR="${FSMNT}/usr/.fetch.$$" + else + DLDIR="${FSMNT}/.fetch.$$" + fi + mkdir -p ${DLDIR} + + # Do the fetch of the dist archive(s) now + for di in $INSFILE + do + fetch_file "${FTPPATH}/${di}.txz" "${DLDIR}/${di}.txz" "1" + done + + # Check to see if there is a MANIFEST file for this install + fetch_file "${FTPPATH}/MANIFEST" "${DLDIR}/MANIFEST" "0" + + export DLDIR +}; + # Function which will attempt to fetch the install file before we start # the install fetch_install_file() @@ -390,6 +458,13 @@ init_extraction() case $PACKAGETYPE in uzip) INSFILE="${FBSD_UZIP_FILE}" ;; tar) INSFILE="${FBSD_TAR_FILE}" ;; + dist) + get_value_from_cfg_with_spaces distFiles + if [ -z "$VAL" ] ; then + exit_err "No dist files specified!" + fi + INSFILE="${VAL}" + ;; split) INSDIR="${FBSD_BRANCH_DIR}" @@ -401,6 +476,13 @@ init_extraction() case $PACKAGETYPE in uzip) INSFILE="${UZIP_FILE}" ;; tar) INSFILE="${TAR_FILE}" ;; + dist) + get_value_from_cfg_with_spaces distFiles + if [ -z "$VAL" ] ; then + exit_err "No dist files specified!" + fi + INSFILE="${VAL}" + ;; esac fi export INSFILE @@ -417,22 +499,32 @@ init_extraction() start_extract_split else - INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE - start_extract_uzip_tar + if [ "$PACKAGETYPE" = "dist" ] ; then + start_extract_dist "${CDMNT}/usr/freebsd-dist" + else + INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + fi fi ;; ftp) - if [ "$PACKAGETYPE" = "split" ] - then - fetch_split_files + case $PACKAGETYPE in + split) + fetch_split_files - INSDIR="${INSFILE}" ; export INSDIR - start_extract_split - else - fetch_install_file - start_extract_uzip_tar - fi + INSDIR="${INSFILE}" ; export INSDIR + start_extract_split + ;; + dist) + fetch_dist_file + start_extract_dist "$DLDIR" + ;; + *) + fetch_install_file + start_extract_uzip_tar + ;; + esac ;; sftp) ;; @@ -446,8 +538,13 @@ init_extraction() exit_err "Install medium was set to local, but no localPath was provided!" fi LOCALPATH=$VAL - INSFILE="${LOCALPATH}/${INSFILE}" ; export INSFILE - start_extract_uzip_tar + if [ "$PACKAGETYPE" = "dist" ] ; then + INSFILE="${INSFILE}" ; export INSFILE + start_extract_dist "$LOCALPATH" + else + INSFILE="${LOCALPATH}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + fi ;; *) exit_err "ERROR: Unknown install medium" ;; esac Modified: projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-parse.sh ============================================================================== --- projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-parse.sh Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-parse.sh Sun Mar 3 15:19:49 2013 (r247717) @@ -45,7 +45,7 @@ get_value_from_cfg_with_spaces() { if [ -n "${1}" ] then - export VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2-` + export VAL="`grep ^${1}= ${CFGF} | head -n 1 | cut -d '=' -f 2-`" else exit_err "Error: Did we forgot to supply a setting to grab?" fi Modified: projects/calloutng/usr.sbin/pc-sysinstall/backend/parseconfig.sh ============================================================================== --- projects/calloutng/usr.sbin/pc-sysinstall/backend/parseconfig.sh Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/usr.sbin/pc-sysinstall/backend/parseconfig.sh Sun Mar 3 15:19:49 2013 (r247717) @@ -69,7 +69,7 @@ file_sanity_check "installMode installTy check_value installMode "fresh upgrade extract" check_value installType "PCBSD FreeBSD" check_value installMedium "dvd usb ftp rsync image local" -check_value packageType "uzip tar rsync split" +check_value packageType "uzip tar rsync split dist" if_check_value_exists mirrorbal "load prefer round-robin split" # We passed all sanity checks! Yay, lets start the install Modified: projects/calloutng/usr.sbin/pc-sysinstall/examples/README ============================================================================== --- projects/calloutng/usr.sbin/pc-sysinstall/examples/README Sun Mar 3 15:02:56 2013 (r247716) +++ projects/calloutng/usr.sbin/pc-sysinstall/examples/README Sun Mar 3 15:19:49 2013 (r247717) @@ -243,11 +243,16 @@ Set installMedium= to the source type we *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 09:36:29 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6E9D5798; Mon, 4 Mar 2013 09:36:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 537BD8E6; Mon, 4 Mar 2013 09:36:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r249aASx096013; Mon, 4 Mar 2013 09:36:17 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r249ZuAt095981; Mon, 4 Mar 2013 09:35:56 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303040935.r249ZuAt095981@svn.freebsd.org> From: Martin Matuska Date: Mon, 4 Mar 2013 09:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247775 - in projects/libzfs_core: . bin/sh lib/libedit sbin/devd sbin/ipfw share/man/man4 sys/compat/linprocfs sys/compat/linux sys/dev/ath sys/dev/ath/ath_hal sys/dev/ath/ath_hal/ar54... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 09:36:29 -0000 Author: mm Date: Mon Mar 4 09:35:50 2013 New Revision: 247775 URL: http://svnweb.freebsd.org/changeset/base/247775 Log: MFC @247774 Added: projects/libzfs_core/tools/regression/bin/sh/builtins/trap12.0 - copied unchanged from r247774, head/tools/regression/bin/sh/builtins/trap12.0 Modified: projects/libzfs_core/MAINTAINERS (contents, props changed) projects/libzfs_core/ObsoleteFiles.inc projects/libzfs_core/bin/sh/trap.c projects/libzfs_core/lib/libedit/Makefile projects/libzfs_core/sbin/devd/devd.cc projects/libzfs_core/sbin/devd/devd.hh projects/libzfs_core/sbin/ipfw/ipfw2.c projects/libzfs_core/sbin/ipfw/ipfw2.h projects/libzfs_core/sbin/ipfw/ipv6.c projects/libzfs_core/share/man/man4/mvs.4 projects/libzfs_core/sys/compat/linprocfs/linprocfs.c projects/libzfs_core/sys/compat/linux/linux_file.c projects/libzfs_core/sys/compat/linux/linux_socket.c projects/libzfs_core/sys/dev/ath/ath_hal/ah.h projects/libzfs_core/sys/dev/ath/ath_hal/ar5416/ar5416.h projects/libzfs_core/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/libzfs_core/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/libzfs_core/sys/dev/ath/if_athvar.h projects/libzfs_core/sys/kern/kern_descrip.c projects/libzfs_core/sys/kern/kern_timeout.c projects/libzfs_core/sys/kern/uipc_usrreq.c projects/libzfs_core/sys/modules/mqueue/Makefile projects/libzfs_core/sys/sys/filedesc.h projects/libzfs_core/sys/sys/systm.h projects/libzfs_core/usr.bin/calendar/calendars/calendar.birthday projects/libzfs_core/usr.bin/find/extern.h projects/libzfs_core/usr.bin/find/find.1 projects/libzfs_core/usr.bin/find/function.c projects/libzfs_core/usr.bin/find/option.c projects/libzfs_core/usr.bin/hexdump/conv.c projects/libzfs_core/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh projects/libzfs_core/usr.sbin/pc-sysinstall/backend/functions-disk.sh projects/libzfs_core/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh projects/libzfs_core/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh projects/libzfs_core/usr.sbin/pc-sysinstall/backend/functions-newfs.sh projects/libzfs_core/usr.sbin/pc-sysinstall/backend/functions-packages.sh projects/libzfs_core/usr.sbin/pc-sysinstall/backend/functions.sh projects/libzfs_core/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Directory Properties: projects/libzfs_core/ (props changed) projects/libzfs_core/sbin/ (props changed) projects/libzfs_core/sbin/ipfw/ (props changed) projects/libzfs_core/share/man/man4/ (props changed) projects/libzfs_core/sys/ (props changed) projects/libzfs_core/usr.bin/calendar/ (props changed) Modified: projects/libzfs_core/MAINTAINERS ============================================================================== --- projects/libzfs_core/MAINTAINERS Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/MAINTAINERS Mon Mar 4 09:35:50 2013 (r247775) @@ -124,3 +124,6 @@ isci(4) jimharris Pre-commit review req cmx daniel@roe.ch Pre-commit review preferred. filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. +sh(1) jilles Pre-commit review requested. This also applies + to kill(1), printf(1) and test(1) which are + compiled in as builtins. Modified: projects/libzfs_core/ObsoleteFiles.inc ============================================================================== --- projects/libzfs_core/ObsoleteFiles.inc Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/ObsoleteFiles.inc Mon Mar 4 09:35:50 2013 (r247775) @@ -39,6 +39,8 @@ # done # 20130302: NTFS support removed +OLD_FILES+=rescue/mount_ntfs +OLD_FILES+=sbin/mount_ntfs OLD_FILES+=usr/include/fs/ntfs/ntfs.h OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h @@ -51,6 +53,7 @@ OLD_FILES+=usr/share/man/man8/mount_ntfs # 20130302: PORTALFS support removed OLD_FILES+=usr/include/fs/portalfs/portal.h OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/sbin/mount_portalfs OLD_FILES+=usr/share/examples/portal/README OLD_FILES+=usr/share/examples/portal/portal.conf OLD_DIRS+=usr/share/examples/portal @@ -79,9 +82,10 @@ OLD_DIRS+=var/remote # 20121114: zpool-features manual page moved from section 5 to 7 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz # 20121022: remove harp, hfa and idt man page -OLD_FILES+=share/man/man4/harp.4 -OLD_FILES+=share/man/man4/hfa.4 -OLD_FILES+=share/man/man4/idt.4 +OLD_FILES+=usr/share/man/man4/harp.4.gz +OLD_FILES+=usr/share/man/man4/hfa.4.gz +OLD_FILES+=usr/share/man/man4/idt.4.gz +OLD_FILES+=usr/share/man/man4/if_idt.4.gz # 20121022: VFS_LOCK_GIANT elimination OLD_FILES+=usr/share/man/man9/VFS_LOCK_GIANT.9.gz OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz Modified: projects/libzfs_core/bin/sh/trap.c ============================================================================== --- projects/libzfs_core/bin/sh/trap.c Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/bin/sh/trap.c Mon Mar 4 09:35:50 2013 (r247775) @@ -455,7 +455,6 @@ dotrap(void) last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); - exitstatus = savestatus; /* * If such a command was not @@ -464,9 +463,11 @@ dotrap(void) * trap action to have an effect * outside of it. */ - if (prev_evalskip != 0) { + if (evalskip == 0 || + prev_evalskip != 0) { evalskip = prev_evalskip; skipcount = prev_skipcount; + exitstatus = savestatus; } if (i == SIGCHLD) Modified: projects/libzfs_core/lib/libedit/Makefile ============================================================================== --- projects/libzfs_core/lib/libedit/Makefile Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/lib/libedit/Makefile Mon Mar 4 09:35:50 2013 (r247775) @@ -11,6 +11,7 @@ OSRCS= chared.c common.c el.c emacs.c fc parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} +LDADD= -lncurses MAN= editline.3 editrc.5 Modified: projects/libzfs_core/sbin/devd/devd.cc ============================================================================== --- projects/libzfs_core/sbin/devd/devd.cc Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sbin/devd/devd.cc Mon Mar 4 09:35:50 2013 (r247775) @@ -116,7 +116,7 @@ static struct pidfh *pfh; int Dflag; int dflag; int nflag; -int romeo_must_die = 0; +static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; @@ -319,7 +319,7 @@ media::do_match(config &c) // the name of interest, first try device-name and fall back // to subsystem if none exists. value = c.get_variable("device-name"); - if (value.length() == 0) + if (value.empty()) value = c.get_variable("subsystem"); if (Dflag) fprintf(stderr, "Testing media type of %s against 0x%x\n", @@ -460,7 +460,7 @@ config::open_pidfile() { pid_t otherpid; - if (_pidfile == "") + if (_pidfile.empty()) return; pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); if (pfh == NULL) { @@ -528,7 +528,7 @@ config::add_notify(int prio, event_proc void config::set_pidfile(const char *fn) { - _pidfile = string(fn); + _pidfile = fn; } void @@ -585,7 +585,7 @@ config::expand_one(const char *&src, str src++; // $$ -> $ if (*src == '$') { - dst.append(src++, 1); + dst += *src++; return; } @@ -593,7 +593,7 @@ config::expand_one(const char *&src, str // Not sure if I want to support this or not, so for now we just pass // it through. if (*src == '(') { - dst.append("$"); + dst += '$'; count = 1; /* If the string ends before ) is matched , return. */ while (count > 0 && *src) { @@ -601,23 +601,23 @@ config::expand_one(const char *&src, str count--; else if (*src == '(') count++; - dst.append(src++, 1); + dst += *src++; } return; } - // ${^A-Za-z] -> $\1 + // $[^A-Za-z] -> $\1 if (!isalpha(*src)) { - dst.append("$"); - dst.append(src++, 1); + dst += '$'; + dst += *src++; return; } // $var -> replace with value do { - buffer.append(src++, 1); + buffer += *src++; } while (is_id_char(*src)); - dst.append(get_variable(buffer.c_str())); + dst.append(get_variable(buffer)); } const string @@ -653,7 +653,7 @@ config::expand_string(const char *src, c } bool -config::chop_var(char *&buffer, char *&lhs, char *&rhs) +config::chop_var(char *&buffer, char *&lhs, char *&rhs) const { char *walker; @@ -912,9 +912,7 @@ event_loop(void) server_fd = create_socket(PIPE); accepting = 1; max_fd = max(fd, server_fd) + 1; - while (1) { - if (romeo_must_die) - break; + while (!romeo_must_die) { if (!once && !dflag && !nflag) { // Check to see if we have any events pending. tv.tv_sec = 0; @@ -1076,8 +1074,7 @@ set_variable(const char *var, const char static void gensighand(int) { - romeo_must_die++; - _exit(0); + romeo_must_die = 1; } static void Modified: projects/libzfs_core/sbin/devd/devd.hh ============================================================================== --- projects/libzfs_core/sbin/devd/devd.hh Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sbin/devd/devd.hh Mon Mar 4 09:35:50 2013 (r247775) @@ -41,8 +41,6 @@ class config; class var_list { public: - var_list() {} - virtual ~var_list() {} /** Set a variable in this var list. */ void set_variable(const std::string &var, const std::string &val); @@ -68,7 +66,6 @@ private: struct eps { public: - eps() {} virtual ~eps() {} /** Does this eps match the current config? */ @@ -144,7 +141,7 @@ private: class config { public: - config() : _pidfile("") { push_var_table(); } + config() { push_var_table(); } virtual ~config() { reset(); } void add_attach(int, event_proc *); void add_detach(int, event_proc *); @@ -172,7 +169,7 @@ protected: void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); bool is_id_char(char) const; - bool chop_var(char *&buffer, char *&lhs, char *&rhs); + bool chop_var(char *&buffer, char *&lhs, char *&rhs) const; private: std::vector _dir_list; std::string _pidfile; Modified: projects/libzfs_core/sbin/ipfw/ipfw2.c ============================================================================== --- projects/libzfs_core/sbin/ipfw/ipfw2.c Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sbin/ipfw/ipfw2.c Mon Mar 4 09:35:50 2013 (r247775) @@ -64,6 +64,22 @@ int ipfw_socket = -1; #define s6_addr32 __u6_addr.__u6_addr32 #endif +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) +/* + * Check if we have enough space in cmd buffer. Note that since + * first 8? u32 words are reserved by reserved header, full cmd + * buffer can't be used, so we need to protect from buffer overrun + * only. At the beginnig, cblen is less than actual buffer size by + * size of ipfw_insn_u32 instruction + 1 u32 work. This eliminates need + * for checking small instructions fitting in given range. + * We also (ab)use the fact that ipfw_insn is always the first field + * for any custom instruction. + */ +#define CHECK_CMDLEN CHECK_LENGTH(cblen, F_LEN((ipfw_insn *)cmd)) + #define GET_UINT_ARG(arg, min, max, tok, s_x) do { \ if (!av[0]) \ errx(EX_USAGE, "%s: missing argument", match_value(s_x, tok)); \ @@ -653,7 +669,7 @@ strtoport(char *s, char **end, int base, * Fill the body of the command with the list of port ranges. */ static int -fill_newports(ipfw_insn_u16 *cmd, char *av, int proto) +fill_newports(ipfw_insn_u16 *cmd, char *av, int proto, int cblen) { uint16_t a, b, *p = cmd->ports; int i = 0; @@ -664,6 +680,8 @@ fill_newports(ipfw_insn_u16 *cmd, char * if (s == av) /* empty or invalid argument */ return (0); + CHECK_LENGTH(cblen, i + 2); + switch (*s) { case '-': /* a range */ av = s + 1; @@ -2068,7 +2086,7 @@ lookup_host (char *host, struct in_addr * We can have multiple comma-separated address/mask entries. */ static void -fill_ip(ipfw_insn_ip *cmd, char *av) +fill_ip(ipfw_insn_ip *cmd, char *av, int cblen) { int len = 0; uint32_t *d = ((ipfw_insn_u32 *)cmd)->d; @@ -2108,6 +2126,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av) int masklen; char md, nd = '\0'; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn) + 2 + len); + if (p) { md = *p; *p++ = '\0'; @@ -2366,11 +2386,13 @@ ipfw_delete(char *av[]) * patterns which match interfaces. */ static void -fill_iface(ipfw_insn_if *cmd, char *arg) +fill_iface(ipfw_insn_if *cmd, char *arg, int cblen) { cmd->name[0] = '\0'; cmd->o.len |= F_INSN_SIZE(ipfw_insn_if); + CHECK_CMDLEN; + /* Parse the interface or address */ if (strcmp(arg, "any") == 0) cmd->o.len = 0; /* effectively ignore this command */ @@ -2441,8 +2463,10 @@ get_mac_addr_mask(const char *p, uint8_t * the new command in case it has been clobbered before. */ static ipfw_insn * -next_cmd(ipfw_insn *cmd) +next_cmd(ipfw_insn *cmd, int *len) { + *len -= F_LEN(cmd); + CHECK_LENGTH(*len, 0); cmd += F_LEN(cmd); bzero(cmd, sizeof(*cmd)); return cmd; @@ -2452,7 +2476,7 @@ next_cmd(ipfw_insn *cmd) * Takes arguments and copies them into a comment */ static void -fill_comment(ipfw_insn *cmd, char **av) +fill_comment(ipfw_insn *cmd, char **av, int cblen) { int i, l; char *p = (char *)(cmd + 1); @@ -2470,6 +2494,8 @@ fill_comment(ipfw_insn *cmd, char **av) "comment too long (max 80 chars)"); l = 1 + (l+3)/4; cmd->len = (cmd->len & (F_NOT | F_OR)) | l; + CHECK_CMDLEN; + for (i = 0; av[i] != NULL; i++) { strcpy(p, av[i]); p += strlen(av[i]); @@ -2495,7 +2521,7 @@ fill_cmd(ipfw_insn *cmd, enum ipfw_opcod * two microinstructions, and returns the pointer to the last one. */ static ipfw_insn * -add_mac(ipfw_insn *cmd, char *av[]) +add_mac(ipfw_insn *cmd, char *av[], int cblen) { ipfw_insn_mac *mac; @@ -2504,6 +2530,7 @@ add_mac(ipfw_insn *cmd, char *av[]) cmd->opcode = O_MACADDR2; cmd->len = (cmd->len & (F_NOT | F_OR)) | F_INSN_SIZE(ipfw_insn_mac); + CHECK_CMDLEN; mac = (ipfw_insn_mac *)cmd; get_mac_addr_mask(av[0], mac->addr, mac->mask); /* dst */ @@ -2513,12 +2540,13 @@ add_mac(ipfw_insn *cmd, char *av[]) } static ipfw_insn * -add_mactype(ipfw_insn *cmd, char *av) +add_mactype(ipfw_insn *cmd, char *av, int cblen) { if (!av) errx(EX_DATAERR, "missing MAC type"); if (strcmp(av, "any") != 0) { /* we have a non-null type */ - fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE); + fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE, + cblen); cmd->opcode = O_MAC_TYPE; return cmd; } else @@ -2587,9 +2615,9 @@ add_proto_compat(ipfw_insn *cmd, char *a } static ipfw_insn * -add_srcip(ipfw_insn *cmd, char *av) +add_srcip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2604,9 +2632,9 @@ add_srcip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_dstip(ipfw_insn *cmd, char *av) +add_dstip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2621,12 +2649,12 @@ add_dstip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode) +add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode, int cblen) { /* XXX "any" is trapped before. Perhaps "to" */ if (_substrcmp(av, "any") == 0) { return NULL; - } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto)) { + } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto, cblen)) { /* XXX todo: check that we have a protocol with ports */ cmd->opcode = opcode; return cmd; @@ -2635,7 +2663,7 @@ add_ports(ipfw_insn *cmd, char *av, u_ch } static ipfw_insn * -add_src(ipfw_insn *cmd, char *av, u_char proto) +add_src(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2648,11 +2676,11 @@ add_src(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_srcip6(cmd, av); + ret = add_srcip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_srcip(cmd, av); + ret = add_srcip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2661,7 +2689,7 @@ add_src(ipfw_insn *cmd, char *av, u_char } static ipfw_insn * -add_dst(ipfw_insn *cmd, char *av, u_char proto) +add_dst(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2674,11 +2702,11 @@ add_dst(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_dstip6(cmd, av); + ret = add_dstip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_dstip(cmd, av); + ret = add_dstip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2708,6 +2736,7 @@ ipfw_add(char *av[]) * go into actbuf[]. */ static uint32_t rulebuf[255], actbuf[255], cmdbuf[255]; + int rblen, ablen, cblen; ipfw_insn *src, *dst, *cmd, *action, *prev=NULL; ipfw_insn *first_cmd; /* first match pattern */ @@ -2738,6 +2767,15 @@ ipfw_add(char *av[]) cmd = (ipfw_insn *)cmdbuf; action = (ipfw_insn *)actbuf; + rblen = sizeof(rulebuf) / sizeof(rulebuf[0]); + rblen -= offsetof(struct ip_fw, cmd) / sizeof(rulebuf[0]); + ablen = sizeof(actbuf) / sizeof(actbuf[0]); + cblen = sizeof(cmdbuf) / sizeof(cmdbuf[0]); + cblen -= F_INSN_SIZE(ipfw_insn_u32) + 1; + +#define CHECK_RBUFLEN(len) { CHECK_LENGTH(rblen, len); rblen -= len; } +#define CHECK_ACTLEN CHECK_LENGTH(ablen, action->len) + av++; /* [rule N] -- Rule number optional */ @@ -2769,6 +2807,7 @@ ipfw_add(char *av[]) i = match_token(rule_actions, *av); av++; action->len = 1; /* default */ + CHECK_ACTLEN; switch(i) { case TOK_CHECKSTATE: have_state = action; @@ -2820,6 +2859,7 @@ ipfw_add(char *av[]) case TOK_NAT: action->opcode = O_NAT; action->len = F_INSN_SIZE(ipfw_insn_nat); + CHECK_ACTLEN; if (_substrcmp(*av, "global") == 0) { action->arg1 = 0; av++; @@ -2936,6 +2976,7 @@ chkarg: action->opcode = O_FORWARD_IP; action->len = F_INSN_SIZE(ipfw_insn_sa); + CHECK_ACTLEN; /* * In the kernel we assume AF_INET and use only @@ -2952,6 +2993,7 @@ chkarg: action->opcode = O_FORWARD_IP6; action->len = F_INSN_SIZE(ipfw_insn_sa6); + CHECK_ACTLEN; p->sa.sin6_len = sizeof(struct sockaddr_in6); p->sa.sin6_family = AF_INET6; @@ -3005,7 +3047,7 @@ chkarg: default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); } - action = next_cmd(action); + action = next_cmd(action, &ablen); /* * [altq queuename] -- altq tag, optional @@ -3027,6 +3069,7 @@ chkarg: "log cannot be specified more than once"); have_log = (ipfw_insn *)c; cmd->len = F_INSN_SIZE(ipfw_insn_log); + CHECK_CMDLEN; cmd->opcode = O_LOG; if (av[0] && _substrcmp(*av, "logamount") == 0) { av++; @@ -3058,6 +3101,7 @@ chkarg: "altq cannot be specified more than once"); have_altq = (ipfw_insn *)a; cmd->len = F_INSN_SIZE(ipfw_insn_altq); + CHECK_CMDLEN; cmd->opcode = O_ALTQ; a->qid = altq_name_to_qid(*av); av++; @@ -3083,7 +3127,7 @@ chkarg: default: abort(); } - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } if (have_state) /* must be a check-state, we are done */ @@ -3168,7 +3212,7 @@ chkarg: av++; if (F_LEN(cmd) != 0) { prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); @@ -3189,11 +3233,11 @@ chkarg: OR_START(source_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing source address"); - if (add_src(cmd, *av, proto)) { + if (add_src(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx(EX_USAGE, "bad source address %s", *av); @@ -3205,10 +3249,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if ( av[0] != NULL ) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3225,11 +3269,11 @@ chkarg: OR_START(dest_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing dst address"); - if (add_dst(cmd, *av, proto)) { + if (add_dst(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx( EX_USAGE, "bad destination address %s", *av); @@ -3241,10 +3285,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if (av[0]) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3332,7 +3376,7 @@ read_options: case TOK_VIA: NEED1("recv, xmit, via require interface name" " or address"); - fill_iface((ipfw_insn_if *)cmd, av[0]); + fill_iface((ipfw_insn_if *)cmd, av[0], cblen); av++; if (F_LEN(cmd) == 0) /* not a valid address */ break; @@ -3352,14 +3396,14 @@ read_options: case TOK_ICMP6TYPES: NEED1("icmptypes requires list of types"); - fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av); + fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av, cblen); av++; break; case TOK_IPTTL: NEED1("ipttl requires TTL"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPTTL)) + if (!add_ports(cmd, *av, 0, O_IPTTL, cblen)) errx(EX_DATAERR, "invalid ipttl %s", *av); } else fill_cmd(cmd, O_IPTTL, 0, strtoul(*av, NULL, 0)); @@ -3369,7 +3413,7 @@ read_options: case TOK_IPID: NEED1("ipid requires id"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPID)) + if (!add_ports(cmd, *av, 0, O_IPID, cblen)) errx(EX_DATAERR, "invalid ipid %s", *av); } else fill_cmd(cmd, O_IPID, 0, strtoul(*av, NULL, 0)); @@ -3379,7 +3423,7 @@ read_options: case TOK_IPLEN: NEED1("iplen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPLEN)) + if (!add_ports(cmd, *av, 0, O_IPLEN, cblen)) errx(EX_DATAERR, "invalid ip len %s", *av); } else fill_cmd(cmd, O_IPLEN, 0, strtoul(*av, NULL, 0)); @@ -3475,7 +3519,7 @@ read_options: case TOK_TCPDATALEN: NEED1("tcpdatalen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPDATALEN)) + if (!add_ports(cmd, *av, 0, O_TCPDATALEN, cblen)) errx(EX_DATAERR, "invalid tcpdata len %s", *av); } else fill_cmd(cmd, O_TCPDATALEN, 0, @@ -3501,7 +3545,7 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPWIN)) + if (!add_ports(cmd, *av, 0, O_TCPWIN, cblen)) errx(EX_DATAERR, "invalid tcpwin len %s", *av); } else fill_cmd(cmd, O_TCPWIN, 0, @@ -3540,6 +3584,7 @@ read_options: have_state = cmd; cmd->len = F_INSN_SIZE(ipfw_insn_limit); + CHECK_CMDLEN; cmd->opcode = O_LIMIT; c->limit_mask = c->conn_limit = 0; @@ -3571,28 +3616,28 @@ read_options: case TOK_SRCIP: NEED1("missing source IP"); - if (add_srcip(cmd, *av)) { + if (add_srcip(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP: NEED1("missing destination IP"); - if (add_dstip(cmd, *av)) { + if (add_dstip(cmd, *av, cblen)) { av++; } break; case TOK_SRCIP6: NEED1("missing source IP6"); - if (add_srcip6(cmd, *av)) { + if (add_srcip6(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP6: NEED1("missing destination IP6"); - if (add_dstip6(cmd, *av)) { + if (add_dstip6(cmd, *av, cblen)) { av++; } break; @@ -3600,7 +3645,7 @@ read_options: case TOK_SRCPORT: NEED1("missing source port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid source port %s", *av); @@ -3609,7 +3654,7 @@ read_options: case TOK_DSTPORT: NEED1("missing destination port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid destination port %s", @@ -3617,13 +3662,13 @@ read_options: break; case TOK_MAC: - if (add_mac(cmd, av)) + if (add_mac(cmd, av, cblen)) av += 2; break; case TOK_MACTYPE: NEED1("missing mac type"); - if (!add_mactype(cmd, *av)) + if (!add_mactype(cmd, *av, cblen)) errx(EX_DATAERR, "invalid mac type %s", *av); av++; break; @@ -3661,18 +3706,18 @@ read_options: if (proto != IPPROTO_IPV6 ) errx( EX_USAGE, "flow-id filter is active " "only for ipv6 protocol\n"); - fill_flow6( (ipfw_insn_u32 *) cmd, *av ); + fill_flow6( (ipfw_insn_u32 *) cmd, *av, cblen); av++; break; case TOK_COMMENT: - fill_comment(cmd, av); + fill_comment(cmd, av, cblen); av[0]=NULL; break; case TOK_TAGGED: if (av[0] && strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TAGGED)) + if (!add_ports(cmd, *av, 0, O_TAGGED, cblen)) errx(EX_DATAERR, "tagged: invalid tag" " list: %s", *av); } @@ -3725,7 +3770,7 @@ read_options: } if (F_LEN(cmd) > 0) { /* prepare to advance */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3754,12 +3799,13 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { fill_cmd(dst, O_PROBE_STATE, 0, 0); - dst = next_cmd(dst); + dst = next_cmd(dst, &rblen); } /* copy all commands but O_LOG, O_KEEP_STATE, O_LIMIT, O_ALTQ, O_TAG */ for (src = (ipfw_insn *)cmdbuf; src != cmd; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); switch (src->opcode) { case O_LOG: @@ -3779,6 +3825,7 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { i = F_LEN(have_state); + CHECK_RBUFLEN(i); bcopy(have_state, dst, i * sizeof(uint32_t)); dst += i; } @@ -3790,24 +3837,29 @@ done: /* put back O_LOG, O_ALTQ, O_TAG if necessary */ if (have_log) { i = F_LEN(have_log); + CHECK_RBUFLEN(i); bcopy(have_log, dst, i * sizeof(uint32_t)); dst += i; } if (have_altq) { i = F_LEN(have_altq); + CHECK_RBUFLEN(i); bcopy(have_altq, dst, i * sizeof(uint32_t)); dst += i; } if (have_tag) { i = F_LEN(have_tag); + CHECK_RBUFLEN(i); bcopy(have_tag, dst, i * sizeof(uint32_t)); dst += i; } + /* * copy all other actions */ for (src = (ipfw_insn *)actbuf; src != action; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); bcopy(src, dst, i * sizeof(uint32_t)); dst += i; } Modified: projects/libzfs_core/sbin/ipfw/ipfw2.h ============================================================================== --- projects/libzfs_core/sbin/ipfw/ipfw2.h Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sbin/ipfw/ipfw2.h Mon Mar 4 09:35:50 2013 (r247775) @@ -283,10 +283,10 @@ void print_flow6id(struct _ipfw_insn_u32 void print_icmp6types(struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct _ipfw_insn *cmd ); -struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av); -struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av); +struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av, int cblen); +struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av, int cblen); -void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av ); +void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av, int cblen); void fill_unreach6_code(u_short *codep, char *str); -void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av); +void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av, int cblen); int fill_ext6hdr(struct _ipfw_insn *cmd, char *av); Modified: projects/libzfs_core/sbin/ipfw/ipv6.c ============================================================================== --- projects/libzfs_core/sbin/ipfw/ipv6.c Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sbin/ipfw/ipv6.c Mon Mar 4 09:35:50 2013 (r247775) @@ -42,6 +42,11 @@ #include #include +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) + static struct _s_x icmp6codes[] = { { "no-route", ICMP6_DST_UNREACH_NOROUTE }, { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, @@ -131,10 +136,12 @@ print_ip6(ipfw_insn_ip6 *cmd, char const } void -fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av) +fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cblen) { uint8_t type; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_icmp6)); + bzero(cmd, sizeof(*cmd)); while (*av) { if (*av == ',') @@ -327,7 +334,7 @@ lookup_host6 (char *host, struct in6_add * Return 1 on success, 0 on failure. */ static int -fill_ip6(ipfw_insn_ip6 *cmd, char *av) +fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen) { int len = 0; struct in6_addr *d = &(cmd->addr6); @@ -379,6 +386,8 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) int masklen; char md = '\0'; + CHECK_LENGTH(cblen, 1 + len + 2 * F_INSN_SIZE(struct in6_addr)); + if ((p = strpbrk(av, "/,")) ) { md = *p; /* save the separator */ *p = '\0'; /* terminate address string */ @@ -453,7 +462,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) * additional flow-id we want to filter, the basic is 1 */ void -fill_flow6( ipfw_insn_u32 *cmd, char *av ) +fill_flow6( ipfw_insn_u32 *cmd, char *av, int cblen) { u_int32_t type; /* Current flow number */ u_int16_t nflow = 0; /* Current flow index */ @@ -461,6 +470,8 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av cmd->d[0] = 0; /* Initializing the base number*/ while (s) { + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_u32) + nflow + 1); + av = strsep( &s, ",") ; type = strtoul(av, &av, 0); if (*av != ',' && *av != '\0') @@ -481,10 +492,10 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av } ipfw_insn * -add_srcip6(ipfw_insn *cmd, char *av) +add_srcip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -503,10 +514,10 @@ add_srcip6(ipfw_insn *cmd, char *av) } ipfw_insn * -add_dstip6(ipfw_insn *cmd, char *av) +add_dstip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ Modified: projects/libzfs_core/share/man/man4/mvs.4 ============================================================================== --- projects/libzfs_core/share/man/man4/mvs.4 Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/share/man/man4/mvs.4 Mon Mar 4 09:35:50 2013 (r247775) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2010 +.Dd March 3, 2013 .Dt MVS 4 .Os .Sh NAME @@ -62,7 +62,7 @@ command latency. .It Va hint.mvs. Ns Ar X Ns Va .cccc defines number of completed commands for CCC, which trigger interrupt without waiting for specified coalescing timeout. -.It Va hint.mvs. Ns Ar X Ns Va .pm_level +.It Va hint.mvsch. Ns Ar X Ns Va .pm_level controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. @@ -82,7 +82,7 @@ driver initiates SLUMBER PM state transi Note that interface Power Management is not compatible with device presence detection. A manual bus reset is needed on device hot-plug. -.It Va hint.mvs. Ns Ar X Ns Va .sata_rev +.It Va hint.mvsch. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .El Modified: projects/libzfs_core/sys/compat/linprocfs/linprocfs.c ============================================================================== --- projects/libzfs_core/sys/compat/linprocfs/linprocfs.c Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sys/compat/linprocfs/linprocfs.c Mon Mar 4 09:35:50 2013 (r247775) @@ -386,8 +386,7 @@ linprocfs_domtab(PFS_FILL_ARGS) sbuf_printf(sb, " 0 0\n"); } mtx_unlock(&mountlist_mtx); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } @@ -447,8 +446,7 @@ linprocfs_dopartitions(PFS_FILL_ARGS) } g_topology_unlock(); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } Modified: projects/libzfs_core/sys/compat/linux/linux_file.c ============================================================================== --- projects/libzfs_core/sys/compat/linux/linux_file.c Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sys/compat/linux/linux_file.c Mon Mar 4 09:35:50 2013 (r247775) @@ -517,8 +517,7 @@ eof: td->td_retval[0] = nbytes - resid; out: - if (cookies) - free(cookies, M_TEMP); + free(cookies, M_TEMP); VOP_UNLOCK(vp, 0); foffset_unlock(fp, off, 0); Modified: projects/libzfs_core/sys/compat/linux/linux_socket.c ============================================================================== --- projects/libzfs_core/sys/compat/linux/linux_socket.c Mon Mar 4 07:40:49 2013 (r247774) +++ projects/libzfs_core/sys/compat/linux/linux_socket.c Mon Mar 4 09:35:50 2013 (r247775) @@ -1443,10 +1443,8 @@ out: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 18:07:36 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9A6F3272; Mon, 4 Mar 2013 18:07:36 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D286B91; Mon, 4 Mar 2013 18:07:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24I7aTU050504; Mon, 4 Mar 2013 18:07:36 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24I7SmM050447; Mon, 4 Mar 2013 18:07:28 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201303041807.r24I7SmM050447@svn.freebsd.org> From: Davide Italiano Date: Mon, 4 Mar 2013 18:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247807 - in projects/calloutng: bin/sh contrib/libyaml lib lib/libyaml sbin/devd share/man/man4 share/man/man7 share/mk sys/arm/arm sys/compat/linprocfs sys/compat/linux sys/dev/ath sy... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 18:07:36 -0000 Author: davide Date: Mon Mar 4 18:07:28 2013 New Revision: 247807 URL: http://svnweb.freebsd.org/changeset/base/247807 Log: Merge from head (and resolve conflicts). Added: projects/calloutng/contrib/libyaml/ - copied from r247806, head/contrib/libyaml/ projects/calloutng/lib/libyaml/ - copied from r247806, head/lib/libyaml/ projects/calloutng/tools/regression/bin/sh/builtins/trap12.0 - copied unchanged from r247806, head/tools/regression/bin/sh/builtins/trap12.0 Modified: projects/calloutng/bin/sh/trap.c projects/calloutng/lib/Makefile projects/calloutng/sbin/devd/devd.cc projects/calloutng/sbin/devd/devd.hh projects/calloutng/share/man/man4/mvs.4 projects/calloutng/share/man/man7/ports.7 projects/calloutng/share/mk/bsd.libnames.mk projects/calloutng/sys/arm/arm/busdma_machdep-v6.c projects/calloutng/sys/compat/linprocfs/linprocfs.c projects/calloutng/sys/compat/linux/linux_file.c projects/calloutng/sys/compat/linux/linux_socket.c projects/calloutng/sys/dev/ath/ath_hal/ah.h projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416.h projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/calloutng/sys/dev/ath/if_athvar.h projects/calloutng/sys/kern/kern_condvar.c projects/calloutng/sys/kern/kern_descrip.c projects/calloutng/sys/kern/kern_event.c projects/calloutng/sys/kern/kern_resource.c projects/calloutng/sys/kern/kern_synch.c projects/calloutng/sys/kern/kern_timeout.c projects/calloutng/sys/kern/subr_log.c projects/calloutng/sys/kern/sys_generic.c projects/calloutng/sys/kern/uipc_usrreq.c projects/calloutng/sys/modules/mqueue/Makefile projects/calloutng/sys/sys/filedesc.h projects/calloutng/sys/vm/vm_object.c projects/calloutng/tools/make_libdeps.sh projects/calloutng/usr.bin/calendar/calendars/calendar.birthday projects/calloutng/usr.bin/find/extern.h projects/calloutng/usr.bin/find/find.1 projects/calloutng/usr.bin/find/function.c projects/calloutng/usr.bin/find/option.c projects/calloutng/usr.bin/hexdump/conv.c projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-disk.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-newfs.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-packages.sh projects/calloutng/usr.sbin/pc-sysinstall/backend/functions.sh projects/calloutng/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf projects/calloutng/usr.sbin/tzsetup/tzsetup.c Directory Properties: projects/calloutng/ (props changed) projects/calloutng/sbin/ (props changed) projects/calloutng/share/man/man4/ (props changed) projects/calloutng/sys/ (props changed) projects/calloutng/sys/conf/ (props changed) projects/calloutng/usr.bin/calendar/ (props changed) Modified: projects/calloutng/bin/sh/trap.c ============================================================================== --- projects/calloutng/bin/sh/trap.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/bin/sh/trap.c Mon Mar 4 18:07:28 2013 (r247807) @@ -455,7 +455,6 @@ dotrap(void) last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); - exitstatus = savestatus; /* * If such a command was not @@ -464,9 +463,11 @@ dotrap(void) * trap action to have an effect * outside of it. */ - if (prev_evalskip != 0) { + if (evalskip == 0 || + prev_evalskip != 0) { evalskip = prev_evalskip; skipcount = prev_skipcount; + exitstatus = savestatus; } if (i == SIGCHLD) Modified: projects/calloutng/lib/Makefile ============================================================================== --- projects/calloutng/lib/Makefile Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/lib/Makefile Mon Mar 4 18:07:28 2013 (r247807) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ + libyaml \ libz \ ${_atf} \ ${_bind} \ Modified: projects/calloutng/sbin/devd/devd.cc ============================================================================== --- projects/calloutng/sbin/devd/devd.cc Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sbin/devd/devd.cc Mon Mar 4 18:07:28 2013 (r247807) @@ -116,7 +116,7 @@ static struct pidfh *pfh; int Dflag; int dflag; int nflag; -int romeo_must_die = 0; +static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; @@ -319,7 +319,7 @@ media::do_match(config &c) // the name of interest, first try device-name and fall back // to subsystem if none exists. value = c.get_variable("device-name"); - if (value.length() == 0) + if (value.empty()) value = c.get_variable("subsystem"); if (Dflag) fprintf(stderr, "Testing media type of %s against 0x%x\n", @@ -460,7 +460,7 @@ config::open_pidfile() { pid_t otherpid; - if (_pidfile == "") + if (_pidfile.empty()) return; pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); if (pfh == NULL) { @@ -528,7 +528,7 @@ config::add_notify(int prio, event_proc void config::set_pidfile(const char *fn) { - _pidfile = string(fn); + _pidfile = fn; } void @@ -585,7 +585,7 @@ config::expand_one(const char *&src, str src++; // $$ -> $ if (*src == '$') { - dst.append(src++, 1); + dst += *src++; return; } @@ -593,7 +593,7 @@ config::expand_one(const char *&src, str // Not sure if I want to support this or not, so for now we just pass // it through. if (*src == '(') { - dst.append("$"); + dst += '$'; count = 1; /* If the string ends before ) is matched , return. */ while (count > 0 && *src) { @@ -601,23 +601,23 @@ config::expand_one(const char *&src, str count--; else if (*src == '(') count++; - dst.append(src++, 1); + dst += *src++; } return; } - // ${^A-Za-z] -> $\1 + // $[^A-Za-z] -> $\1 if (!isalpha(*src)) { - dst.append("$"); - dst.append(src++, 1); + dst += '$'; + dst += *src++; return; } // $var -> replace with value do { - buffer.append(src++, 1); + buffer += *src++; } while (is_id_char(*src)); - dst.append(get_variable(buffer.c_str())); + dst.append(get_variable(buffer)); } const string @@ -653,7 +653,7 @@ config::expand_string(const char *src, c } bool -config::chop_var(char *&buffer, char *&lhs, char *&rhs) +config::chop_var(char *&buffer, char *&lhs, char *&rhs) const { char *walker; @@ -912,9 +912,7 @@ event_loop(void) server_fd = create_socket(PIPE); accepting = 1; max_fd = max(fd, server_fd) + 1; - while (1) { - if (romeo_must_die) - break; + while (!romeo_must_die) { if (!once && !dflag && !nflag) { // Check to see if we have any events pending. tv.tv_sec = 0; @@ -1076,8 +1074,7 @@ set_variable(const char *var, const char static void gensighand(int) { - romeo_must_die++; - _exit(0); + romeo_must_die = 1; } static void Modified: projects/calloutng/sbin/devd/devd.hh ============================================================================== --- projects/calloutng/sbin/devd/devd.hh Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sbin/devd/devd.hh Mon Mar 4 18:07:28 2013 (r247807) @@ -41,8 +41,6 @@ class config; class var_list { public: - var_list() {} - virtual ~var_list() {} /** Set a variable in this var list. */ void set_variable(const std::string &var, const std::string &val); @@ -68,7 +66,6 @@ private: struct eps { public: - eps() {} virtual ~eps() {} /** Does this eps match the current config? */ @@ -144,7 +141,7 @@ private: class config { public: - config() : _pidfile("") { push_var_table(); } + config() { push_var_table(); } virtual ~config() { reset(); } void add_attach(int, event_proc *); void add_detach(int, event_proc *); @@ -172,7 +169,7 @@ protected: void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); bool is_id_char(char) const; - bool chop_var(char *&buffer, char *&lhs, char *&rhs); + bool chop_var(char *&buffer, char *&lhs, char *&rhs) const; private: std::vector _dir_list; std::string _pidfile; Modified: projects/calloutng/share/man/man4/mvs.4 ============================================================================== --- projects/calloutng/share/man/man4/mvs.4 Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/share/man/man4/mvs.4 Mon Mar 4 18:07:28 2013 (r247807) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2010 +.Dd March 3, 2013 .Dt MVS 4 .Os .Sh NAME @@ -62,7 +62,7 @@ command latency. .It Va hint.mvs. Ns Ar X Ns Va .cccc defines number of completed commands for CCC, which trigger interrupt without waiting for specified coalescing timeout. -.It Va hint.mvs. Ns Ar X Ns Va .pm_level +.It Va hint.mvsch. Ns Ar X Ns Va .pm_level controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. @@ -82,7 +82,7 @@ driver initiates SLUMBER PM state transi Note that interface Power Management is not compatible with device presence detection. A manual bus reset is needed on device hot-plug. -.It Va hint.mvs. Ns Ar X Ns Va .sata_rev +.It Va hint.mvsch. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .El Modified: projects/calloutng/share/man/man7/ports.7 ============================================================================== --- projects/calloutng/share/man/man7/ports.7 Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/share/man/man7/ports.7 Mon Mar 4 18:07:28 2013 (r247807) @@ -490,27 +490,17 @@ single file .Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact .It Pa /usr/ports The default ports directory -.No ( Fx -and -.Ox ) . -.It Pa /usr/pkgsrc -The default ports directory -.Pq Nx . .It Pa /usr/ports/Mk/bsd.port.mk The big Kahuna. .El .Sh SEE ALSO .Xr make 1 , -.Xr pkg_add 1 , -.Xr pkg_create 1 , -.Xr pkg_delete 1 , -.Xr pkg_info 1 , -.Xr pkg_version 1 +.Xr pkg 8 , +.Xr portsnap 8 .Pp The following are part of the ports collection: .Pp .Xr portaudit 1 , -.Xr portcheckout 1 , .Xr portlint 1 .Rs .%B "The FreeBSD Handbook" Modified: projects/calloutng/share/mk/bsd.libnames.mk ============================================================================== --- projects/calloutng/share/mk/bsd.libnames.mk Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/share/mk/bsd.libnames.mk Mon Mar 4 18:07:28 2013 (r247807) @@ -25,6 +25,7 @@ LIBBIND9?= ${DESTDIR}${LIBDIR}/libbind9. .endif LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a +LIBBSDYML?= ${DESTDIR}${LIBDIR}/libbsdyml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a Modified: projects/calloutng/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- projects/calloutng/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 18:07:28 2013 (r247807) @@ -1007,6 +1007,9 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm } else { sl = &map->slist[map->sync_count - 1]; if (map->sync_count == 0 || +#ifdef ARM_L2_PIPT + curaddr != sl->busaddr + sl->datacount || +#endif vaddr != sl->vaddr + sl->datacount) { if (++map->sync_count > dmat->nsegments) goto cleanup; Modified: projects/calloutng/sys/compat/linprocfs/linprocfs.c ============================================================================== --- projects/calloutng/sys/compat/linprocfs/linprocfs.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/compat/linprocfs/linprocfs.c Mon Mar 4 18:07:28 2013 (r247807) @@ -386,8 +386,7 @@ linprocfs_domtab(PFS_FILL_ARGS) sbuf_printf(sb, " 0 0\n"); } mtx_unlock(&mountlist_mtx); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } @@ -447,8 +446,7 @@ linprocfs_dopartitions(PFS_FILL_ARGS) } g_topology_unlock(); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } Modified: projects/calloutng/sys/compat/linux/linux_file.c ============================================================================== --- projects/calloutng/sys/compat/linux/linux_file.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/compat/linux/linux_file.c Mon Mar 4 18:07:28 2013 (r247807) @@ -517,8 +517,7 @@ eof: td->td_retval[0] = nbytes - resid; out: - if (cookies) - free(cookies, M_TEMP); + free(cookies, M_TEMP); VOP_UNLOCK(vp, 0); foffset_unlock(fp, off, 0); Modified: projects/calloutng/sys/compat/linux/linux_socket.c ============================================================================== --- projects/calloutng/sys/compat/linux/linux_socket.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/compat/linux/linux_socket.c Mon Mar 4 18:07:28 2013 (r247807) @@ -1443,10 +1443,8 @@ out: bad: free(iov, M_IOV); - if (control != NULL) - m_freem(control); - if (linux_cmsg != NULL) - free(linux_cmsg, M_TEMP); + m_freem(control); + free(linux_cmsg, M_TEMP); return (error); } Modified: projects/calloutng/sys/dev/ath/ath_hal/ah.h ============================================================================== --- projects/calloutng/sys/dev/ath/ath_hal/ah.h Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/dev/ath/ath_hal/ah.h Mon Mar 4 18:07:28 2013 (r247807) @@ -1527,11 +1527,13 @@ struct ath_hal { struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, struct ath_desc *); - void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, struct ath_desc *, u_int); + void __ahdecl(*ah_set11nVirtMoreFrag)(struct ath_hal *, + struct ath_desc *, u_int); + HAL_BOOL __ahdecl(*ah_getMibCycleCounts) (struct ath_hal *, HAL_SURVEY_SAMPLE *); Modified: projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 18:07:28 2013 (r247807) @@ -409,8 +409,9 @@ extern void ar5416Set11nAggrFirst(struct u_int aggrLen, u_int numDelims); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); - extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); +extern void ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, + struct ath_desc *ds, u_int vmf); extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); Modified: projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 18:07:28 2013 (r247807) @@ -194,6 +194,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_set11nMac2040 = ar5416Set11nMac2040; ah->ah_get11nRxClear = ar5416Get11nRxClear; ah->ah_set11nRxClear = ar5416Set11nRxClear; + ah->ah_set11nVirtMoreFrag = ar5416Set11nVirtualMoreFrag; /* Interrupt functions */ ah->ah_isInterruptPending = ar5416IsInterruptPending; Modified: projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 18:07:28 2013 (r247807) @@ -825,6 +825,17 @@ ar5416Clr11nAggr(struct ath_hal *ah, str ads->ds_ctl6 &= ~AR_AggrLen; } +void +ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, struct ath_desc *ds, + u_int vmf) +{ + struct ar5416_desc *ads = AR5416DESC(ds); + if (vmf) + ads->ds_ctl0 |= AR_VirtMoreFrag; + else + ads->ds_ctl0 &= ~AR_VirtMoreFrag; +} + /* * Program the burst duration, with the included BA delta if it's * applicable. Modified: projects/calloutng/sys/dev/ath/if_athvar.h ============================================================================== --- projects/calloutng/sys/dev/ath/if_athvar.h Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/dev/ath/if_athvar.h Mon Mar 4 18:07:28 2013 (r247807) @@ -1297,6 +1297,8 @@ void ath_intr(void *); ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) #define ath_hal_clr11n_aggr(_ah, _ds) \ ((*(_ah)->ah_clr11nAggr)((_ah), (_ds))) +#define ath_hal_set11n_virtmorefrag(_ah, _ds, _v) \ + ((*(_ah)->ah_set11nVirtMoreFrag)((_ah), (_ds), (_v))) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) Modified: projects/calloutng/sys/kern/kern_condvar.c ============================================================================== --- projects/calloutng/sys/kern/kern_condvar.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/kern_condvar.c Mon Mar 4 18:07:28 2013 (r247807) @@ -270,8 +270,9 @@ _cv_wait_sig(struct cv *cvp, struct lock } /* - * Wait on a condition variable. Returns 0 if the process was resumed by - * cv_signal or cv_broadcast, EWOULDBLOCK if the timeout expires. + * Wait on a condition variable for (at most) the value specified in sbt + * argument. Returns 0 if the process was resumed by cv_signal or cv_broadcast, + * EWOULDBLOCK if the timeout expires. */ int _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock, sbintime_t sbt, @@ -336,10 +337,11 @@ _cv_timedwait_sbt(struct cv *cvp, struct } /* - * Wait on a condition variable allowing interruption by signals. + * Wait on a condition variable for (at most) the value specified in sbt + * argument, allowing interruption by signals. * Returns 0 if the thread was resumed by cv_signal or cv_broadcast, - * or cv_broadcast, EWOULDBLOCK if the timeout expires, and EINTR - * or ERESTART if a signal was caught. + * EWOULDBLOCK if the timeout expires, and EINTR or ERESTART if a signal + * was caught. */ int _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock, Modified: projects/calloutng/sys/kern/kern_descrip.c ============================================================================== --- projects/calloutng/sys/kern/kern_descrip.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/kern_descrip.c Mon Mar 4 18:07:28 2013 (r247807) @@ -104,6 +104,7 @@ static MALLOC_DEFINE(M_FILEDESC, "filede static MALLOC_DEFINE(M_FILEDESC_TO_LEADER, "filedesc_to_leader", "file desc to leader structures"); static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures"); +MALLOC_DEFINE(M_FILECAPS, "filecaps", "descriptor capabilities"); MALLOC_DECLARE(M_FADVISE); @@ -1389,7 +1390,7 @@ filecaps_copy(const struct filecaps *src ("fc_ioctls != NULL, but fc_nioctls=%hd", src->fc_nioctls)); size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls; - dst->fc_ioctls = malloc(size, M_TEMP, M_WAITOK); + dst->fc_ioctls = malloc(size, M_FILECAPS, M_WAITOK); bcopy(src->fc_ioctls, dst->fc_ioctls, size); } } @@ -1397,7 +1398,7 @@ filecaps_copy(const struct filecaps *src /* * Move filecaps structure to the new place and clear the old place. */ -static void +void filecaps_move(struct filecaps *src, struct filecaps *dst) { @@ -1425,7 +1426,7 @@ void filecaps_free(struct filecaps *fcaps) { - free(fcaps->fc_ioctls, M_TEMP); + free(fcaps->fc_ioctls, M_FILECAPS); bzero(fcaps, sizeof(*fcaps)); } Modified: projects/calloutng/sys/kern/kern_event.c ============================================================================== --- projects/calloutng/sys/kern/kern_event.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/kern_event.c Mon Mar 4 18:07:28 2013 (r247807) @@ -517,7 +517,7 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ -static __inline sbintime_t +static __inline sbintime_t timer2sbintime(intptr_t data) { @@ -1309,10 +1309,9 @@ kqueue_scan(struct kqueue *kq, int maxev const struct timespec *tsp, struct kevent *keva, struct thread *td) { struct kevent *kevp; - sbintime_t asbt, rsbt; struct knote *kn, *marker; - int count, nkev, error, influx; - int haskqglobal, touch; + sbintime_t asbt, rsbt; + int count, error, haskqglobal, influx, nkev, touch; count = maxevents; nkev = 0; Modified: projects/calloutng/sys/kern/kern_resource.c ============================================================================== --- projects/calloutng/sys/kern/kern_resource.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/kern_resource.c Mon Mar 4 18:07:28 2013 (r247807) @@ -1140,7 +1140,7 @@ lim_fork(struct proc *p1, struct proc *p callout_init_mtx(&p2->p_limco, &p2->p_mtx, 0); if (p1->p_cpulimit != RLIM_INFINITY) callout_reset_sbt(&p2->p_limco, SBT_1S, 0, - lim_cb, p2, C_PREL(1) | C_HARDCLOCK); + lim_cb, p2, C_PREL(1)); } void Modified: projects/calloutng/sys/kern/kern_synch.c ============================================================================== --- projects/calloutng/sys/kern/kern_synch.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/kern_synch.c Mon Mar 4 18:07:28 2013 (r247807) @@ -151,7 +151,7 @@ _sleep(void *ident, struct lock_object * struct thread *td; struct proc *p; struct lock_class *class; - int catch, sleepq_flags, lock_state, pri, rval; + int catch, lock_state, pri, rval, sleepq_flags; WITNESS_SAVE_DECL(lock_witness); td = curthread; Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/kern_timeout.c Mon Mar 4 18:07:28 2013 (r247807) @@ -601,7 +601,7 @@ softclock_call_cc(struct callout *c, str sbintime_t new_time; #endif #if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) - sbintime_t bt1, bt2; + sbintime_t sbt1, sbt2; struct timespec ts2; static sbintime_t maxdt = 2 * SBT_1MS; /* 2 msec */ static timeout_t *lastfunc; @@ -655,7 +655,7 @@ softclock_call_cc(struct callout *c, str CTR3(KTR_CALLOUT, "callout %p func %p arg %p", c, c_func, c_arg); } -#ifdef DIAGNOSTIC +#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) sbt1 = sbinuptime(); #endif THREAD_NO_SLEEPING(); @@ -663,17 +663,17 @@ softclock_call_cc(struct callout *c, str c_func(c_arg); SDT_PROBE(callout_execute, kernel, , callout_end, c, 0, 0, 0, 0); THREAD_SLEEPING_OK(); -#ifdef DIAGNOSTIC - bt2 = sbinuptime(); - bt2 -= bt1; - if (bt2 > maxdt) { - if (lastfunc != c_func || bt2 > maxdt * 2) { - ts2 = sbttots(bt2); +#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) + sbt2 = sbinuptime(); + sbt2 -= sbt1; + if (sbt2 > maxdt) { + if (lastfunc != c_func || sbt2 > maxdt * 2) { + ts2 = sbttots(sbt2); printf( "Expensive timeout(9) function: %p(%p) %jd.%09ld s\n", c_func, c_arg, (intmax_t)ts2.tv_sec, ts2.tv_nsec); } - maxdt = bt2; + maxdt = sbt2; lastfunc = c_func; } #endif Modified: projects/calloutng/sys/kern/subr_log.c ============================================================================== --- projects/calloutng/sys/kern/subr_log.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/subr_log.c Mon Mar 4 18:07:28 2013 (r247807) @@ -118,7 +118,7 @@ logopen(struct cdev *dev, int flags, int } log_open = 1; callout_reset_sbt(&logsoftc.sc_callout, - (SBT_1S / log_wakeups_per_second), 0, logtimeout, NULL, C_PREL(1)); + SBT_1S / log_wakeups_per_second, 0, logtimeout, NULL, C_PREL(1)); mtx_unlock(&msgbuf_lock); fsetown(td->td_proc->p_pid, &logsoftc.sc_sigio); /* signal process only */ @@ -247,7 +247,7 @@ done: log_wakeups_per_second = 1; } callout_reset_sbt(&logsoftc.sc_callout, - (SBT_1S / log_wakeups_per_second), 0, logtimeout, NULL, C_PREL(1)); + SBT_1S / log_wakeups_per_second, 0, logtimeout, NULL, C_PREL(1)); } /*ARGSUSED*/ Modified: projects/calloutng/sys/kern/sys_generic.c ============================================================================== --- projects/calloutng/sys/kern/sys_generic.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/sys_generic.c Mon Mar 4 18:07:28 2013 (r247807) @@ -950,10 +950,10 @@ kern_select(struct thread *td, int nd, f */ fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; - sbintime_t asbt, precision, rsbt; struct timeval rtv; - int error, lf, ndu; + sbintime_t asbt, precision, rsbt; u_int nbufbytes, ncpbytes, ncpubytes, nfdbits; + int error, lf, ndu; if (nd < 0) return (EINVAL); @@ -1274,8 +1274,8 @@ sys_poll(td, uap) struct pollfd *bits; struct pollfd smallbits[32]; sbintime_t asbt, precision, rsbt; - int error; u_int nfds; + int error; size_t ni; nfds = uap->nfds; Modified: projects/calloutng/sys/kern/uipc_usrreq.c ============================================================================== --- projects/calloutng/sys/kern/uipc_usrreq.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/kern/uipc_usrreq.c Mon Mar 4 18:07:28 2013 (r247807) @@ -102,6 +102,8 @@ __FBSDID("$FreeBSD$"); #include +MALLOC_DECLARE(M_FILECAPS); + /* * Locking key: * (l) Locked using list lock @@ -282,7 +284,7 @@ static void unp_drop(struct unpcb *, int static void unp_gc(__unused void *, int); static void unp_scan(struct mbuf *, void (*)(struct file *)); static void unp_discard(struct file *); -static void unp_freerights(struct filedescent *, int); +static void unp_freerights(struct filedescent **, int); static void unp_init(void); static int unp_internalize(struct mbuf **, struct thread *); static void unp_internalize_fp(struct file *); @@ -1679,16 +1681,17 @@ unp_drop(struct unpcb *unp, int errno) } static void -unp_freerights(struct filedescent *fde, int fdcount) +unp_freerights(struct filedescent **fdep, int fdcount) { struct file *fp; int i; - for (i = 0; i < fdcount; i++, fde++) { - fp = fde->fde_file; - bzero(fde, sizeof(*fde)); + for (i = 0; i < fdcount; i++) { + fp = fdep[i]->fde_file; + filecaps_free(&fdep[i]->fde_caps); unp_discard(fp); } + free(fdep[0], M_FILECAPS); } static int @@ -1699,7 +1702,7 @@ unp_externalize(struct mbuf *control, st int i; int *fdp; struct filedesc *fdesc = td->td_proc->p_fd; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep; void *data; socklen_t clen = control->m_len, datalen; int error, newfds; @@ -1755,16 +1758,18 @@ unp_externalize(struct mbuf *control, st fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < newfds; i++, fdep++, fdp++) { + for (i = 0; i < newfds; i++, fdp++) { if (fdalloc(td, 0, &f)) panic("unp_externalize fdalloc failed"); fde = &fdesc->fd_ofiles[f]; - fde->fde_file = fdep->fde_file; - filecaps_copy(&fdep->fde_caps, &fde->fde_caps); + fde->fde_file = fdep[0]->fde_file; + filecaps_move(&fdep[0]->fde_caps, + &fde->fde_caps); unp_externalize_fp(fde->fde_file); *fdp = f; } FILEDESC_XUNLOCK(fdesc); + free(fdep[0], M_FILECAPS); } else { /* We can just copy anything else across. */ if (error || controlp == NULL) @@ -1839,7 +1844,7 @@ unp_internalize(struct mbuf **controlp, struct bintime *bt; struct cmsghdr *cm = mtod(control, struct cmsghdr *); struct cmsgcred *cmcred; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; int i, fd, *fdp; @@ -1913,7 +1918,7 @@ unp_internalize(struct mbuf **controlp, * Now replace the integer FDs with pointers to the * file structure and capability rights. */ - newlen = oldfds * sizeof(*fdep); + newlen = oldfds * sizeof(fdep[0]); *controlp = sbcreatecontrol(NULL, newlen, SCM_RIGHTS, SOL_SOCKET); if (*controlp == NULL) { @@ -1922,13 +1927,17 @@ unp_internalize(struct mbuf **controlp, goto out; } fdp = data; - fdep = (struct filedescent *) + fdep = (struct filedescent **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < oldfds; i++, fdep++, fdp++) { + fdev = malloc(sizeof(*fdev) * oldfds, M_FILECAPS, + M_WAITOK); + for (i = 0; i < oldfds; i++, fdev++, fdp++) { fde = &fdesc->fd_ofiles[*fdp]; - fdep->fde_file = fde->fde_file; - filecaps_copy(&fde->fde_caps, &fdep->fde_caps); - unp_internalize_fp(fdep->fde_file); + fdep[i] = fdev; + fdep[i]->fde_file = fde->fde_file; + filecaps_copy(&fde->fde_caps, + &fdep[i]->fde_caps); + unp_internalize_fp(fdep[i]->fde_file); } FILEDESC_SUNLOCK(fdesc); break; @@ -2290,7 +2299,7 @@ static void unp_scan(struct mbuf *m0, void (*op)(struct file *)) { struct mbuf *m; - struct filedescent *fdep; + struct filedescent **fdep; struct cmsghdr *cm; void *data; int i; @@ -2317,8 +2326,8 @@ unp_scan(struct mbuf *m0, void (*op)(str cm->cmsg_type == SCM_RIGHTS) { qfds = datalen / sizeof(*fdep); fdep = data; - for (i = 0; i < qfds; i++, fdep++) - (*op)(fdep->fde_file); + for (i = 0; i < qfds; i++) + (*op)(fdep[i]->fde_file); } if (CMSG_SPACE(datalen) < clen) { Modified: projects/calloutng/sys/modules/mqueue/Makefile ============================================================================== --- projects/calloutng/sys/modules/mqueue/Makefile Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/modules/mqueue/Makefile Mon Mar 4 18:07:28 2013 (r247807) @@ -5,6 +5,6 @@ KMOD= mqueuefs SRCS= uipc_mqueue.c \ vnode_if.h \ - opt_posix.h opt_compat.h + opt_posix.h opt_compat.h opt_capsicum.h .include Modified: projects/calloutng/sys/sys/filedesc.h ============================================================================== --- projects/calloutng/sys/sys/filedesc.h Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/sys/filedesc.h Mon Mar 4 18:07:28 2013 (r247807) @@ -136,6 +136,7 @@ struct thread; void filecaps_init(struct filecaps *fcaps); void filecaps_copy(const struct filecaps *src, struct filecaps *dst); +void filecaps_move(struct filecaps *src, struct filecaps *dst); void filecaps_free(struct filecaps *fcaps); int closef(struct file *fp, struct thread *td); Modified: projects/calloutng/sys/vm/vm_object.c ============================================================================== --- projects/calloutng/sys/vm/vm_object.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/sys/vm/vm_object.c Mon Mar 4 18:07:28 2013 (r247807) @@ -165,8 +165,9 @@ vm_object_zdtor(void *mem, int size, voi object = (vm_object_t)mem; KASSERT(TAILQ_EMPTY(&object->memq), - ("object %p has resident pages", - object)); + ("object %p has resident pages in its memq", object)); + KASSERT(object->root == NULL, + ("object %p has resident pages in its tree", object)); #if VM_NRESERVLEVEL > 0 KASSERT(LIST_EMPTY(&object->rvq), ("object %p has reservations", @@ -197,9 +198,11 @@ vm_object_zinit(void *mem, int size, int mtx_init(&object->mtx, "vm object", NULL, MTX_DEF | MTX_DUPOK); /* These are true for any object that has been freed */ + object->root = NULL; object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; + object->cache = NULL; return (0); } @@ -210,7 +213,6 @@ _vm_object_allocate(objtype_t type, vm_p TAILQ_INIT(&object->memq); LIST_INIT(&object->shadow_head); - object->root = NULL; object->type = type; switch (type) { case OBJT_DEAD: @@ -247,7 +249,6 @@ _vm_object_allocate(objtype_t type, vm_p #if VM_NRESERVLEVEL > 0 LIST_INIT(&object->rvq); #endif - object->cache = NULL; mtx_lock(&vm_object_list_mtx); TAILQ_INSERT_TAIL(&vm_object_list, object, object_list); Modified: projects/calloutng/tools/make_libdeps.sh ============================================================================== --- projects/calloutng/tools/make_libdeps.sh Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/tools/make_libdeps.sh Mon Mar 4 18:07:28 2013 (r247807) @@ -47,6 +47,7 @@ sed -E -e's; ;! ;g' -e's;$;!;' -e's;-lbsdxml!;lib/libexpat;g' + -e's;-lbsdyml!;lib/libyaml;g' -e's;-lpthread!;lib/libthr;g' -e's;-lm!;lib/msun;g' -e's;-l(ncurses|termcap)!;lib/ncurses/ncurses;g' Copied: projects/calloutng/tools/regression/bin/sh/builtins/trap12.0 (from r247806, head/tools/regression/bin/sh/builtins/trap12.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/calloutng/tools/regression/bin/sh/builtins/trap12.0 Mon Mar 4 18:07:28 2013 (r247807, copy of r247806, head/tools/regression/bin/sh/builtins/trap12.0) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + trap 'return 42' USR1 + kill -USR1 $$ + return 3 +} +f +r=$? +[ "$r" = 42 ] Modified: projects/calloutng/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- projects/calloutng/usr.bin/calendar/calendars/calendar.birthday Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.bin/calendar/calendars/calendar.birthday Mon Mar 4 18:07:28 2013 (r247807) @@ -6,6 +6,7 @@ #ifndef _calendar_birthday_ #define _calendar_birthday_ +#undef unix 01/01 J.D. Salinger born, 1919 01/01 Paul Revere born in Boston, 1735 Modified: projects/calloutng/usr.bin/find/extern.h ============================================================================== --- projects/calloutng/usr.bin/find/extern.h Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.bin/find/extern.h Mon Mar 4 18:07:28 2013 (r247807) @@ -73,6 +73,7 @@ creat_f c_regex; creat_f c_samefile; creat_f c_simple; creat_f c_size; +creat_f c_sparse; creat_f c_type; creat_f c_user; creat_f c_xdev; @@ -109,6 +110,7 @@ exec_f f_prune; exec_f f_quit; exec_f f_regex; exec_f f_size; +exec_f f_sparse; exec_f f_type; exec_f f_user; Modified: projects/calloutng/usr.bin/find/find.1 ============================================================================== --- projects/calloutng/usr.bin/find/find.1 Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.bin/find/find.1 Mon Mar 4 18:07:28 2013 (r247807) @@ -816,6 +816,10 @@ terabytes (1024 gigabytes) .It Cm P petabytes (1024 terabytes) .El +.It Ic -sparse +True if the current file is sparse, +i.e. has fewer blocks allocated than expected based on its size in bytes. +This might also match files that have been compressed by the filesystem. .It Ic -type Ar t True if the file is of the specified type. Possible file types are as follows: @@ -997,7 +1001,7 @@ and as well as .Ic -amin , -anewer , -cmin , -cnewer , -delete , -empty , -fstype , .Ic -iname , -inum , -iregex , -ls , -maxdepth , -mindepth , -mmin , -.Ic -path , -print0 , -regex +.Ic -path , -print0 , -regex, -sparse and all of the .Ic -B* birthtime related primaries are extensions to Modified: projects/calloutng/usr.bin/find/function.c ============================================================================== --- projects/calloutng/usr.bin/find/function.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.bin/find/function.c Mon Mar 4 18:07:28 2013 (r247807) @@ -1497,6 +1497,29 @@ c_size(OPTION *option, char ***argvp) } /* + * -sparse functions -- + * + * Check if a file is sparse by finding if it occupies fewer blocks + * than we expect based on its size. + */ +int +f_sparse(PLAN *plan __unused, FTSENT *entry) +{ + off_t expected_blocks; + + expected_blocks = (entry->fts_statp->st_size + 511) / 512; + return entry->fts_statp->st_blocks < expected_blocks; +} + +PLAN * +c_sparse(OPTION *option, char ***argvp __unused) +{ + ftsoptions &= ~FTS_NOSTAT; + + return palloc(option); +} + +/* * -type c functions -- * * True if the type of the file is c, where c is b, c, d, p, f or w Modified: projects/calloutng/usr.bin/find/option.c ============================================================================== --- projects/calloutng/usr.bin/find/option.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.bin/find/option.c Mon Mar 4 18:07:28 2013 (r247807) @@ -145,6 +145,7 @@ static OPTION const options[] = { { "-regex", c_regex, f_regex, 0 }, { "-samefile", c_samefile, f_inum, 0 }, { "-size", c_size, f_size, 0 }, + { "-sparse", c_sparse, f_sparse, 0 }, { "-true", c_simple, f_always_true, 0 }, { "-type", c_type, f_type, 0 }, { "-uid", c_user, f_user, 0 }, Modified: projects/calloutng/usr.bin/hexdump/conv.c ============================================================================== --- projects/calloutng/usr.bin/hexdump/conv.c Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.bin/hexdump/conv.c Mon Mar 4 18:07:28 2013 (r247807) @@ -151,7 +151,7 @@ conv_u(PR *pr, u_char *p) static char const * list[] = { "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "lf", "vt", "ff", "cr", "so", "si", - "dle", "dcl", "dc2", "dc3", "dc4", "nak", "syn", "etb", + "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us", }; Modified: projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Mon Mar 4 18:07:28 2013 (r247807) @@ -62,7 +62,18 @@ get_fs_line_xvars() echo $ZFSVARS | grep -qE "^(disk|file|mirror|raidz(1|2|3)?|spare|log|cache):" 2>/dev/null if [ $? -eq 0 ] ; then ZTYPE=`echo $ZFSVARS | cut -f1 -d:` - ZFSVARS=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"` + tmpVars=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"` + ZFSVARS="" + # make sure we have a '/dev' in front of the extra devices + for i in $tmpVars + do + echo $i | grep -q '/dev/' + if [ $? -ne 0 ] ; then + ZFSVARS="$ZFSVARS /dev/${i}" + else + ZFSVARS="$ZFSVARS $i" + fi + done fi # Return the ZFS options Modified: projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon Mar 4 18:07:28 2013 (r247807) @@ -33,6 +33,7 @@ is_disk() for _dsk in `sysctl -n kern.disks` do [ "$_dsk" = "${1}" ] && return 0 + [ "/dev/$_dsk" = "${1}" ] && return 0 done return 1 Modified: projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh ============================================================================== --- projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh Mon Mar 4 17:39:17 2013 (r247806) +++ projects/calloutng/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh Mon Mar 4 18:07:28 2013 (r247807) @@ -76,50 +76,113 @@ fetch_package_dependencies() # Check for any packages specified, and begin loading them install_packages() { + echo "Checking for packages to install..." + sleep 2 + # First, lets check and see if we even have any packages to install get_value_from_cfg installPackages - if [ -n "${VAL}" ] - then - HERE=`pwd` - rc_nohalt "mkdir -p ${FSMNT}/${PKGTMPDIR}" - rc_nohalt "cd ${FSMNT}/${PKGTMPDIR}" - if [ ! -f "${CONFDIR}/INDEX" ] + # Nothing to do? + if [ -z "${VAL}" ]; then return; fi + + echo "Installing packages..." + sleep 3 + + local PKGPTH + + HERE=`pwd` + rc_halt "mkdir -p ${FSMNT}${PKGTMPDIR}" + + # Determine the directory we will install packages from + get_package_location + rc_halt "cd ${PKGDLDIR}" + + # Set the location of the INDEXFILE + INDEXFILE="${TMPDIR}/INDEX" + + if [ ! -f "${INDEXFILE}" ]; then + get_package_index + fi + + if [ ! -f "${TMPDIR}/INDEX.parsed" -a "$INSTALLMEDIUM" = "ftp" ]; then + parse_package_index + fi + + # What extension are we using for pkgs? + PKGEXT="txz" + get_value_from_cfg pkgExt + if [ -n "${VAL}" ]; then + strip_white_space ${VAL} + PKGEXT="$VAL" + fi + export PKGEXT + + # We dont want to be bothered with scripts asking questions + PACKAGE_BUILDING=yes *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 19:48:59 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2DB0C2EE; Mon, 4 Mar 2013 19:48:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 00DC01071; Mon, 4 Mar 2013 19:48:59 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 266DCB941; Mon, 4 Mar 2013 14:48:58 -0500 (EST) From: John Baldwin To: Davide Italiano Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern Date: Mon, 4 Mar 2013 10:40:41 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201303031339.r23DdsBU047737@svn.freebsd.org> In-Reply-To: <201303031339.r23DdsBU047737@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201303041040.41845.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Mar 2013 14:48:58 -0500 (EST) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 19:48:59 -0000 On Sunday, March 03, 2013 8:39:54 am Davide Italiano wrote: > Author: davide > Date: Sun Mar 3 13:39:54 2013 > New Revision: 247710 > URL: http://svnweb.freebsd.org/changeset/base/247710 > > Log: > - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables. We have stdbool in the kernel. Why not use that instead of the Machish boolean_t? -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 20:17:37 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 260BFC08; Mon, 4 Mar 2013 20:17:37 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx1.freebsd.org (Postfix) with ESMTP id A718C11B6; Mon, 4 Mar 2013 20:17:36 +0000 (UTC) Received: by mail-ve0-f179.google.com with SMTP id da11so5182433veb.10 for ; Mon, 04 Mar 2013 12:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=VyhHR9XDHfE2i3Kl/0llZ/ZNK2A66yW6foJXDfkm2/w=; b=ClxOclC75DIFaHXRS1OVcZhtzI2IO6L8rpnafE3HenMKsUtBbyzuLUIOFggkkvHfp0 asBV8jJ/loZX+GKKbH9/iExzRfOpZklzF3Hv8dqaoW7zbPgNPC6fi94wqC5obtUjoGN+ Hn38OuH2viqE7LAta1a0aAYON34PfhEJcaLJsUkYDLhz5cSsxAoL6Xbe/nNK9istTpJQ ivVGHIwMBHaPe+5L+gpba8mQlWP1DcmYOt0IHsUFppoAdGGD13Ax9s22AkPMhSNr4iYd m7h/G424u7CVyc5iZWkdYWeRrTImY6hU+ctQeongHYheJzYpHmcFVpKcNzodhva4dzWt vqTQ== MIME-Version: 1.0 X-Received: by 10.220.219.9 with SMTP id hs9mr8319497vcb.68.1362428250326; Mon, 04 Mar 2013 12:17:30 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.220.34.203 with HTTP; Mon, 4 Mar 2013 12:17:30 -0800 (PST) In-Reply-To: <201303041040.41845.jhb@freebsd.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041040.41845.jhb@freebsd.org> Date: Mon, 4 Mar 2013 21:17:30 +0100 X-Google-Sender-Auth: ztpO_kumXEFu-Mbiy5K_ftZ5A40 Message-ID: Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern From: Davide Italiano To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-projects@freebsd.org, Attilio Rao , src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 20:17:37 -0000 On Mon, Mar 4, 2013 at 4:40 PM, John Baldwin wrote: > On Sunday, March 03, 2013 8:39:54 am Davide Italiano wrote: >> Author: davide >> Date: Sun Mar 3 13:39:54 2013 >> New Revision: 247710 >> URL: http://svnweb.freebsd.org/changeset/base/247710 >> >> Log: >> - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables. > > We have stdbool in the kernel. Why not use that instead of the Machish > boolean_t? > > -- > John Baldwin It was originally int, and a couple of days ago Attilio suggested to move to 'boolean_t'. Honestly, I didn't argue due to the relative little relevance of the change, but actually I find the type change more explicative. I have no strong objections to change it again (in particular because I think you're suggesting to use bool to be C99 compliant, feel free to correct me if I'm wrong). While here. After closer looking I realized boolean_t is widely used in the kernel (e.g. sys/kern/). Is this just a common error or is there something I'm missing? Thanks -- Davide From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 20:22:08 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40E7DE96; Mon, 4 Mar 2013 20:22:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1D71511F3; Mon, 4 Mar 2013 20:22:08 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 817A0B964; Mon, 4 Mar 2013 15:22:07 -0500 (EST) From: John Baldwin To: Davide Italiano Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern Date: Mon, 4 Mar 2013 15:21:06 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041040.41845.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201303041521.06557.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Mar 2013 15:22:07 -0500 (EST) Cc: svn-src-projects@freebsd.org, Attilio Rao , src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 20:22:08 -0000 On Monday, March 04, 2013 3:17:30 pm Davide Italiano wrote: > On Mon, Mar 4, 2013 at 4:40 PM, John Baldwin wrote: > > On Sunday, March 03, 2013 8:39:54 am Davide Italiano wrote: > >> Author: davide > >> Date: Sun Mar 3 13:39:54 2013 > >> New Revision: 247710 > >> URL: http://svnweb.freebsd.org/changeset/base/247710 > >> > >> Log: > >> - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables. > > > > We have stdbool in the kernel. Why not use that instead of the Machish > > boolean_t? > > > > -- > > John Baldwin > > It was originally int, and a couple of days ago Attilio suggested to > move to 'boolean_t'. > Honestly, I didn't argue due to the relative little relevance of the > change, but actually I find the type change more explicative. > I have no strong objections to change it again (in particular because > I think you're suggesting to use bool to be C99 compliant, feel free > to correct me if I'm wrong). > > While here. After closer looking I realized boolean_t is widely used > in the kernel (e.g. sys/kern/). Is this just a common error or is > there something I'm missing? No, it's just older and bool is C99 as you noticed. I had thought that boolean_t was largely regulated to code from Mach (i.e. sys/vm) and that we should use bool for new code. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 20:41:07 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4771E1E4; Mon, 4 Mar 2013 20:41:07 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ia0-x22d.google.com (mail-ia0-x22d.google.com [IPv6:2607:f8b0:4001:c02::22d]) by mx1.freebsd.org (Postfix) with ESMTP id D036D12B5; Mon, 4 Mar 2013 20:41:06 +0000 (UTC) Received: by mail-ia0-f173.google.com with SMTP id h37so5229148iak.4 for ; Mon, 04 Mar 2013 12:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Szh84LJkzeJM30CgT/1Aa8FOpYeruHZyVyrCBYYQNXM=; b=ESSW5AHBb56iUtKTUNQJVOJ4Wp3Czm7PmamfPY/ZASotnvJIIeI5OM+m7qa2T7yvtu MMWa1p83QkR08KRQ2Br/RlJvjKtftP/pFDkO2OLJaOOSpxATCMNZZGQMQkNp4y7vzcgJ 7kbbnOLoC1xGkHuXvj3L309jkg6T60I+MFkvKlVQWQTp1HvGtNAObNcW94VdwWwg4lUR kIPEUzeF8gBw7PSasOFNVBogmPz2DNDiEEgRY+bJ7peq6jwYb9aO+qvtCdMP7wGRViSe tVxBGkhtSX14RDgzgvB7co2nlMyNHq2cgxviY/MN8mrqeIjga1hqLmJ67HrUpwMNYXHS KVMg== MIME-Version: 1.0 X-Received: by 10.50.203.3 with SMTP id km3mr3811633igc.64.1362429666415; Mon, 04 Mar 2013 12:41:06 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Mon, 4 Mar 2013 12:41:05 -0800 (PST) In-Reply-To: <201303041521.06557.jhb@freebsd.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041040.41845.jhb@freebsd.org> <201303041521.06557.jhb@freebsd.org> Date: Mon, 4 Mar 2013 21:41:05 +0100 X-Google-Sender-Auth: Z_TCpm6R_3CYRpAchSEKnHzPLAs Message-ID: Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: Davide Italiano , svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 20:41:07 -0000 On Mon, Mar 4, 2013 at 9:21 PM, John Baldwin wrote: > On Monday, March 04, 2013 3:17:30 pm Davide Italiano wrote: >> On Mon, Mar 4, 2013 at 4:40 PM, John Baldwin wrote: >> > On Sunday, March 03, 2013 8:39:54 am Davide Italiano wrote: >> >> Author: davide >> >> Date: Sun Mar 3 13:39:54 2013 >> >> New Revision: 247710 >> >> URL: http://svnweb.freebsd.org/changeset/base/247710 >> >> >> >> Log: >> >> - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables. >> > >> > We have stdbool in the kernel. Why not use that instead of the Machish >> > boolean_t? >> > >> > -- >> > John Baldwin >> >> It was originally int, and a couple of days ago Attilio suggested to >> move to 'boolean_t'. >> Honestly, I didn't argue due to the relative little relevance of the >> change, but actually I find the type change more explicative. >> I have no strong objections to change it again (in particular because >> I think you're suggesting to use bool to be C99 compliant, feel free >> to correct me if I'm wrong). >> >> While here. After closer looking I realized boolean_t is widely used >> in the kernel (e.g. sys/kern/). Is this just a common error or is >> there something I'm missing? > > No, it's just older and bool is C99 as you noticed. I had thought that > boolean_t was largely regulated to code from Mach (i.e. sys/vm) and that > we should use bool for new code. Actually boolean_t is much more widespread in our kernel than the C99 variant. Moreover style(9) doesn't advertise it either, neither the necessity to conform to library defined C99 features (even if present in the C99 standard, _Bool is still defined in stdbool.h which is an header not present in our kernel). I wonder how much style(9) can change over the time. Maybe it is time to add/update few rules to better comply with new standard adds. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 21:21:09 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 00491FE7; Mon, 4 Mar 2013 21:21:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id CECB915F5; Mon, 4 Mar 2013 21:21:08 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C4F92B926; Mon, 4 Mar 2013 16:21:07 -0500 (EST) From: John Baldwin To: attilio@freebsd.org Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern Date: Mon, 4 Mar 2013 16:20:51 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201303041620.52100.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Mar 2013 16:21:07 -0500 (EST) Cc: Davide Italiano , svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 21:21:09 -0000 On Monday, March 04, 2013 3:41:05 pm Attilio Rao wrote: > On Mon, Mar 4, 2013 at 9:21 PM, John Baldwin wrote: > > On Monday, March 04, 2013 3:17:30 pm Davide Italiano wrote: > >> On Mon, Mar 4, 2013 at 4:40 PM, John Baldwin wrote: > >> > On Sunday, March 03, 2013 8:39:54 am Davide Italiano wrote: > >> >> Author: davide > >> >> Date: Sun Mar 3 13:39:54 2013 > >> >> New Revision: 247710 > >> >> URL: http://svnweb.freebsd.org/changeset/base/247710 > >> >> > >> >> Log: > >> >> - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables. > >> > > >> > We have stdbool in the kernel. Why not use that instead of the Machish > >> > boolean_t? > >> > > >> > -- > >> > John Baldwin > >> > >> It was originally int, and a couple of days ago Attilio suggested to > >> move to 'boolean_t'. > >> Honestly, I didn't argue due to the relative little relevance of the > >> change, but actually I find the type change more explicative. > >> I have no strong objections to change it again (in particular because > >> I think you're suggesting to use bool to be C99 compliant, feel free > >> to correct me if I'm wrong). > >> > >> While here. After closer looking I realized boolean_t is widely used > >> in the kernel (e.g. sys/kern/). Is this just a common error or is > >> there something I'm missing? > > > > No, it's just older and bool is C99 as you noticed. I had thought that > > boolean_t was largely regulated to code from Mach (i.e. sys/vm) and that > > we should use bool for new code. > > Actually boolean_t is much more widespread in our kernel than the C99 > variant. Moreover style(9) doesn't advertise it either, neither the > necessity to conform to library defined C99 features (even if present > in the C99 standard, _Bool is still defined in stdbool.h which is an > header not present in our kernel). Err, I thought that mdf@ had proposed importing stdbool.h into our kernel already? Ah, yes, the requisite bits are in , so 'bool' works fine. I think for new code we should prefer C99's bool to boolean_t. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 21:35:49 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B777D740; Mon, 4 Mar 2013 21:35:49 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D91016C2; Mon, 4 Mar 2013 21:35:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24LZnec014592; Mon, 4 Mar 2013 21:35:49 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24LZniO014591; Mon, 4 Mar 2013 21:35:49 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303042135.r24LZniO014591@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 4 Mar 2013 21:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247816 - projects/bmake/share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 21:35:49 -0000 Author: sjg Date: Mon Mar 4 21:35:49 2013 New Revision: 247816 URL: http://svnweb.freebsd.org/changeset/base/247816 Log: Handle multiple M2D_OBJROOTS better Modified: projects/bmake/share/mk/gendirdeps.mk Modified: projects/bmake/share/mk/gendirdeps.mk ============================================================================== --- projects/bmake/share/mk/gendirdeps.mk Mon Mar 4 21:20:13 2013 (r247815) +++ projects/bmake/share/mk/gendirdeps.mk Mon Mar 4 21:35:49 2013 (r247816) @@ -114,7 +114,7 @@ META2DEPS_CMD = ${_time} ${PYTHON} ${MET META2DEPS_CMD += -D ${DPDEPS} .endif -M2D_OBJROOTS += ${OBJTOP}/ ${_OBJROOT} +M2D_OBJROOTS += ${OBJTOP}/ ${_OBJROOT} ${_objroot} .if defined(SB_OBJROOT) M2D_OBJROOTS += ${SB_OBJROOT} .endif @@ -157,7 +157,21 @@ dir_list != cd ${_OBJDIR} && \ .if !empty(DPADD) _nonlibs := ${DPADD:T:Nlib*:N*include} .if !empty(_nonlibs) -dir_list += ${_nonlibs:@x@${DPADD:M*/$x}@:H:tA} +ddep_list = +.for f in ${_nonlibs:@x@${DPADD:M*/$x}@:tA} +.if exists($f.dirdep) +ddep_list += $f.dirdep +.elif exists(${f:H}.dirdep) +ddep_list += ${f:H}.dirdep +.else +dir_list += ${f:H} +.endif +.endfor +.if !empty(ddep_list) +ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ + sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,' +dir_list += ${ddeps} +.endif .endif .endif @@ -173,22 +187,21 @@ dirdep_list = \ ${dir_list:M${_objtop}*/*:C,${_objtop}[^/]*/,,} \ ${GENDIRDEPS_DIR_LIST_XTRAS} +# sort longest first +M2D_OBJROOTS := ${M2D_OBJROOTS:O:u:[-1..1]} + # anything we use from an object dir other than ours # needs to be qualified with its . suffix # (we used the pseudo machine "host" for the HOST_TARGET). -qualdir_list = \ - ${dir_list:M${_objroot}*/*/*:N${SRCTOP}*:N${_objtop}*:C,${_objroot}([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,} - -.if ${_OBJROOT} != ${_objroot} -dirdep_list += \ - ${dir_list:M${_OBJTOP}*/*:C,${_OBJTOP}[^/]*/,,} - +skip_ql= ${SRCTOP}* ${_objtop}* +.for o in ${M2D_OBJROOTS:${skip_ql:${M_ListToSkip}}} qualdir_list += \ - ${dir_list:M${_OBJROOT}*/*/*:N${SRCTOP}*:N${_OBJTOP}*:C,${_OBJROOT}([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,} -.endif + ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,} +skip_ql+= $o* +.endfor dirdep_list := ${dirdep_list:O:u} -qualdir_list := ${qualdir_list:O:u} +qualdir_list := ${qualdir_list:N*.${MACHINE}:O:u} DIRDEPS = \ ${dirdep_list:N${RELDIR}:N${RELDIR}/*} \ @@ -209,6 +222,7 @@ DIRDEPS += \ DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:ts:}:O:u} .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" +.info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS} .info ${RELDIR}: dir_list='${dir_list}' .info ${RELDIR}: dirdep_list='${dirdep_list}' .info ${RELDIR}: qualdir_list='${qualdir_list}' From owner-svn-src-projects@FreeBSD.ORG Mon Mar 4 21:36:35 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C6DC867; Mon, 4 Mar 2013 21:36:35 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1725D16CB; Mon, 4 Mar 2013 21:36:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24LaYwx014736; Mon, 4 Mar 2013 21:36:34 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24LaYbk014730; Mon, 4 Mar 2013 21:36:34 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303042136.r24LaYbk014730@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 4 Mar 2013 21:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247817 - projects/bmake/share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 21:36:35 -0000 Author: sjg Date: Mon Mar 4 21:36:34 2013 New Revision: 247817 URL: http://svnweb.freebsd.org/changeset/base/247817 Log: Move STAGING related setup to bsd.sys.mk Modified: projects/bmake/share/mk/bsd.lib.mk projects/bmake/share/mk/bsd.prog.mk projects/bmake/share/mk/bsd.sys.mk Modified: projects/bmake/share/mk/bsd.lib.mk ============================================================================== --- projects/bmake/share/mk/bsd.lib.mk Mon Mar 4 21:35:49 2013 (r247816) +++ projects/bmake/share/mk/bsd.lib.mk Mon Mar 4 21:36:34 2013 (r247817) @@ -112,8 +112,8 @@ PO_FLAG=-pg ${CTFCONVERT_CMD} .if !defined(_SKIP_BUILD) -all: prebuild .WAIT -prebuild: objwarn +all: beforebuild .WAIT +beforebuild: objwarn .if !defined(.PARSEDIR) # this is a no-op .WAIT: @@ -429,22 +429,3 @@ clean: .include .include - -.if ${MK_STAGING} != "no" -.if defined(_SKIP_BUILD) -stage_libs stage_files stage_as: -.else -.if !empty(_LIBS) && !defined(INTERNALLIB) -stage_libs: ${_LIBS} -.for t in stage_libs stage_files stage_as -.if target($t) -all: $t -.endif -.endfor -.endif -.if !empty(INCS) || !empty(INCSGROUPS) -prebuild: buildincludes -.endif -.include -.endif -.endif Modified: projects/bmake/share/mk/bsd.prog.mk ============================================================================== --- projects/bmake/share/mk/bsd.prog.mk Mon Mar 4 21:35:49 2013 (r247816) +++ projects/bmake/share/mk/bsd.prog.mk Mon Mar 4 21:36:34 2013 (r247817) @@ -238,49 +238,3 @@ ${OBJS}: ${SRCS:M*.h} .if defined(PORTNAME) .include .endif - -.if ${MK_STAGING} != "no" -.if defined(_SKIP_BUILD) -stage_files stage_as: -.else -# normally only libs and includes are staged -.if ${MK_STAGING_PROG:Uno} != "no" -STAGE_DIR.prog= ${STAGE_OBJTOP}${BINDIR} - -.if !empty(PROG) -.if defined(PROGNAME) -STAGE_AS_SETS+= prog -STAGE_AS_${PROG}= ${PROGNAME} -stage_as.prog: ${PROG} -.else -STAGE_SETS+= prog -stage_files.prog: ${PROG} -all: stage_files -.endif -.endif - -.if !empty(STAGE_AS_SETS) -all: stage_as -.endif -.if !empty(LINKS) -all: stage_links -.ORDER: stage_files stage_links -.if !empty(STAGE_AS_SETS) -.ORDER: stage_as stage_links -.endif -STAGE_SETS+= prog -STAGE_LINKS.prog= ${LINKS} -.endif -.if !empty(SYMLINKS) -all: stage_symlinks -.if !empty(STAGE_AS_SETS) -.ORDER: stage_as stage_symlinks -.endif -STAGE_SETS+= prog -STAGE_SYMLINKS.prog= ${SYMLINKS} -.endif - -.endif -.include -.endif -.endif Modified: projects/bmake/share/mk/bsd.sys.mk ============================================================================== --- projects/bmake/share/mk/bsd.sys.mk Mon Mar 4 21:35:49 2013 (r247816) +++ projects/bmake/share/mk/bsd.sys.mk Mon Mar 4 21:36:34 2013 (r247817) @@ -141,3 +141,79 @@ PHONY_NOTMAIN = afterdepend afterinstall .PHONY: ${PHONY_NOTMAIN} .NOTMAIN: ${PHONY_NOTMAIN} + +.if ${MK_STAGING} != "no" +.if defined(_SKIP_BUILD) || !make(all) +stage_libs stage_files stage_as stage_links stage_symlinks: +.else +# allow targets like beforeinstall to be leveraged +DESTDIR= ${STAGE_OBJTOP} + +.if target(beforeinstall) +.if !empty(_LIBS) || ${MK_STAGING_PROG} != "no" +stage_files: beforeinstall +.endif +.endif + +# normally only libs and includes are staged +.if ${MK_STAGING_PROG} != "no" +STAGE_DIR.prog= ${STAGE_OBJTOP}${BINDIR} + +.if !empty(PROG) +.if defined(PROGNAME) +STAGE_AS_SETS+= prog +STAGE_AS_${PROG}= ${PROGNAME} +stage_as.prog: ${PROG} +.else +STAGE_SETS+= prog +stage_files.prog: ${PROG} +all: stage_files +.endif +.endif +.endif + +.if !empty(_LIBS) && !defined(INTERNALLIB) +stage_libs: ${_LIBS} +.endif + +.if !empty(INCS) || !empty(INCSGROUPS) && target(buildincludes) +beforebuild: buildincludes +.endif + +.if !empty(STAGE_AS_SETS) +all: stage_as +.endif + +.if !empty(_LIBS) || ${MK_STAGING_PROG} != "no" + +.if !empty(LINKS) +all: stage_links +.ORDER: stage_files stage_links +.if !empty(STAGE_AS_SETS) +.ORDER: stage_as stage_links +.endif +STAGE_SETS+= links +STAGE_LINKS.links= ${LINKS} +.endif + +.if !empty(SYMLINKS) +all: stage_symlinks +.if !empty(STAGE_AS_SETS) +.ORDER: stage_as stage_symlinks +.endif +STAGE_SETS+= links +STAGE_SYMLINKS.links= ${SYMLINKS} +.endif + +.endif + +.for t in stage_libs stage_files stage_as +.if target($t) +all: $t +.endif +.endfor + +.include +.endif +.endif + From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 08:09:55 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B87A51BD; Tue, 5 Mar 2013 08:09:55 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8FAF865; Tue, 5 Mar 2013 08:09:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2589t3l090547; Tue, 5 Mar 2013 08:09:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2589sZt090533; Tue, 5 Mar 2013 08:09:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303050809.r2589sZt090533@svn.freebsd.org> From: Martin Matuska Date: Tue, 5 Mar 2013 08:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247831 - in projects/libzfs_core: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 08:09:55 -0000 Author: mm Date: Tue Mar 5 08:09:53 2013 New Revision: 247831 URL: http://svnweb.freebsd.org/changeset/base/247831 Log: WiP merge of libzfs_core (MFV r238590, r238592) not yet working, ioctl handling needs to be changed Added: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/ - copied from r238592, vendor/illumos/dist/lib/libzfs_core/ projects/libzfs_core/cddl/lib/libzfs_core/ projects/libzfs_core/cddl/lib/libzfs_core/Makefile (contents, props changed) Modified: projects/libzfs_core/Makefile.inc1 projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs.8 projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c projects/libzfs_core/cddl/contrib/opensolaris/cmd/zhack/zhack.c projects/libzfs_core/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c projects/libzfs_core/cddl/contrib/opensolaris/cmd/ztest/ztest.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h projects/libzfs_core/cddl/lib/Makefile projects/libzfs_core/cddl/lib/libzfs/Makefile projects/libzfs_core/cddl/sbin/zfs/Makefile projects/libzfs_core/cddl/sbin/zpool/Makefile projects/libzfs_core/cddl/usr.bin/zinject/Makefile projects/libzfs_core/cddl/usr.bin/ztest/Makefile projects/libzfs_core/cddl/usr.sbin/zdb/Makefile projects/libzfs_core/cddl/usr.sbin/zhack/Makefile projects/libzfs_core/rescue/rescue/Makefile projects/libzfs_core/share/mk/bsd.libnames.mk projects/libzfs_core/sys/cddl/compat/opensolaris/sys/cred.h projects/libzfs_core/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c projects/libzfs_core/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h projects/libzfs_core/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c projects/libzfs_core/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h projects/libzfs_core/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/sys/feature_tests.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: projects/libzfs_core/cddl/contrib/opensolaris/ (props changed) projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/ (props changed) projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/ (props changed) projects/libzfs_core/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/libzfs_core/Makefile.inc1 ============================================================================== --- projects/libzfs_core/Makefile.inc1 Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/Makefile.inc1 Tue Mar 5 08:09:53 2013 (r247831) @@ -1389,6 +1389,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ + ${_cddl_lib_libzfs_core} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1417,6 +1418,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair +_cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib= cddl/lib .endif Modified: projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Mar 5 08:09:53 2013 (r247831) @@ -57,6 +57,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -206,6 +207,27 @@ dump_packed_nvlist(objset_t *os, uint64_ nvlist_free(nv); } +/* ARGSUSED */ +static void +dump_history_offsets(objset_t *os, uint64_t object, void *data, size_t size) +{ + spa_history_phys_t *shp = data; + + if (shp == NULL) + return; + + (void) printf("\t\tpool_create_len = %llu\n", + (u_longlong_t)shp->sh_pool_create_len); + (void) printf("\t\tphys_max_off = %llu\n", + (u_longlong_t)shp->sh_phys_max_off); + (void) printf("\t\tbof = %llu\n", + (u_longlong_t)shp->sh_bof); + (void) printf("\t\teof = %llu\n", + (u_longlong_t)shp->sh_eof); + (void) printf("\t\trecords_lost = %llu\n", + (u_longlong_t)shp->sh_records_lost); +} + static void zdb_nicenum(uint64_t num, char *buf) { @@ -857,21 +879,22 @@ dump_history(spa_t *spa) for (int i = 0; i < num; i++) { uint64_t time, txg, ievent; char *cmd, *intstr; + boolean_t printed = B_FALSE; if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME, &time) != 0) - continue; + goto next; if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD, &cmd) != 0) { if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_INT_EVENT, &ievent) != 0) - continue; + goto next; verify(nvlist_lookup_uint64(events[i], ZPOOL_HIST_TXG, &txg) == 0); verify(nvlist_lookup_string(events[i], ZPOOL_HIST_INT_STR, &intstr) == 0); - if (ievent >= LOG_END) - continue; + if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) + goto next; (void) snprintf(internalstr, sizeof (internalstr), @@ -884,6 +907,14 @@ dump_history(spa_t *spa) (void) localtime_r(&tsec, &t); (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); (void) printf("%s %s\n", tbuf, cmd); + printed = B_TRUE; + +next: + if (dump_opt['h'] > 1) { + if (!printed) + (void) printf("unrecognized record:\n"); + dump_nvlist(events[i], 2); + } } } @@ -1460,7 +1491,7 @@ static object_viewer_t *object_viewer[DM dump_zap, /* other ZAP */ dump_zap, /* persistent error log */ dump_uint8, /* SPA history */ - dump_uint64, /* SPA history offsets */ + dump_history_offsets, /* SPA history offsets */ dump_zap, /* Pool properties */ dump_zap, /* DSL permissions */ dump_acl, /* ZFS ACL */ Modified: projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Mar 5 08:09:53 2013 (r247831) @@ -65,6 +65,7 @@ .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns Ar volume@snapname +.Ar filesystem@snapname Ns | Ns Ar volume@snapname Ns ... .Nm .Cm rollback .Op Fl rRf @@ -1645,17 +1646,18 @@ behavior for mounted file systems in use .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns volume@snapname +.Ar filesystem@snapname Ns | Ns volume@snapname Ns ... .Xc .Pp -Creates a snapshot with the given name. All previous modifications by -successful system calls to the file system are part of the snapshot. See the +Creates snapshots with the given names. All previous modifications by +successful system calls to the file system are part of the snapshots. +Snapshots are taken atomically, so that all snapshots correspond to the same +moment in time. See the .Qq Sx Snapshots section for details. .Bl -tag -width indent .It Fl r -Recursively create snapshots of all descendent datasets. Snapshots are taken -atomically, so that all recursive snapshots correspond to the same moment in -time. +Recursively create snapshots of all descendent datasets .It Fl o Ar property Ns = Ns Ar value Sets the specified property; see .Qq Nm Cm create Modified: projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Mar 5 08:09:53 2013 (r247831) @@ -58,6 +58,7 @@ #include #include +#include #include #include #include @@ -74,6 +75,7 @@ libzfs_handle_t *g_zfs; static FILE *mnttab_file; static char history_str[HIS_MAX_RECORD_LEN]; +static boolean_t log_history = B_TRUE; static int zfs_do_clone(int argc, char **argv); static int zfs_do_create(int argc, char **argv); @@ -276,7 +278,7 @@ get_usage(zfs_help_t idx) return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: return (gettext("\tsnapshot [-r] [-o property=value] ... " - "\n")); + " ...\n")); case HELP_UNMOUNT: return (gettext("\tunmount [-f] " "<-a | filesystem|mountpoint>\n")); @@ -916,9 +918,9 @@ typedef struct destroy_cbdata { nvlist_t *cb_nvl; /* first snap in contiguous run */ - zfs_handle_t *cb_firstsnap; + char *cb_firstsnap; /* previous snap in contiguous run */ - zfs_handle_t *cb_prevsnap; + char *cb_prevsnap; int64_t cb_snapused; char *cb_snapspec; } destroy_cbdata_t; @@ -1032,11 +1034,13 @@ destroy_print_cb(zfs_handle_t *zhp, void if (nvlist_exists(cb->cb_nvl, name)) { if (cb->cb_firstsnap == NULL) - cb->cb_firstsnap = zfs_handle_dup(zhp); + cb->cb_firstsnap = strdup(name); if (cb->cb_prevsnap != NULL) - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); /* this snap continues the current range */ - cb->cb_prevsnap = zfs_handle_dup(zhp); + cb->cb_prevsnap = strdup(name); + if (cb->cb_firstsnap == NULL || cb->cb_prevsnap == NULL) + nomem(); if (cb->cb_verbose) { if (cb->cb_parsable) { (void) printf("destroy\t%s\n", name); @@ -1051,12 +1055,12 @@ destroy_print_cb(zfs_handle_t *zhp, void } else if (cb->cb_firstsnap != NULL) { /* end of this range */ uint64_t used = 0; - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } zfs_close(zhp); @@ -1073,13 +1077,13 @@ destroy_print_snapshots(zfs_handle_t *fs if (cb->cb_firstsnap != NULL) { uint64_t used = 0; if (err == 0) { - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); } cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } return (err); @@ -1932,9 +1936,11 @@ upgrade_set_callback(zfs_handle_t *zhp, /* * If they did "zfs upgrade -a", then we could * be doing ioctls to different pools. We need - * to log this history once to each pool. + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). */ - verify(zpool_stage_history(g_zfs, history_str) == 0); + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } if (zfs_prop_set(zhp, "version", verstr) == 0) cb->cb_numupgraded++; @@ -3472,6 +3478,32 @@ zfs_do_set(int argc, char **argv) return (ret); } +typedef struct snap_cbdata { + nvlist_t *sd_nvl; + boolean_t sd_recursive; + const char *sd_snapname; +} snap_cbdata_t; + +static int +zfs_snapshot_cb(zfs_handle_t *zhp, void *arg) +{ + snap_cbdata_t *sd = arg; + char *name; + int rv = 0; + int error; + + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (error == -1) + nomem(); + fnvlist_add_boolean(sd->sd_nvl, name); + free(name); + + if (sd->sd_recursive) + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + zfs_close(zhp); + return (rv); +} + /* * zfs snapshot [-r] [-o prop=value] ... * @@ -3481,13 +3513,16 @@ zfs_do_set(int argc, char **argv) static int zfs_do_snapshot(int argc, char **argv) { - boolean_t recursive = B_FALSE; int ret = 0; char c; nvlist_t *props; + snap_cbdata_t sd = { 0 }; + boolean_t multiple_snaps = B_FALSE; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) nomem(); + if (nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) != 0) + nomem(); /* check options */ while ((c = getopt(argc, argv, "ro:")) != -1) { @@ -3497,7 +3532,8 @@ zfs_do_snapshot(int argc, char **argv) return (1); break; case 'r': - recursive = B_TRUE; + sd.sd_recursive = B_TRUE; + multiple_snaps = B_TRUE; break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), @@ -3514,18 +3550,35 @@ zfs_do_snapshot(int argc, char **argv) (void) fprintf(stderr, gettext("missing snapshot argument\n")); goto usage; } - if (argc > 1) { - (void) fprintf(stderr, gettext("too many arguments\n")); - goto usage; + + if (argc > 1) + multiple_snaps = B_TRUE; + for (; argc > 0; argc--, argv++) { + char *atp; + zfs_handle_t *zhp; + + atp = strchr(argv[0], '@'); + if (atp == NULL) + goto usage; + *atp = '\0'; + sd.sd_snapname = atp + 1; + zhp = zfs_open(g_zfs, argv[0], + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + goto usage; + if (zfs_snapshot_cb(zhp, &sd) != 0) + goto usage; } - ret = zfs_snapshot(g_zfs, argv[0], recursive, props); + ret = zfs_snapshot_nvl(g_zfs, sd.sd_nvl, props); + nvlist_free(sd.sd_nvl); nvlist_free(props); - if (ret && recursive) + if (ret != 0 && multiple_snaps) (void) fprintf(stderr, gettext("no snapshots were created\n")); return (ret != 0); usage: + nvlist_free(sd.sd_nvl); nvlist_free(props); usage(B_FALSE); return (-1); @@ -6602,8 +6655,7 @@ main(int argc, char **argv) return (1); } - zpool_set_history_str("zfs", argc, argv, history_str); - verify(zpool_stage_history(g_zfs, history_str) == 0); + zfs_save_arguments(argc, argv, history_str, sizeof (history_str)); libzfs_print_on_error(g_zfs, B_TRUE); @@ -6672,6 +6724,9 @@ main(int argc, char **argv) (void) fclose(mnttab_file); + if (ret == 0 && log_history) + (void) zpool_log_history(g_zfs, history_str); + libzfs_fini(g_zfs); /* Modified: projects/libzfs_core/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Mar 5 08:09:53 2013 (r247831) @@ -279,6 +279,9 @@ feature_enable_sync(void *arg1, void *ar zfeature_info_t *feature = arg2; spa_feature_enable(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, + "name=%s can_readonly=%u", + feature->fi_guid, feature->fi_can_readonly); } static void @@ -356,6 +359,8 @@ feature_incr_sync(void *arg1, void *arg2 zfeature_info_t *feature = arg2; spa_feature_incr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature incr", tx, + "name=%s", feature->fi_guid); } static void @@ -365,6 +370,8 @@ feature_decr_sync(void *arg1, void *arg2 zfeature_info_t *feature = arg2; spa_feature_decr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature decr", tx, + "name=%s", feature->fi_guid); } static void Modified: projects/libzfs_core/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Mar 5 08:09:53 2013 (r247831) @@ -192,9 +192,9 @@ static zpool_command_t command_table[] = #define NCOMMAND (sizeof (command_table) / sizeof (command_table[0])) -zpool_command_t *current_command; +static zpool_command_t *current_command; static char history_str[HIS_MAX_RECORD_LEN]; - +static boolean_t log_history = B_TRUE; static uint_t timestamp_fmt = NODATE; static const char * @@ -1093,7 +1093,10 @@ zpool_do_destroy(int argc, char **argv) return (1); } - ret = (zpool_destroy(zhp) != 0); + /* The history must be logged as part of the export */ + log_history = B_FALSE; + + ret = (zpool_destroy(zhp, history_str) != 0); zpool_close(zhp); @@ -1157,10 +1160,13 @@ zpool_do_export(int argc, char **argv) continue; } + /* The history must be logged as part of the export */ + log_history = B_FALSE; + if (hardforce) { - if (zpool_export_force(zhp) != 0) + if (zpool_export_force(zhp, history_str) != 0) ret = 1; - } else if (zpool_export(zhp, force) != 0) { + } else if (zpool_export(zhp, force, history_str) != 0) { ret = 1; } @@ -4560,6 +4566,14 @@ upgrade_cb(zpool_handle_t *zhp, void *ar if (count > 0) { cbp->cb_first = B_FALSE; printnl = B_TRUE; + /* + * If they did "zpool upgrade -a", then we could + * be doing ioctls to different pools. We need + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). + */ + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } } @@ -4921,8 +4935,8 @@ zpool_do_upgrade(int argc, char **argv) typedef struct hist_cbdata { boolean_t first; - int longfmt; - int internal; + boolean_t longfmt; + boolean_t internal; } hist_cbdata_t; /* @@ -4934,21 +4948,8 @@ get_history_one(zpool_handle_t *zhp, voi nvlist_t *nvhis; nvlist_t **records; uint_t numrecords; - char *cmdstr; - char *pathstr; - uint64_t dst_time; - time_t tsec; - struct tm t; - char tbuf[30]; int ret, i; - uint64_t who; - struct passwd *pwd; - char *hostname; - char *zonename; - char internalstr[MAXPATHLEN]; hist_cbdata_t *cb = (hist_cbdata_t *)data; - uint64_t txg; - uint64_t ievent; cb->first = B_FALSE; @@ -4960,64 +4961,94 @@ get_history_one(zpool_handle_t *zhp, voi verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD, &records, &numrecords) == 0); for (i = 0; i < numrecords; i++) { - if (nvlist_lookup_uint64(records[i], ZPOOL_HIST_TIME, - &dst_time) != 0) - continue; + nvlist_t *rec = records[i]; + char tbuf[30] = ""; - /* is it an internal event or a standard event? */ - if (nvlist_lookup_string(records[i], ZPOOL_HIST_CMD, - &cmdstr) != 0) { - if (cb->internal == 0) + if (nvlist_exists(rec, ZPOOL_HIST_TIME)) { + time_t tsec; + struct tm t; + + tsec = fnvlist_lookup_uint64(records[i], + ZPOOL_HIST_TIME); + (void) localtime_r(&tsec, &t); + (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); + } + + if (nvlist_exists(rec, ZPOOL_HIST_CMD)) { + (void) printf("%s %s", tbuf, + fnvlist_lookup_string(rec, ZPOOL_HIST_CMD)); + } else if (nvlist_exists(rec, ZPOOL_HIST_INT_EVENT)) { + int ievent = + fnvlist_lookup_uint64(rec, ZPOOL_HIST_INT_EVENT); + if (!cb->internal) continue; - - if (nvlist_lookup_uint64(records[i], - ZPOOL_HIST_INT_EVENT, &ievent) != 0) + if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) { + (void) printf("%s unrecognized record:\n", + tbuf); + dump_nvlist(rec, 4); + continue; + } + (void) printf("%s [internal %s txg:%lld] %s", tbuf, + zfs_history_event_names[ievent], + fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG), + fnvlist_lookup_string(rec, ZPOOL_HIST_INT_STR)); + } else if (nvlist_exists(rec, ZPOOL_HIST_INT_NAME)) { + if (!cb->internal) continue; - verify(nvlist_lookup_uint64(records[i], - ZPOOL_HIST_TXG, &txg) == 0); - verify(nvlist_lookup_string(records[i], - ZPOOL_HIST_INT_STR, &pathstr) == 0); - if (ievent >= LOG_END) + (void) printf("%s [txg:%lld] %s", tbuf, + fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG), + fnvlist_lookup_string(rec, ZPOOL_HIST_INT_NAME)); + if (nvlist_exists(rec, ZPOOL_HIST_DSNAME)) { + (void) printf(" %s (%llu)", + fnvlist_lookup_string(rec, + ZPOOL_HIST_DSNAME), + fnvlist_lookup_uint64(rec, + ZPOOL_HIST_DSID)); + } + (void) printf(" %s", fnvlist_lookup_string(rec, + ZPOOL_HIST_INT_STR)); + } else if (nvlist_exists(rec, ZPOOL_HIST_IOCTL)) { + if (!cb->internal) continue; - (void) snprintf(internalstr, - sizeof (internalstr), - "[internal %s txg:%lld] %s", - zfs_history_event_names[ievent], txg, - pathstr); - cmdstr = internalstr; - } - tsec = dst_time; - (void) localtime_r(&tsec, &t); - (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); - (void) printf("%s %s", tbuf, cmdstr); + (void) printf("%s ioctl %s\n", tbuf, + fnvlist_lookup_string(rec, ZPOOL_HIST_IOCTL)); + if (nvlist_exists(rec, ZPOOL_HIST_INPUT_NVL)) { + (void) printf(" input:\n"); + dump_nvlist(fnvlist_lookup_nvlist(rec, + ZPOOL_HIST_INPUT_NVL), 8); + } + if (nvlist_exists(rec, ZPOOL_HIST_OUTPUT_NVL)) { + (void) printf(" output:\n"); + dump_nvlist(fnvlist_lookup_nvlist(rec, + ZPOOL_HIST_OUTPUT_NVL), 8); + } + } else { + if (!cb->internal) + continue; + (void) printf("%s unrecognized record:\n", tbuf); + dump_nvlist(rec, 4); + } if (!cb->longfmt) { (void) printf("\n"); continue; } (void) printf(" ["); - if (nvlist_lookup_uint64(records[i], - ZPOOL_HIST_WHO, &who) == 0) { - pwd = getpwuid((uid_t)who); - if (pwd) - (void) printf("user %s on", - pwd->pw_name); - else - (void) printf("user %d on", - (int)who); - } else { - (void) printf(gettext("no info]\n")); - continue; + if (nvlist_exists(rec, ZPOOL_HIST_WHO)) { + uid_t who = fnvlist_lookup_uint64(rec, ZPOOL_HIST_WHO); + struct passwd *pwd = getpwuid(who); + (void) printf("user %d ", (int)who); + if (pwd != NULL) + (void) printf("(%s) ", pwd->pw_name); + } + if (nvlist_exists(rec, ZPOOL_HIST_HOST)) { + (void) printf("on %s", + fnvlist_lookup_string(rec, ZPOOL_HIST_HOST)); + } + if (nvlist_exists(rec, ZPOOL_HIST_ZONE)) { + (void) printf(":%s", + fnvlist_lookup_string(rec, ZPOOL_HIST_ZONE)); } - if (nvlist_lookup_string(records[i], - ZPOOL_HIST_HOST, &hostname) == 0) { - (void) printf(" %s", hostname); - } - if (nvlist_lookup_string(records[i], - ZPOOL_HIST_ZONE, &zonename) == 0) { - (void) printf(":%s", zonename); - } - (void) printf("]"); (void) printf("\n"); } @@ -5032,8 +5063,6 @@ get_history_one(zpool_handle_t *zhp, voi * * Displays the history of commands that modified pools. */ - - int zpool_do_history(int argc, char **argv) { @@ -5046,10 +5075,10 @@ zpool_do_history(int argc, char **argv) while ((c = getopt(argc, argv, "li")) != -1) { switch (c) { case 'l': - cbdata.longfmt = 1; + cbdata.longfmt = B_TRUE; break; case 'i': - cbdata.internal = 1; + cbdata.internal = B_TRUE; break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), @@ -5274,8 +5303,7 @@ main(int argc, char **argv) if (strcmp(cmdname, "-?") == 0) usage(B_TRUE); - zpool_set_history_str("zpool", argc, argv, history_str); - verify(zpool_stage_history(g_zfs, history_str) == 0); + zfs_save_arguments(argc, argv, history_str, sizeof (history_str)); /* * Run the appropriate command. @@ -5302,6 +5330,9 @@ main(int argc, char **argv) usage(B_FALSE); } + if (ret == 0 && log_history) + (void) zpool_log_history(g_zfs, history_str); + libzfs_fini(g_zfs); /* Modified: projects/libzfs_core/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Mar 5 08:09:53 2013 (r247831) @@ -2332,7 +2332,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, */ nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1); VERIFY3U(ENOENT, ==, - spa_create("ztest_bad_file", nvroot, NULL, NULL, NULL)); + spa_create("ztest_bad_file", nvroot, NULL, NULL)); nvlist_free(nvroot); /* @@ -2340,7 +2340,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, */ nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 2, 1); VERIFY3U(ENOENT, ==, - spa_create("ztest_bad_mirror", nvroot, NULL, NULL, NULL)); + spa_create("ztest_bad_mirror", nvroot, NULL, NULL)); nvlist_free(nvroot); /* @@ -2349,7 +2349,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, */ (void) rw_rdlock(&ztest_name_lock); nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1); - VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL, NULL)); + VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL)); nvlist_free(nvroot); VERIFY3U(0, ==, spa_open(zo->zo_pool, &spa, FTAG)); VERIFY3U(EBUSY, ==, spa_destroy(zo->zo_pool)); @@ -2407,7 +2407,7 @@ ztest_spa_upgrade(ztest_ds_t *zd, uint64 props = fnvlist_alloc(); fnvlist_add_uint64(props, zpool_prop_to_name(ZPOOL_PROP_VERSION), version); - VERIFY0(spa_create(name, nvroot, props, NULL, NULL)); + VERIFY0(spa_create(name, nvroot, props, NULL)); fnvlist_free(nvroot); fnvlist_free(props); @@ -3208,8 +3208,7 @@ ztest_snapshot_create(char *osname, uint (void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname, (u_longlong_t)id); - error = dmu_objset_snapshot(osname, strchr(snapname, '@') + 1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(osname, strchr(snapname, '@') + 1); if (error == ENOSPC) { ztest_record_enospc(FTAG); return (B_FALSE); @@ -3409,8 +3408,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id); (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id); - error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1); if (error && error != EEXIST) { if (error == ENOSPC) { ztest_record_enospc(FTAG); @@ -3433,8 +3431,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ fatal(0, "dmu_objset_create(%s) = %d", clone1name, error); } - error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(clone1name, strchr(snap2name, '@') + 1); if (error && error != EEXIST) { if (error == ENOSPC) { ztest_record_enospc(FTAG); @@ -3443,8 +3440,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ fatal(0, "dmu_open_snapshot(%s) = %d", snap2name, error); } - error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(clone1name, strchr(snap3name, '@') + 1); if (error && error != EEXIST) { if (error == ENOSPC) { ztest_record_enospc(FTAG); @@ -4632,8 +4628,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, * Create snapshot, clone it, mark snap for deferred destroy, * destroy clone, verify snap was also destroyed. */ - error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE, - FALSE, -1); + error = dmu_objset_snapshot_one(osname, snapname); if (error) { if (error == ENOSPC) { ztest_record_enospc("dmu_objset_snapshot"); @@ -4675,8 +4670,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, * destroy a held snapshot, mark for deferred destroy, * release hold, verify snapshot was destroyed. */ - error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE, - FALSE, -1); + error = dmu_objset_snapshot_one(osname, snapname); if (error) { if (error == ENOSPC) { ztest_record_enospc("dmu_objset_snapshot"); @@ -5791,8 +5785,7 @@ ztest_init(ztest_shared_t *zs) spa_feature_table[i].fi_uname); VERIFY3U(0, ==, nvlist_add_uint64(props, buf, 0)); } - VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props, - NULL, NULL)); + VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props, NULL)); nvlist_free(nvroot); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); Modified: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Mar 5 08:09:53 2013 (r247831) @@ -57,7 +57,8 @@ extern "C" { /* * libzfs errors */ -enum { +typedef enum zfs_error { + EZFS_SUCCESS = 0, /* no error -- success */ EZFS_NOMEM = 2000, /* out of memory */ EZFS_BADPROP, /* invalid property value */ EZFS_PROPREADONLY, /* cannot set readonly property */ @@ -129,7 +130,7 @@ enum { EZFS_DIFFDATA, /* bad zfs diff data */ EZFS_POOLREADONLY, /* pool is in read-only mode */ EZFS_UNKNOWN -}; +} zfs_error_t; /* * The following data structures are all part @@ -185,6 +186,9 @@ extern libzfs_handle_t *zfs_get_handle(z extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t); +extern void zfs_save_arguments(int argc, char **, char *, int); +extern int zpool_log_history(libzfs_handle_t *, const char *); + extern int libzfs_errno(libzfs_handle_t *); extern const char *libzfs_error_action(libzfs_handle_t *); extern const char *libzfs_error_description(libzfs_handle_t *); @@ -220,7 +224,7 @@ extern int zpool_iter(libzfs_handle_t *, */ extern int zpool_create(libzfs_handle_t *, const char *, nvlist_t *, nvlist_t *, nvlist_t *); -extern int zpool_destroy(zpool_handle_t *); +extern int zpool_destroy(zpool_handle_t *, const char *); extern int zpool_add(zpool_handle_t *, nvlist_t *); typedef struct splitflags { @@ -343,8 +347,8 @@ extern int zpool_get_errlog(zpool_handle /* * Import and export functions */ -extern int zpool_export(zpool_handle_t *, boolean_t); -extern int zpool_export_force(zpool_handle_t *); +extern int zpool_export(zpool_handle_t *, boolean_t, const char *); +extern int zpool_export_force(zpool_handle_t *, const char *); extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *, char *altroot); extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *, @@ -378,7 +382,7 @@ extern nvlist_t *zpool_find_import_cache */ struct zfs_cmd; -extern const char *zfs_history_event_names[LOG_END]; +extern const char *zfs_history_event_names[]; extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *, boolean_t verbose); @@ -386,12 +390,9 @@ extern int zpool_upgrade(zpool_handle_t extern int zpool_get_history(zpool_handle_t *, nvlist_t **); extern int zpool_history_unpack(char *, uint64_t, uint64_t *, nvlist_t ***, uint_t *); -extern void zpool_set_history_str(const char *subcommand, int argc, - char **argv, char *history_str); -extern int zpool_stage_history(libzfs_handle_t *, const char *); extern void zpool_obj_to_path(zpool_handle_t *, uint64_t, uint64_t, char *, size_t len); -extern int zfs_ioctl(libzfs_handle_t *, unsigned long, struct zfs_cmd *); +extern int zfs_ioctl(libzfs_handle_t *, int request, struct zfs_cmd *); extern int zpool_get_physpath(zpool_handle_t *, char *, size_t); extern void zpool_explain_recover(libzfs_handle_t *, const char *, int, nvlist_t *); @@ -441,8 +442,6 @@ extern int zfs_prop_get_written(zfs_hand char *propbuf, int proplen, boolean_t literal); extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname, char *buf, size_t len); -extern int zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap, - uint64_t *usedp); extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t); extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t); extern const char *zfs_prop_values(zfs_prop_t); @@ -558,6 +557,8 @@ extern int zfs_destroy_snaps(zfs_handle_ extern int zfs_destroy_snaps_nvl(zfs_handle_t *, nvlist_t *, boolean_t); extern int zfs_clone(zfs_handle_t *, const char *, nvlist_t *); extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *); +extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, + nvlist_t *props); extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t); typedef struct renameflags { Modified: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Mar 5 08:08:16 2013 (r247830) +++ projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Mar 5 08:09:53 2013 (r247831) @@ -1447,7 +1447,6 @@ zfs_prop_set(zfs_handle_t *zhp, const ch nvlist_t *nvl = NULL, *realprops; zfs_prop_t prop; boolean_t do_prefix = B_TRUE; - uint64_t idx; int added_resv; (void) snprintf(errbuf, sizeof (errbuf), @@ -2711,25 +2710,6 @@ zfs_prop_get_written(zfs_handle_t *zhp, return (0); } -int -zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap, - uint64_t *usedp) -{ - int err; - zfs_cmd_t zc = { 0 }; - - (void) strlcpy(zc.zc_name, lastsnap->zfs_name, sizeof (zc.zc_name)); - (void) strlcpy(zc.zc_value, firstsnap->zfs_name, sizeof (zc.zc_value)); - - err = ioctl(lastsnap->zfs_hdl->libzfs_fd, ZFS_IOC_SPACE_SNAPS, &zc); - if (err) - return (err); - - *usedp = zc.zc_cookie; - - return (0); -} - /* * Returns the name of the given zfs handle. */ @@ -2930,7 +2910,6 @@ create_parents(libzfs_handle_t *hdl, cha */ for (cp = target + prefixlen + 1; cp = strchr(cp, '/'); *cp = '/', cp++) { - char *logstr; *cp = '\0'; @@ -2941,16 +2920,12 @@ create_parents(libzfs_handle_t *hdl, cha continue; } - logstr = hdl->libzfs_log_str; - hdl->libzfs_log_str = NULL; if (zfs_create(hdl, target, ZFS_TYPE_FILESYSTEM, NULL) != 0) { - hdl->libzfs_log_str = logstr; opname = dgettext(TEXT_DOMAIN, "create"); goto ancestorerr; } - hdl->libzfs_log_str = logstr; h = zfs_open(hdl, target, ZFS_TYPE_FILESYSTEM); if (h == NULL) { opname = dgettext(TEXT_DOMAIN, "open"); @@ -3008,12 +2983,12 @@ int zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, nvlist_t *props) { - zfs_cmd_t zc = { 0 }; int ret; uint64_t size = 0; uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); char errbuf[1024]; uint64_t zoned; + dmu_objset_type_t ost; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot create '%s'"), path); @@ -3033,17 +3008,16 @@ zfs_create(libzfs_handle_t *hdl, const c * will return ENOENT, not EEXIST. To prevent this from happening, we * first try to see if the dataset exists. */ - (void) strlcpy(zc.zc_name, path, sizeof (zc.zc_name)); - if (zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) { + if (zfs_dataset_exists(hdl, path, ZFS_TYPE_DATASET)) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "dataset already exists")); return (zfs_error(hdl, EZFS_EXISTS, errbuf)); } if (type == ZFS_TYPE_VOLUME) - zc.zc_objset_type = DMU_OST_ZVOL; + ost = DMU_OST_ZVOL; else - zc.zc_objset_type = DMU_OST_ZFS; + ost = DMU_OST_ZFS; if (props && (props = zfs_valid_proplist(hdl, type, props, zoned, NULL, errbuf)) == 0) @@ -3095,14 +3069,9 @@ zfs_create(libzfs_handle_t *hdl, const c } } - if (props && zcmd_write_src_nvlist(hdl, &zc, props) != 0) - return (-1); - nvlist_free(props); - /* create the dataset */ - ret = zfs_ioctl(hdl, ZFS_IOC_CREATE, &zc); - - zcmd_free_nvlists(&zc); + ret = lzc_create(path, ost, props); + nvlist_free(props); /* check for failure */ if (ret != 0) { @@ -3242,33 +3211,35 @@ int zfs_destroy_snaps_nvl(zfs_handle_t *zhp, nvlist_t *snaps, boolean_t defer) { int ret; - zfs_cmd_t zc = { 0 }; + nvlist_t *errlist; - (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - if (zcmd_write_src_nvlist(zhp->zfs_hdl, &zc, snaps) != 0) - return (-1); - zc.zc_defer_destroy = defer; + ret = lzc_destroy_snaps(snaps, defer, &errlist); - ret = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY_SNAPS_NVL, &zc); if (ret != 0) { - char errbuf[1024]; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 09:01:02 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6B158E89; Tue, 5 Mar 2013 09:01:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id E0D9BA3B; Tue, 5 Mar 2013 09:01:00 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r2590roB054070; Tue, 5 Mar 2013 13:00:53 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r2590rcd054069; Tue, 5 Mar 2013 13:00:53 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 Mar 2013 13:00:53 +0400 From: Gleb Smirnoff To: Attilio Rao Subject: Re: style(9) changing Message-ID: <20130305090053.GG48089@FreeBSD.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041040.41845.jhb@freebsd.org> <201303041521.06557.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Davide Italiano , svn-src-projects@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 09:01:02 -0000 On Mon, Mar 04, 2013 at 09:41:05PM +0100, Attilio Rao wrote: A> I wonder how much style(9) can change over the time. Maybe it is time A> to add/update few rules to better comply with new standard adds. IMHO, style(9) may and should change. It isn't cast on stone forever. We should adopt it to C99 at least. -- Totus tuus, Glebius. From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 09:43:44 2013 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A1E1B387; Tue, 5 Mar 2013 09:43:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF3AE60; Tue, 5 Mar 2013 09:43:43 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r259hXaC006397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Mar 2013 20:43:35 +1100 Date: Tue, 5 Mar 2013 20:43:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern In-Reply-To: <201303041620.52100.jhb@freebsd.org> Message-ID: <20130305201211.M902@besplex.bde.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=DdhPMYRW c=1 sm=1 a=gRR7UNw4rV0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y4pc3zAY36oA:10 a=6I5d2MoRAAAA:8 a=8NX_ljeKmFfN72uQc9IA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: attilio@FreeBSD.org, Davide Italiano , src-committers@FreeBSD.org, svn-src-projects@FreeBSD.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 09:43:44 -0000 On Mon, 4 Mar 2013, John Baldwin wrote: > On Monday, March 04, 2013 3:41:05 pm Attilio Rao wrote: >> On Mon, Mar 4, 2013 at 9:21 PM, John Baldwin wrote: >>> On Monday, March 04, 2013 3:17:30 pm Davide Italiano wrote: >>>> On Mon, Mar 4, 2013 at 4:40 PM, John Baldwin wrote: >>>>> On Sunday, March 03, 2013 8:39:54 am Davide Italiano wrote: >>>>>> Author: davide >>>>>> Date: Sun Mar 3 13:39:54 2013 >>>>>> New Revision: 247710 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/247710 >>>>>> >>>>>> Log: >>>>>> - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables. Style bug. >>>>> We have stdbool in the kernel. Why not use that instead of the Machish >>>>> boolean_t? Neither is BSDish. I like(d) bool_t and TRUE/FALSE, and in 1993 when I didn't know BSD style very well, I made the mistake of exposing the Machish boolean_t and TRUE/FALSE outside of vm. It is now used a bit. >>>> move to 'boolean_t'. >>>> Honestly, I didn't argue due to the relative little relevance of the >>>> change, but actually I find the type change more explicative. >>>> I have no strong objections to change it again (in particular because >>>> I think you're suggesting to use bool to be C99 compliant, feel free >>>> to correct me if I'm wrong). >>>> >>>> While here. After closer looking I realized boolean_t is widely used >>>> in the kernel (e.g. sys/kern/). Is this just a common error or is >>>> there something I'm missing? Not very widely used, especially in kern. There are only 17 boolean_t's in all of kern. There are 33 TRUE's and 24 FALSE's in kern. This is approxiately none. Since I like(d) bool_t, I used it in sio and there are 15 uses of it there now (10 TRUE's and 8 FALSE's). This uses my old spelling from pre-C90 and pre-BSD, with a private typedef so that it is portable. The uart driver has different style bugs but not the one of using bools. It has no instances of boolean_t under any spelling, 5 of TRUE and 3 of FALSE> This shows that it is an uncommon error to use boolean_t outside of vm. >>> No, it's just older and bool is C99 as you noticed. I had thought that >>> boolean_t was largely regulated to code from Mach (i.e. sys/vm) and that >>> we should use bool for new code. That would be a large change. BSD style doesn't even use the ! operator, buit uses comparison with 0. >> Actually boolean_t is much more widespread in our kernel than the C99 >> variant. Moreover style(9) doesn't advertise it either, neither the Since boolean_t escaped earlier, and C99 extensions are rarely used. >> necessity to conform to library defined C99 features (even if present >> in the C99 standard, _Bool is still defined in stdbool.h which is an >> header not present in our kernel). > > Err, I thought that mdf@ had proposed importing stdbool.h into our kernel > already? Ah, yes, the requisite bits are in , so 'bool' works > fine. Like boolean_t. I made the mistake of putting it in sys/types.h instead of in its own header so that it could be easily used. In 4.4BSD-Lite2, it is still only in the Machish header vm/vm_param.h. NetBSD moved it to sys/types.h in 2003. > I think for new code we should prefer C99's bool to boolean_t. Why? There is no existing practice for this in the kernel. There is some in the Linux kernel :-). Bruce From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 09:48:21 2013 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3FF19995; Tue, 5 Mar 2013 09:48:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id C19B9C9; Tue, 5 Mar 2013 09:48:20 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r259mJcD054315; Tue, 5 Mar 2013 13:48:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r259mJu3054314; Tue, 5 Mar 2013 13:48:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 Mar 2013 13:48:19 +0400 From: Gleb Smirnoff To: Bruce Evans Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern Message-ID: <20130305094819.GI48089@FreeBSD.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> <20130305201211.M902@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130305201211.M902@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: attilio@FreeBSD.org, Davide Italiano , src-committers@FreeBSD.org, svn-src-projects@FreeBSD.org, John Baldwin X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 09:48:21 -0000 On Tue, Mar 05, 2013 at 08:43:33PM +1100, Bruce Evans wrote: B> > I think for new code we should prefer C99's bool to boolean_t. B> B> Why? There is no existing practice for this in the kernel. There is some B> in the Linux kernel :-). Why? Because it is standard. What for? To make it more easy for newcomers to start hacking on FreeBSD kernel. -- Totus tuus, Glebius. From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 11:41:53 2013 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8B5A4CDD; Tue, 5 Mar 2013 11:41:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 3987B876; Tue, 5 Mar 2013 11:41:52 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 66486D40DD6; Tue, 5 Mar 2013 22:21:14 +1100 (EST) Date: Tue, 5 Mar 2013 22:21:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern In-Reply-To: <20130305094819.GI48089@FreeBSD.org> Message-ID: <20130305214655.C1224@besplex.bde.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> <20130305201211.M902@besplex.bde.org> <20130305094819.GI48089@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=DdhPMYRW c=1 sm=1 a=gRR7UNw4rV0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y4pc3zAY36oA:10 a=K_oTS8gbY3jmMLHMjHUA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: Davide Italiano , src-committers@FreeBSD.org, John Baldwin , attilio@FreeBSD.org, Bruce Evans , svn-src-projects@FreeBSD.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 11:41:53 -0000 On Tue, 5 Mar 2013, Gleb Smirnoff wrote: > On Tue, Mar 05, 2013 at 08:43:33PM +1100, Bruce Evans wrote: > B> > I think for new code we should prefer C99's bool to boolean_t. > B> > B> Why? There is no existing practice for this in the kernel. There is some > B> in the Linux kernel :-). > > Why? Because it is standard. What for? To make it more easy for newcomers > to start hacking on FreeBSD kernel. I think you mean "harder". Now the newcomers need to know: - the old method, which is used in most places - the new method - style rules for old, new and mixed methods - arcane C99 points like whether bool can be used in bit-fields (I had to look this up to check it. It can). I now see technical reasons to never use bool in kernel or other low-level code. It will cause minor pessimizations converting nonzero to true (1) at runtime, and for converting bool to register_t when passing parameters (bool is 1 byte on x86). To use bool in structs (when not packing it into bit-fields), we need to know too much about its size to pack it properly... Bruce From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 12:05:46 2013 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E9AFC8C7; Tue, 5 Mar 2013 12:05:46 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 6962CA00; Tue, 5 Mar 2013 12:05:46 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [46.29.221.36]) by mta.bitpro.no (Postfix) with ESMTP id AE4F97A0D7; Tue, 5 Mar 2013 13:05:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bitfrost.no Received: from laptop015.hselasky.homeunix.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: hanspetter) by mail.bitfrost.no (Postfix) with ESMTPSA id 14BDB2A0E2; Tue, 5 Mar 2013 13:05:32 +0100 (CET) Message-ID: <5135DFD5.5050708@bitfrost.no> Date: Tue, 05 Mar 2013 13:06:45 +0100 From: Hans Petter Selasky Organization: Bitfrost A/S MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> <20130305201211.M902@besplex.bde.org> <20130305094819.GI48089@FreeBSD.org> <20130305214655.C1224@besplex.bde.org> In-Reply-To: <20130305214655.C1224@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Davide Italiano , src-committers@FreeBSD.org, John Baldwin , attilio@FreeBSD.org, Gleb Smirnoff , svn-src-projects@FreeBSD.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 12:05:47 -0000 On 03/05/13 12:21, Bruce Evans wrote: > On Tue, 5 Mar 2013, Gleb Smirnoff wrote: > >> On Tue, Mar 05, 2013 at 08:43:33PM +1100, Bruce Evans wrote: >> B> > I think for new code we should prefer C99's bool to boolean_t. >> B> >> B> Why? There is no existing practice for this in the kernel. There >> is some >> B> in the Linux kernel :-). >> >> Why? Because it is standard. What for? To make it more easy for newcomers >> to start hacking on FreeBSD kernel. > > I think you mean "harder". Now the newcomers need to know: > - the old method, which is used in most places > - the new method > - style rules for old, new and mixed methods > - arcane C99 points like whether bool can be used in bit-fields (I had to > look this up to check it. It can). > > I now see technical reasons to never use bool in kernel or other low-level > code. It will cause minor pessimizations converting nonzero to true (1) > at runtime, and for converting bool to register_t when passing parameters > (bool is 1 byte on x86). To use bool in structs (when not packing it into > bit-fields), we need to know too much about its size to pack it properly... > > Bruce Hi, I'm not sure how good you all are at C99. There is a subtle difference between bool (compiler type) and boolean_t (typedef'ed), and that is when assigning an non-bool value. This is probably bad style, but I just want to show you the difference: #include #include typedef int boolean_t; int main() { bool var1; var1 = 3; printf("%d\n", var1); boolean_t var2; var2 = 3; printf("%d\n", var2); return (0); } If defined correctly, var1 should contain a value of "1", and var2 should contain a value of "3". Now if for some reason someone like possibly some Linux guys do, use booleans for counting, you will have an instant error :-) I'm not saying we should take their example, but anyhow, be warned about the difference between bool and boolean_t! --HPS From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 13:02:44 2013 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 304B3560; Tue, 5 Mar 2013 13:02:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 71D81CF8; Tue, 5 Mar 2013 13:02:42 +0000 (UTC) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r25D2fQK015076; Wed, 6 Mar 2013 00:02:41 +1100 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r25D2MT4011870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Mar 2013 00:02:25 +1100 Date: Wed, 6 Mar 2013 00:02:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern In-Reply-To: <5135DFD5.5050708@bitfrost.no> Message-ID: <20130305232805.X1535@besplex.bde.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> <20130305201211.M902@besplex.bde.org> <20130305094819.GI48089@FreeBSD.org> <20130305214655.C1224@besplex.bde.org> <5135DFD5.5050708@bitfrost.no> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=DdhPMYRW c=1 sm=1 a=gRR7UNw4rV0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y4pc3zAY36oA:10 a=QIfvWVCBJqZ7fQjckfEA:9 a=CjuIK1q_8ugA:10 a=X6xPAQGtvaNsGfp-:21 a=-Vp17d4JB-KZqZpi:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: Davide Italiano , src-committers@FreeBSD.org, John Baldwin , attilio@FreeBSD.org, Gleb Smirnoff , Bruce Evans , svn-src-projects@FreeBSD.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 13:02:44 -0000 On Tue, 5 Mar 2013, Hans Petter Selasky wrote: > On 03/05/13 12:21, Bruce Evans wrote: >> On Tue, 5 Mar 2013, Gleb Smirnoff wrote: >> >>> On Tue, Mar 05, 2013 at 08:43:33PM +1100, Bruce Evans wrote: >>> B> > I think for new code we should prefer C99's bool to boolean_t. >>> B> >>> B> Why? There is no existing practice for this in the kernel. There >>> is some >>> B> in the Linux kernel :-). >>> >>> Why? Because it is standard. What for? To make it more easy for newcomers >>> to start hacking on FreeBSD kernel. >> >> I think you mean "harder". Now the newcomers need to know: >> - the old method, which is used in most places >> - the new method >> - style rules for old, new and mixed methods >> - arcane C99 points like whether bool can be used in bit-fields (I had to >> look this up to check it. It can). >> >> I now see technical reasons to never use bool in kernel or other low-level >> code. It will cause minor pessimizations converting nonzero to true (1) >> at runtime, and for converting bool to register_t when passing parameters >> (bool is 1 byte on x86). To use bool in structs (when not packing it into >> bit-fields), we need to know too much about its size to pack it properly... > > I'm not sure how good you all are at C99. There is a subtle difference I am a language lawyer for C90 and C99 :-). I don't know much about C11 or C++. > between bool (compiler type) and boolean_t (typedef'ed), and that is when > assigning an non-bool value. This is probably bad style, but I just want to > show you the difference: > > #include > #include > > typedef int boolean_t; > > int main() > { > bool var1; > var1 = 3; > printf("%d\n", var1); > > boolean_t var2; > var2 = 3; > printf("%d\n", var2); > > return (0); > } > > If defined correctly, var1 should contain a value of "1", and var2 should > contain a value of "3". Yes, this is what I meant by the bool version being slower since it needs conversions to translate 3 to 1. Here the values are constant so the compiler can do the conversions at compile time so as to not be slower, but in general there will be some conversions at runtime. Also, printf() is variadic, so bools cannot be passed to it. The bool undergoes the default promotions. Again I fail my language lawyer's exam and have to look up what these promotions are. _Bool has rank < char, so it promotes to int and thus your %d format is correct. > Now if for some reason someone like possibly some > Linux guys do, use booleans for counting, you will have an instant error :-) :-). Both gcc and clang generate a move of 1 to `var' for the counting expression `var++' on `_Bool var'. I would prefer an error. I'd better take bools off the language lawyer's exam so that I pass :-). POLA requires C99 to not specify a complete set of operations for nonsensical operations on bools. So apparently, this var++ is just evaluated as an integer expression with promotions from and to bool. var starts as 0 or 1 and so var + 1 is the integer 1 or 2. Then assigning var + 1 back to var gives the boolean 1. Similarly, var += INT_MAX gives either (bool)INT_MAX = 1, or undefined behaviour so it can give boolean 1 in all cases. Similarly var += UINT_MAX gives either (bool)UINT_MAX = 1, or defined behaviour (bool)0 = 0. clang optimizes the former to 1 and the latter to !!var (xor with 1), but gcc evaluates them at runtime. > I'm not saying we should take their example, but anyhow, be warned about the > difference between bool and boolean_t! Bruce From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 15:25:56 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 119FD18C; Tue, 5 Mar 2013 15:25:56 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qa0-f51.google.com (mail-qa0-f51.google.com [209.85.216.51]) by mx1.freebsd.org (Postfix) with ESMTP id 6F662863; Tue, 5 Mar 2013 15:25:55 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id cr7so1955172qab.3 for ; Tue, 05 Mar 2013 07:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=e7XwLBqoWON7UBmwP9GCHd4ouH5juLCqv4c3BVKG5ts=; b=KTBTt50diTKWckrBSh0Pys0v/OCJMWU103uaEY5DiKHauYhsfcGzN6NCraUParzDyv 3/zS553t0fUeKilypB+vWitqVP4SCmLszA5DVQ+MIX9pELKnnp6hu++ZYxZG0XOzsmIB 2PFzbQXweMChxhGCGsaK3R52/fEDtOca69oir+0RWq/I0cUgU7uFFlEfgyyG8wszIbPH ETr2YczVJxI/mWwIS9giOjACtc+MJ3wNcP+SfXtWssVHMWv7SRjtCZa9nM6wE10PwOfs kI8n0tDlsF6Izd80CrCpa9VzwS27mnrnLsKsB+JRMGRoYVDEOwARjsqVwrbwdS6GLgVq 7z9Q== MIME-Version: 1.0 X-Received: by 10.229.177.224 with SMTP id bj32mr8534276qcb.102.1362497154377; Tue, 05 Mar 2013 07:25:54 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.229.179.42 with HTTP; Tue, 5 Mar 2013 07:25:54 -0800 (PST) In-Reply-To: <20130305201211.M902@besplex.bde.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> <20130305201211.M902@besplex.bde.org> Date: Tue, 5 Mar 2013 07:25:54 -0800 X-Google-Sender-Auth: lRqA9wUu9fpz86qPwjSHkWnEDy8 Message-ID: Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern From: mdf@FreeBSD.org To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Cc: attilio@freebsd.org, Davide Italiano , src-committers@freebsd.org, svn-src-projects@freebsd.org, John Baldwin X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 15:25:56 -0000 On Tue, Mar 5, 2013 at 1:43 AM, Bruce Evans wrote: > Why? There is no existing practice for [bool] in the kernel. There is some > in the Linux kernel :-). IMO this is the problem with style always conforming to existing code. There is no way to introduce new concepts. bool may be slightly pessimistic from the standpoint of compiler forcing 0/1. However, since C is weakly typed, we "should" all have been writing our control statements that take a boolean to evaluate to a boolean argument, as implied by the style guideline that '!' is only applied to boolean statements. That style recommendation is often not followed; e.g. there's plenty of code like if (!error) (I found 762 instances in sys/). To unpack what I said, without a bool type if (error) was style-weird since it wasn't a boolean used in a boolean expression, but C was "clever" and decided how to do that, instead of requiring the boolean expression if (error != 0). style(9) had an example of a proper boolean but that form is used less frequently than the shorter C idiom of if (error). (17942 instances of if (error) versus 3168 instances of the more style(9)-correct if (error != 0)). Types are there to document things for humans, with a side effect of documenting things for the hardware. Efficiency is important but rarely king; for example no one went around changing loop counters form int to long for 64-bit hardware even though some operations on long are faster since they don't need to sign-extend (and possibly some operations on long are slower since on x86 the instruction may be more bits, and icache is so important. But I doubt the experiment was even done). bool serves the purpose of documenting exactly that something is true/false and no other value. bool++ was a lazy way of writing bool = true, and suffered from a theoretical problem of overflow when bools were ints and not a language-defined type with explicit semantics. Anyways, my long-winded point was that the C language has evolved. If our highest style guide is that we preserve existing style, we will never use new language features since they never used to exist. So I don't think that the absence of any code examples is a reason to forbid code. Cheers, matthew From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 15:30:13 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18DF040F; Tue, 5 Mar 2013 15:30:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 8DA5189A; Tue, 5 Mar 2013 15:30:11 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r25FUAV2055906; Tue, 5 Mar 2013 19:30:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r25FUAiA055905; Tue, 5 Mar 2013 19:30:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 Mar 2013 19:30:10 +0400 From: Gleb Smirnoff To: mdf@FreeBSD.org Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern Message-ID: <20130305153010.GL48089@FreeBSD.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> <20130305201211.M902@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Davide Italiano , src-committers@freebsd.org, John Baldwin , attilio@freebsd.org, Bruce Evans , svn-src-projects@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 15:30:13 -0000 On Tue, Mar 05, 2013 at 07:25:54AM -0800, mdf@FreeBSD.org wrote: m> On Tue, Mar 5, 2013 at 1:43 AM, Bruce Evans wrote: m> > Why? There is no existing practice for [bool] in the kernel. There is some m> > in the Linux kernel :-). m> m> IMO this is the problem with style always conforming to existing code. m> There is no way to introduce new concepts. m> m> bool may be slightly pessimistic from the standpoint of compiler m> forcing 0/1. However, since C is weakly typed, we "should" all have m> been writing our control statements that take a boolean to evaluate to m> a boolean argument, as implied by the style guideline that '!' is only m> applied to boolean statements. That style recommendation is often not m> followed; e.g. there's plenty of code like if (!error) (I found 762 m> instances in sys/). m> m> To unpack what I said, without a bool type if (error) was style-weird m> since it wasn't a boolean used in a boolean expression, but C was m> "clever" and decided how to do that, instead of requiring the boolean m> expression if (error != 0). style(9) had an example of a proper m> boolean but that form is used less frequently than the shorter C idiom m> of if (error). (17942 instances of if (error) versus 3168 instances m> of the more style(9)-correct if (error != 0)). m> m> Types are there to document things for humans, with a side effect of m> documenting things for the hardware. Efficiency is important but m> rarely king; for example no one went around changing loop counters m> form int to long for 64-bit hardware even though some operations on m> long are faster since they don't need to sign-extend (and possibly m> some operations on long are slower since on x86 the instruction may be m> more bits, and icache is so important. But I doubt the experiment was m> even done). m> m> bool serves the purpose of documenting exactly that something is m> true/false and no other value. bool++ was a lazy way of writing bool m> = true, and suffered from a theoretical problem of overflow when bools m> were ints and not a language-defined type with explicit semantics. m> m> Anyways, my long-winded point was that the C language has evolved. If m> our highest style guide is that we preserve existing style, we will m> never use new language features since they never used to exist. So I m> don't think that the absence of any code examples is a reason to m> forbid code. +1 Thanks for typing the long explanation, Matthew. -- Totus tuus, Glebius. From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 16:39:22 2013 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 72F92DF0; Tue, 5 Mar 2013 16:39:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by mx1.freebsd.org (Postfix) with ESMTP id 0EAA6E5B; Tue, 5 Mar 2013 16:39:21 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r25GdD5o026457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Mar 2013 03:39:14 +1100 Date: Wed, 6 Mar 2013 03:39:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: mdf@FreeBSD.org Subject: Re: svn commit: r247710 - projects/calloutng/sys/kern In-Reply-To: Message-ID: <20130306024642.M2179@besplex.bde.org> References: <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041521.06557.jhb@freebsd.org> <201303041620.52100.jhb@freebsd.org> <20130305201211.M902@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=DdhPMYRW c=1 sm=1 a=gRR7UNw4rV0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y4pc3zAY36oA:10 a=6I5d2MoRAAAA:8 a=J2OTBxRxUykc-LdORJ0A:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: Davide Italiano , src-committers@FreeBSD.org, John Baldwin , attilio@FreeBSD.org, Bruce Evans , svn-src-projects@FreeBSD.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 16:39:22 -0000 On Tue, 5 Mar 2013 mdf@FreeBSD.org wrote: > On Tue, Mar 5, 2013 at 1:43 AM, Bruce Evans wrote: >> Why? There is no existing practice for [bool] in the kernel. There is some >> in the Linux kernel :-). > > IMO this is the problem with style always conforming to existing code. > There is no way to introduce new concepts. Yes, it is hard to change the style of something 5.8 million lines long (that's just the kernel sources. 4.4Lite2 was a only 660000 lines). Change a rule affecting 0.1% of lines perfectly formatted in the old style and you instantly have 5800 new style bugs. > bool may be slightly pessimistic from the standpoint of compiler > forcing 0/1. However, since C is weakly typed, we "should" all have > been writing our control statements that take a boolean to evaluate to > a boolean argument, as implied by the style guideline that '!' is only > applied to boolean statements. That style recommendation is often not > followed; e.g. there's plenty of code like if (!error) (I found 762 > instances in sys/). 130 in Lite2. The rules against them seem to be having an effect, since their expansion factor of 5.96 is less than the kernel expansion factor if 8.78. > To unpack what I said, without a bool type if (error) was style-weird > since it wasn't a boolean used in a boolean expression, but C was > "clever" and decided how to do that, instead of requiring the boolean > expression if (error != 0). This is technically an integer expression (even if `error' was bool and 0 was spelled 'false', they would promote to int in the expression). > style(9) had an example of a proper > boolean but that form is used less frequently than the shorter C idiom > of if (error). (17942 instances of if (error) versus 3168 instances > of the more style(9)-correct if (error != 0)). 'if (error)' was the old style, and the 3168 instance of 'if (error != 0) are partly the result of adding an example of the latter in style(9). There seems to be no rule against either in in style(9). Old code even used 'if (error = foo())' (which compilers now warn about), and the only instance of 'error' in the 4.4BSD-Lite2 style guide gives an example of that: Lite2: @ /* No spaces after function names. */ @ if (error = function(a1, a2)) @ exit(error); FreeBSD: @ No spaces after function names. Commas have a space after them. No spa- @ ces after `(' or `[' or preceding `]' or `)' characters. @ @ error = function(a1, a2); @ if (error != 0) @ exit(error); Perhaps more than half of the 3168 are the result of a phk sweep to change to the latter. Other people and OS's more often changed to `if ((error = foo()) != 0)' which matches the original rather cryptic style better. > bool serves the purpose of documenting exactly that something is > true/false and no other value. I think there aren't enough pure bools to make much difference. All the (error [!= 0]) examples are for integer expressions obfuscated as boolean expressions. This makes the style change to it easier but less useful. > bool++ was a lazy way of writing bool > = true, and suffered from a theoretical problem of overflow when bools > were ints and not a language-defined type with explicit semantics. I describe it as "micro-optimizing for pdp-11", and always wrote it as "var = TRUE". Requiring using stdbool also breaks the style of old code that was careful about this, by requiring changing the spelling of "true". Not requiring it or not enforcing the requirement leaves a ixture of styles, with a half-life for the old style of much longer than 15 years, as shown by the 17942:3168 for (error) vs (error != 0). This ratio would probably be little different if the rule hadn't been changed. You would have to enforce it to eradicate the 17942 lines, and no one would like strict enforcement of style(9), especially just after someone adds a new rule to it because they don't like the old style. > Anyways, my long-winded point was that the C language has evolved. If > our highest style guide is that we preserve existing style, we will > never use new language features since they never used to exist. So I > don't think that the absence of any code examples is a reason to > forbid code. Bruce From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 22:51:12 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 529C2AB2; Tue, 5 Mar 2013 22:51:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1251E0; Tue, 5 Mar 2013 22:51:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25MpCkU061388; Tue, 5 Mar 2013 22:51:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25MpCct061387; Tue, 5 Mar 2013 22:51:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303052251.r25MpCct061387@svn.freebsd.org> From: Xin LI Date: Tue, 5 Mar 2013 22:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247857 - projects/libzfs_core X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 22:51:12 -0000 Author: delphij Date: Tue Mar 5 22:51:11 2013 New Revision: 247857 URL: http://svnweb.freebsd.org/changeset/base/247857 Log: libzfs_core depends on libnvpair, explicitly say this in Makefile.inc1. This fixes build with make -j. Modified: projects/libzfs_core/Makefile.inc1 Modified: projects/libzfs_core/Makefile.inc1 ============================================================================== --- projects/libzfs_core/Makefile.inc1 Tue Mar 5 22:41:35 2013 (r247856) +++ projects/libzfs_core/Makefile.inc1 Tue Mar 5 22:51:11 2013 (r247857) @@ -1420,6 +1420,7 @@ _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib= cddl/lib +cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L .endif .if ${MK_CRYPT} != "no" From owner-svn-src-projects@FreeBSD.ORG Tue Mar 5 22:58:53 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BDD28C16; Tue, 5 Mar 2013 22:58:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9940120D; Tue, 5 Mar 2013 22:58:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r25Mwrhe062388; Tue, 5 Mar 2013 22:58:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r25Mwrj9062387; Tue, 5 Mar 2013 22:58:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303052258.r25Mwrj9062387@svn.freebsd.org> From: Xin LI Date: Tue, 5 Mar 2013 22:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247858 - projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 22:58:53 -0000 Author: delphij Date: Tue Mar 5 22:58:53 2013 New Revision: 247858 URL: http://svnweb.freebsd.org/changeset/base/247858 Log: Use adx2 instead of adx in the second vsprintf, this fixes a panic. Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c ============================================================================== --- projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Tue Mar 5 22:51:11 2013 (r247857) +++ projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Tue Mar 5 22:58:53 2013 (r247858) @@ -450,7 +450,7 @@ log_internal(nvlist_t *nvl, const char * va_copy(adx2, adx); msg = kmem_alloc(vsnprintf(NULL, 0, fmt, adx) + 1, KM_SLEEP); - (void) vsprintf(msg, fmt, adx); + (void) vsprintf(msg, fmt, adx2); fnvlist_add_string(nvl, ZPOOL_HIST_INT_STR, msg); strfree(msg); From owner-svn-src-projects@FreeBSD.ORG Wed Mar 6 01:21:57 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1A31917; Wed, 6 Mar 2013 01:21:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C41C68EE; Wed, 6 Mar 2013 01:21:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r261LvQo008137; Wed, 6 Mar 2013 01:21:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r261LvWN008136; Wed, 6 Mar 2013 01:21:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201303060121.r261LvWN008136@svn.freebsd.org> From: Xin LI Date: Wed, 6 Mar 2013 01:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247862 - projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2013 01:21:57 -0000 Author: delphij Date: Wed Mar 6 01:21:56 2013 New Revision: 247862 URL: http://svnweb.freebsd.org/changeset/base/247862 Log: Diff reduction with Illumos Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Mar 6 00:36:33 2013 (r247861) +++ projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Mar 6 01:21:56 2013 (r247862) @@ -5801,11 +5801,11 @@ zfsdev_ioctl(struct cdev *dev, u_long zc { zfs_cmd_t *zc; uint_t vecnum; -#ifdef illumos int error, rc, len; +#ifdef illumos minor_t minor = getminor(dev); #else - int cflag, cmd, error, rc, len; + int cflag, cmd; cred_t *cr = td->td_ucred; #endif const zfs_ioc_vec_t *vec; @@ -5989,7 +5989,7 @@ out: zfs_cmd_compat_put(zc, addr, cflag); } - kmem_free(zc, sizeof(zfs_cmd_t)); + kmem_free(zc, sizeof (zfs_cmd_t)); return (error); } From owner-svn-src-projects@FreeBSD.ORG Wed Mar 6 10:40:52 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0DEC7786; Wed, 6 Mar 2013 10:40:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD678A2; Wed, 6 Mar 2013 10:40:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26Aep0L078122; Wed, 6 Mar 2013 10:40:51 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26Aep0t078118; Wed, 6 Mar 2013 10:40:51 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303061040.r26Aep0t078118@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Mar 2013 10:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247882 - in projects/libzfs_core/cddl/contrib/opensolaris/lib: libzfs/common libzfs_core/common X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2013 10:40:52 -0000 Author: mm Date: Wed Mar 6 10:40:50 2013 New Revision: 247882 URL: http://svnweb.freebsd.org/changeset/base/247882 Log: Move libzfs compat functions to libzfs_compat.h This header is used by both libzfs_core and libzfs libraries Added: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h Modified: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Added: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h Wed Mar 6 10:40:50 2013 (r247882) @@ -0,0 +1,94 @@ +/* + * CDDL HEADER SART + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2013 Martin Matuska . All rights reserved. + */ + +#ifndef _LIBZFS_COMPAT_H +#define _LIBZFS_COMPAT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static int zfs_kernel_version = 0; +static int zfs_ioctl_version = 0; + +/* + * This is FreeBSD version of ioctl, because Solaris' ioctl() updates + * zc_nvlist_dst_size even if an error is returned, on FreeBSD if an + * error is returned zc_nvlist_dst_size won't be updated. + */ +static __inline int +zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) +{ + unsigned long cmd; + size_t oldsize, zfs_kernel_version_size, zfs_ioctl_version_size; + int version, ret, cflag = ZFS_CMD_COMPAT_NONE; + + cmd = _IOWR('Z', request, struct zfs_cmd); + + zfs_ioctl_version_size = sizeof(zfs_ioctl_version); + if (zfs_ioctl_version == 0) { + sysctlbyname("vfs.zfs.version.ioctl", &zfs_ioctl_version, + &zfs_ioctl_version_size, NULL, 0); + } + + /* + * If vfs.zfs.version.ioctl is not defined, assume we have v28 + * compatible binaries and use vfs.zfs.version.spa to test for v15 + */ + if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) { + cflag = ZFS_CMD_COMPAT_V28; + zfs_kernel_version_size = sizeof(zfs_kernel_version); + + if (zfs_kernel_version == 0) { + sysctlbyname("vfs.zfs.version.spa", + &zfs_kernel_version, + &zfs_kernel_version_size, NULL, 0); + } + + if (zfs_kernel_version == SPA_VERSION_15 || + zfs_kernel_version == SPA_VERSION_14 || + zfs_kernel_version == SPA_VERSION_13) + cflag = ZFS_CMD_COMPAT_V15; + } + + oldsize = zc->zc_nvlist_dst_size; + ret = zcmd_ioctl_compat(fd, cmd, zc, cflag); + + if (ret == 0 && oldsize < zc->zc_nvlist_dst_size) { + ret = -1; + errno = ENOMEM; + } + + return (ret); +} +#define ioctl(fd, cmd, zc) zcmd_ioctl((fd), (cmd), (zc)) + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBZFS_COMPAT_H */ Modified: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Wed Mar 6 10:23:56 2013 (r247881) +++ projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Wed Mar 6 10:40:50 2013 (r247882) @@ -40,8 +40,7 @@ #include #include #include - -#include "zfs_ioctl_compat.h" +#include #ifdef __cplusplus extern "C" { @@ -215,63 +214,6 @@ extern int zfs_unshare_proto(zfs_handle_ extern void libzfs_fru_clear(libzfs_handle_t *, boolean_t); -#ifndef sun -static int zfs_kernel_version = 0; -static int zfs_ioctl_version = 0; - -/* - * This is FreeBSD version of ioctl, because Solaris' ioctl() updates - * zc_nvlist_dst_size even if an error is returned, on FreeBSD if an - * error is returned zc_nvlist_dst_size won't be updated. - */ -static __inline int -zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) -{ - unsigned long cmd; - size_t oldsize, zfs_kernel_version_size, zfs_ioctl_version_size; - int version, ret, cflag = ZFS_CMD_COMPAT_NONE; - - cmd = _IOWR('Z', request, struct zfs_cmd); - - zfs_ioctl_version_size = sizeof(zfs_ioctl_version); - if (zfs_ioctl_version == 0) { - sysctlbyname("vfs.zfs.version.ioctl", &zfs_ioctl_version, - &zfs_ioctl_version_size, NULL, 0); - } - - /* - * If vfs.zfs.version.ioctl is not defined, assume we have v28 - * compatible binaries and use vfs.zfs.version.spa to test for v15 - */ - if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) { - cflag = ZFS_CMD_COMPAT_V28; - zfs_kernel_version_size = sizeof(zfs_kernel_version); - - if (zfs_kernel_version == 0) { - sysctlbyname("vfs.zfs.version.spa", - &zfs_kernel_version, - &zfs_kernel_version_size, NULL, 0); - } - - if (zfs_kernel_version == SPA_VERSION_15 || - zfs_kernel_version == SPA_VERSION_14 || - zfs_kernel_version == SPA_VERSION_13) - cflag = ZFS_CMD_COMPAT_V15; - } - - oldsize = zc->zc_nvlist_dst_size; - ret = zcmd_ioctl_compat(fd, cmd, zc, cflag); - - if (ret == 0 && oldsize < zc->zc_nvlist_dst_size) { - ret = -1; - errno = ENOMEM; - } - - return (ret); -} -#define ioctl(fd, cmd, zc) zcmd_ioctl((fd), (cmd), (zc)) -#endif /* !sun */ - #ifdef __cplusplus } #endif Modified: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Mar 6 10:23:56 2013 (r247881) +++ projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Mar 6 10:40:50 2013 (r247882) @@ -84,7 +84,7 @@ #include #include #include -#include +#include static int g_fd; static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; Modified: projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Mar 6 10:23:56 2013 (r247881) +++ projects/libzfs_core/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Mar 6 10:40:50 2013 (r247882) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Martin Matuska . All rights reserved. */ #ifndef _LIBZFS_CORE_H From owner-svn-src-projects@FreeBSD.ORG Wed Mar 6 11:33:26 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7DD7817E; Wed, 6 Mar 2013 11:33:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 579EF340; Wed, 6 Mar 2013 11:33:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26BXQ92094198; Wed, 6 Mar 2013 11:33:26 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26BXQMp094197; Wed, 6 Mar 2013 11:33:26 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303061133.r26BXQMp094197@svn.freebsd.org> From: Martin Matuska Date: Wed, 6 Mar 2013 11:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247890 - projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2013 11:33:26 -0000 Author: mm Date: Wed Mar 6 11:33:25 2013 New Revision: 247890 URL: http://svnweb.freebsd.org/changeset/base/247890 Log: Add missing init functions Reduce diff to illumos Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Mar 6 11:11:18 2013 (r247889) +++ projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Mar 6 11:33:25 2013 (r247890) @@ -5796,7 +5796,7 @@ zfsdev_close(void *data) } static int -zfsdev_ioctl(struct cdev *dev, u_long zcmd, caddr_t addr, int flag, +zfsdev_ioctl(struct cdev *dev, u_long zcmd, caddr_t arg, int flag, struct thread *td) { zfs_cmd_t *zc; @@ -5856,18 +5856,14 @@ zfsdev_ioctl(struct cdev *dev, u_long zc zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP); bzero(zc, sizeof(zfs_cmd_t)); -#ifdef illumos error = ddi_copyin((void *)arg, zc, sizeof (zfs_cmd_t), flag); -#else - error = ddi_copyin((void *)addr, zc, sizeof (zfs_cmd_t), flag); -#endif if (error != 0) { error = EFAULT; goto out; } if (cflag != ZFS_CMD_COMPAT_NONE) { - zfs_cmd_compat_get(zc, addr, cflag); + zfs_cmd_compat_get(zc, arg, cflag); zfs_ioctl_compat_pre(zc, &vecnum, cflag); } @@ -5986,7 +5982,7 @@ out: if (cflag != ZFS_CMD_COMPAT_NONE) { zfs_ioctl_compat_post(zc, cmd, cflag); - zfs_cmd_compat_put(zc, addr, cflag); + zfs_cmd_compat_put(zc, arg, cflag); } kmem_free(zc, sizeof (zfs_cmd_t)); @@ -6216,9 +6212,11 @@ zfs_modevent(module_t mod, int type, voi spa_init(FREAD | FWRITE); zfs_init(); zvol_init(); + zfs_ioctl_init(); tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, NULL); + tsd_create(&rrw_tsd_key, rrw_tsd_destroy); + tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); root_mount_rel(zfs_root_token); @@ -6239,6 +6237,7 @@ zfs_modevent(module_t mod, int type, voi tsd_destroy(&zfs_fsyncer_key); tsd_destroy(&rrw_tsd_key); + tsd_destroy(&zfs_allow_log_key); mutex_destroy(&zfs_share_lock); break; From owner-svn-src-projects@FreeBSD.ORG Wed Mar 6 18:35:58 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0FABD6D1; Wed, 6 Mar 2013 18:35:58 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1D10E13; Wed, 6 Mar 2013 18:35:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26IZvJB025389; Wed, 6 Mar 2013 18:35:57 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26IZvni025387; Wed, 6 Mar 2013 18:35:57 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303061835.r26IZvni025387@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 6 Mar 2013 18:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247894 - in projects/bmake: pkgs/pseudo/stage share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2013 18:35:58 -0000 Author: sjg Date: Wed Mar 6 18:35:57 2013 New Revision: 247894 URL: http://svnweb.freebsd.org/changeset/base/247894 Log: Use pkgs/pseudo/stage to run mtree against STAGE_OBJTOP Added: projects/bmake/pkgs/pseudo/stage/ projects/bmake/pkgs/pseudo/stage/Makefile (contents, props changed) Modified: projects/bmake/share/mk/local.dirdeps.mk Added: projects/bmake/pkgs/pseudo/stage/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bmake/pkgs/pseudo/stage/Makefile Wed Mar 6 18:35:57 2013 (r247894) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +# this makefile gets hooked into everyone's dependencies so that +# distrib-dirs can be done in STAGE_OBJTOP +all: + +# mtree makes a lot of noise if we are not root, +# we don't need to see it. +stage-distrib-dirs: .META + mkdir -p ${STAGE_OBJTOP} + ${.MAKE} -C ${SRCTOP}/etc distrib-dirs DESTDIR=${STAGE_OBJTOP} > $@ + +.include + +.if ${.MAKE.LEVEL} > 0 && ${MK_STAGING} == "yes" +all: stage-distrib-dirs +.endif Modified: projects/bmake/share/mk/local.dirdeps.mk ============================================================================== --- projects/bmake/share/mk/local.dirdeps.mk Wed Mar 6 13:48:49 2013 (r247893) +++ projects/bmake/share/mk/local.dirdeps.mk Wed Mar 6 18:35:57 2013 (r247894) @@ -13,3 +13,8 @@ DIRDEPS_FILTER+= \ .if ${MK_SSP:Uno} != "no" && defined(PROG) DIRDEPS += gnu/lib/libssp/libssp_nonshared .endif + +# we need pkgs/pseudo/stage to prep the stage tree +.if ${DEP_RELDIR:U${RELDIR}} != "pkgs/pseudo/stage" +DIRDEPS += pkgs/pseudo/stage +.endif From owner-svn-src-projects@FreeBSD.ORG Wed Mar 6 18:39:41 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A4DD832; Wed, 6 Mar 2013 18:39:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3377DE34; Wed, 6 Mar 2013 18:39:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r26Idflx025900; Wed, 6 Mar 2013 18:39:41 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r26IdfIZ025898; Wed, 6 Mar 2013 18:39:41 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303061839.r26IdfIZ025898@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 6 Mar 2013 18:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247895 - projects/bmake/usr.bin/kdump X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2013 18:39:41 -0000 Author: sjg Date: Wed Mar 6 18:39:40 2013 New Revision: 247895 URL: http://svnweb.freebsd.org/changeset/base/247895 Log: DESTDIR is set already Modified: projects/bmake/usr.bin/kdump/Makefile Modified: projects/bmake/usr.bin/kdump/Makefile ============================================================================== --- projects/bmake/usr.bin/kdump/Makefile Wed Mar 6 18:35:57 2013 (r247894) +++ projects/bmake/usr.bin/kdump/Makefile Wed Mar 6 18:39:40 2013 (r247895) @@ -41,6 +41,5 @@ linux_syscalls.c: .if ${MK_STAGING} != "" # we are interested in the files put in ${STAGE_OBJTOP}/include -DESTDIR= ${STAGE_OBJTOP} INCLUDEDIR= /include .endif From owner-svn-src-projects@FreeBSD.ORG Thu Mar 7 23:45:17 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4D426B1A; Thu, 7 Mar 2013 23:45:17 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3575CB12; Thu, 7 Mar 2013 23:45:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NjHRG058584; Thu, 7 Mar 2013 23:45:17 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NjH3Q058582; Thu, 7 Mar 2013 23:45:17 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303072345.r27NjH3Q058582@svn.freebsd.org> From: Martin Matuska Date: Thu, 7 Mar 2013 23:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247976 - projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:45:17 -0000 Author: mm Date: Thu Mar 7 23:45:16 2013 New Revision: 247976 URL: http://svnweb.freebsd.org/changeset/base/247976 Log: Comment out unfeasible illumos copyin code and restore previous behavior. Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 7 23:44:35 2013 (r247975) +++ projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 7 23:45:16 2013 (r247976) @@ -5853,6 +5853,7 @@ zfsdev_ioctl(struct cdev *dev, u_long zc return (EINVAL); vec = &zfs_ioc_vec[vecnum]; +#ifdef illumos zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP); bzero(zc, sizeof(zfs_cmd_t)); @@ -5861,11 +5862,15 @@ zfsdev_ioctl(struct cdev *dev, u_long zc error = EFAULT; goto out; } +#endif if (cflag != ZFS_CMD_COMPAT_NONE) { + zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP); + bzero(zc, sizeof(zfs_cmd_t)); zfs_cmd_compat_get(zc, arg, cflag); zfs_ioctl_compat_pre(zc, &vecnum, cflag); - } + } else + zc = (void *)arg; zc->zc_iflags = flag & FKIOCTL; if (zc->zc_nvlist_src_size != 0) { @@ -5983,9 +5988,12 @@ out: if (cflag != ZFS_CMD_COMPAT_NONE) { zfs_ioctl_compat_post(zc, cmd, cflag); zfs_cmd_compat_put(zc, arg, cflag); + kmem_free(zc, sizeof (zfs_cmd_t)); } +#ifdef illumos kmem_free(zc, sizeof (zfs_cmd_t)); +#endif return (error); } From owner-svn-src-projects@FreeBSD.ORG Fri Mar 8 00:05:34 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D1831CAF; Fri, 8 Mar 2013 00:05:34 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC003C1F; Fri, 8 Mar 2013 00:05:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2805Y90065393; Fri, 8 Mar 2013 00:05:34 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2805YSf065392; Fri, 8 Mar 2013 00:05:34 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303080005.r2805YSf065392@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 8 Mar 2013 00:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247988 - projects/bmake/share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:05:34 -0000 Author: sjg Date: Fri Mar 8 00:05:34 2013 New Revision: 247988 URL: http://svnweb.freebsd.org/changeset/base/247988 Log: Stage*(): return early if no args, and thow error if cp etc., fails. Modified: projects/bmake/share/mk/meta.stage.mk Modified: projects/bmake/share/mk/meta.stage.mk ============================================================================== --- projects/bmake/share/mk/meta.stage.mk Fri Mar 8 00:05:15 2013 (r247987) +++ projects/bmake/share/mk/meta.stage.mk Fri Mar 8 00:05:34 2013 (r247988) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.18 2013/02/26 05:40:49 sjg Exp $ +# $Id: meta.stage.mk,v 1.20 2013/03/08 00:00:57 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -58,13 +58,13 @@ STAGE_DIRDEP_SCRIPT = StageDirdep() { \ exit 1; \ fi; \ ln .dirdep $$t.dirdep 2> /dev/null || \ - cp .dirdep $$t.dirdep; } + cp .dirdep $$t.dirdep || exit 1; } # common logic for staging files # this all relies on RELDIR being set to a subdir of SRCTOP # we use ln(1) if we can, else cp(1) STAGE_FILE_SCRIPT = ${STAGE_DIRDEP_SCRIPT}; StageFiles() { \ - case "$$1" in -m) mode=$$2; shift 2;; *) mode=;; esac; \ + case "$$1" in "") return;; -m) mode=$$2; shift 2;; *) mode=;; esac; \ dest=$$1; shift; \ mkdir -p $$dest; \ [ -s .dirdep ] || echo '${_dirdep}' > .dirdep; \ @@ -73,12 +73,12 @@ STAGE_FILE_SCRIPT = ${STAGE_DIRDEP_SCRIP StageDirdep $$t; \ rm -f $$t; \ { ln $$f $$t 2> /dev/null || \ - cp -p $$f $$t; }; \ + cp -p $$f $$t; } || exit 1; \ [ -z "$$mode" ] || chmod $$mode $$t; \ done; :; } STAGE_LINKS_SCRIPT = ${STAGE_DIRDEP_SCRIPT}; StageLinks() { \ - case "$$1" in --) shift;; -*) ldest= lnf=$$1; shift;; /*) ldest=$$1/;; esac; \ + case "$$1" in "") return;; --) shift;; -*) ldest= lnf=$$1; shift;; /*) ldest=$$1/;; esac; \ dest=$$1; shift; \ mkdir -p $$dest; \ [ -s .dirdep ] || echo '${_dirdep}' > .dirdep; \ @@ -89,11 +89,11 @@ STAGE_LINKS_SCRIPT = ${STAGE_DIRDEP_SCRI shift; \ StageDirdep $$t; \ rm -f $$t 2>/dev/null; \ - ln $$lnf $$l $$t; \ + ln $$lnf $$l $$t || exit 1; \ done; :; } STAGE_AS_SCRIPT = ${STAGE_DIRDEP_SCRIPT}; StageAs() { \ - case "$$1" in -m) mode=$$2; shift 2;; *) mode=;; esac; \ + case "$$1" in "") return;; -m) mode=$$2; shift 2;; *) mode=;; esac; \ dest=$$1; shift; \ mkdir -p $$dest; \ [ -s .dirdep ] || echo '${_dirdep}' > .dirdep; \ @@ -105,7 +105,7 @@ STAGE_AS_SCRIPT = ${STAGE_DIRDEP_SCRIPT} StageDirdep $$t; \ rm -f $$t; \ { ln $$s $$t 2> /dev/null || \ - cp -p $$s $$t; }; \ + cp -p $$s $$t; } || exit 1; \ [ -z "$$mode" ] || chmod $$mode $$t; \ done; :; } From owner-svn-src-projects@FreeBSD.ORG Fri Mar 8 00:23:22 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72432D85; Fri, 8 Mar 2013 00:23:22 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2D6D4E; Fri, 8 Mar 2013 00:23:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280NM2X071659; Fri, 8 Mar 2013 00:23:22 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280NMgU071658; Fri, 8 Mar 2013 00:23:22 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303080023.r280NMgU071658@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 8 Mar 2013 00:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247997 - projects/bmake/share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:23:22 -0000 Author: sjg Date: Fri Mar 8 00:23:21 2013 New Revision: 247997 URL: http://svnweb.freebsd.org/changeset/base/247997 Log: Ensure natural order of stage_*: matches the .ORDER in meta.stage.mk Modified: projects/bmake/share/mk/bsd.sys.mk Modified: projects/bmake/share/mk/bsd.sys.mk ============================================================================== --- projects/bmake/share/mk/bsd.sys.mk Fri Mar 8 00:20:55 2013 (r247996) +++ projects/bmake/share/mk/bsd.sys.mk Fri Mar 8 00:23:21 2013 (r247997) @@ -180,6 +180,12 @@ stage_libs: ${_LIBS} beforebuild: buildincludes .endif +.for t in stage_libs stage_files stage_as +.if target($t) +all: $t +.endif +.endfor + .if !empty(STAGE_AS_SETS) all: stage_as .endif @@ -188,31 +194,18 @@ all: stage_as .if !empty(LINKS) all: stage_links -.ORDER: stage_files stage_links -.if !empty(STAGE_AS_SETS) -.ORDER: stage_as stage_links -.endif STAGE_SETS+= links STAGE_LINKS.links= ${LINKS} .endif .if !empty(SYMLINKS) all: stage_symlinks -.if !empty(STAGE_AS_SETS) -.ORDER: stage_as stage_symlinks -.endif STAGE_SETS+= links STAGE_SYMLINKS.links= ${SYMLINKS} .endif .endif -.for t in stage_libs stage_files stage_as -.if target($t) -all: $t -.endif -.endfor - .include .endif .endif From owner-svn-src-projects@FreeBSD.ORG Fri Mar 8 00:23:42 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4405EA7; Fri, 8 Mar 2013 00:23:42 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD244D54; Fri, 8 Mar 2013 00:23:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r280NguR071733; Fri, 8 Mar 2013 00:23:42 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r280NgKT071732; Fri, 8 Mar 2013 00:23:42 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303080023.r280NgKT071732@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 8 Mar 2013 00:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r247998 - projects/bmake/share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:23:42 -0000 Author: sjg Date: Fri Mar 8 00:23:42 2013 New Revision: 247998 URL: http://svnweb.freebsd.org/changeset/base/247998 Log: One .ORDER should suffice Modified: projects/bmake/share/mk/meta.stage.mk Modified: projects/bmake/share/mk/meta.stage.mk ============================================================================== --- projects/bmake/share/mk/meta.stage.mk Fri Mar 8 00:23:21 2013 (r247997) +++ projects/bmake/share/mk/meta.stage.mk Fri Mar 8 00:23:42 2013 (r247998) @@ -208,4 +208,7 @@ stage_as.$s: .dirdep .endfor .endif +# if we have to do any of these, do them in this order +.ORDER: stage_incs stage_libs stage_files stage_as stage_links stage_symlinks + .endif From owner-svn-src-projects@FreeBSD.ORG Fri Mar 8 01:51:33 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 226C52A9; Fri, 8 Mar 2013 01:51:33 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D76F197; Fri, 8 Mar 2013 01:51:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r281pWFF000325; Fri, 8 Mar 2013 01:51:32 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r281pWou000323; Fri, 8 Mar 2013 01:51:32 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303080151.r281pWou000323@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 8 Mar 2013 01:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r248025 - projects/bmake/share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 01:51:33 -0000 Author: sjg Date: Fri Mar 8 01:51:32 2013 New Revision: 248025 URL: http://svnweb.freebsd.org/changeset/base/248025 Log: Control default .MAKE.DEPENDFILE indepentend of .MAKE.DEPENDFILE_PREFERENCE Modified: projects/bmake/share/mk/local.sys.mk projects/bmake/share/mk/sys.dependfile.mk Modified: projects/bmake/share/mk/local.sys.mk ============================================================================== --- projects/bmake/share/mk/local.sys.mk Fri Mar 8 01:33:07 2013 (r248024) +++ projects/bmake/share/mk/local.sys.mk Fri Mar 8 01:51:32 2013 (r248025) @@ -168,11 +168,15 @@ STAGED_INCLUDE_DIR= ${STAGE_OBJTOP}/incl .include "meta.sys.mk" .endif -# most dirs can be satisfied with one Makefile.depend -.undef .MAKE.DEPENDFILE +# this is sufficient for most of the tree. +.MAKE.DEPENDFILE_DEFAULT = ${.MAKE.DEPENDFILE_PREFIX} + +# but if we have a machine qualified file it should be used in preference .MAKE.DEPENDFILE_PREFERENCE = \ - ${.MAKE.DEPENDFILE_PREFIX} \ - ${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} + ${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \ + ${.MAKE.DEPENDFILE_PREFIX} + +.undef .MAKE.DEPENDFILE .include "sys.dependfile.mk" Modified: projects/bmake/share/mk/sys.dependfile.mk ============================================================================== --- projects/bmake/share/mk/sys.dependfile.mk Fri Mar 8 01:33:07 2013 (r248024) +++ projects/bmake/share/mk/sys.dependfile.mk Fri Mar 8 01:51:32 2013 (r248025) @@ -1,4 +1,4 @@ -# $Id: sys.dependfile.mk,v 1.3 2012/04/25 15:45:04 sjg Exp $ +# $Id: sys.dependfile.mk,v 1.5 2013/03/08 00:59:21 sjg Exp $ # # @(#) Copyright (c) 2012, Simon J. Gerraty # @@ -25,16 +25,20 @@ # All depend file names should start with this .MAKE.DEPENDFILE_PREFIX ?= Makefile.depend -# The order of preference: we will use the first one of these we find -# otherwise the 1st entry will be used by default. +# The order of preference: we will use the first one of these we find. +# It usually makes sense to order from most specific to least. .MAKE.DEPENDFILE_PREFERENCE ?= \ ${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \ ${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX} +# Normally the 1st entry is our default choice +# Another useful default is ${.MAKE.DEPENDFILE_PREFIX} +.MAKE.DEPENDFILE_DEFAULT ?= ${.MAKE.DEPENDFILE_PREFERENCE:[1]} + _e := ${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@} .if !empty(_e) .MAKE.DEPENDFILE := ${_e:[1]} -.elif ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}} != "" && ${.MAKE.DEPENDFILE_PREFERENCE:[1]:E} != ${MACHINE} +.elif ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}} != "" && ${.MAKE.DEPENDFILE_DEFAULT:E} != ${MACHINE} # MACHINE specific depend files are supported, but *not* default. # If any already exist, we should follow suit. _aml = ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MACHINE} @@ -44,4 +48,4 @@ _e := ${_aml:@MACHINE@${.MAKE.DEPENDFILE .MAKE.DEPENDFILE ?= ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}:[1]} .endif .endif -.MAKE.DEPENDFILE ?= ${.MAKE.DEPENDFILE_PREFERENCE:[1]} +.MAKE.DEPENDFILE ?= ${.MAKE.DEPENDFILE_DEFAULT} From owner-svn-src-projects@FreeBSD.ORG Fri Mar 8 15:01:41 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C047703; Fri, 8 Mar 2013 15:01:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7DA938F3; Fri, 8 Mar 2013 15:01:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28F1fKr050938; Fri, 8 Mar 2013 15:01:41 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28F1fK3050936; Fri, 8 Mar 2013 15:01:41 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303081501.r28F1fK3050936@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 8 Mar 2013 15:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r248056 - projects/portbuild/scripts X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 15:01:41 -0000 Author: bapt Date: Fri Mar 8 15:01:40 2013 New Revision: 248056 URL: http://svnweb.freebsd.org/changeset/base/248056 Log: determine if the build will be a pkgng build or a pkg_install build base on bsd.port.mk, not on /etc/make.conf, this allows build to autodetermine that on current the default is pkgng Tested by: erwin Modified: projects/portbuild/scripts/buildscript projects/portbuild/scripts/portbuild Modified: projects/portbuild/scripts/buildscript ============================================================================== --- projects/portbuild/scripts/buildscript Fri Mar 8 13:11:45 2013 (r248055) +++ projects/portbuild/scripts/buildscript Fri Mar 8 15:01:40 2013 (r248056) @@ -180,7 +180,7 @@ pkg_sufx=${PKG_SUFX} # Use pkgng if available. #if [ -x /usr/sbin/pkg ]; then use_pkgng="no" -grep "^WITH_PKGNG[ ]*=" /etc/make.conf | sed -e "s/.*=//;s/ //" | grep -q "[Yy][Ee][Ss]$" && use_pkgng="yes" +make -f /usr/ports/Mk/bsd.port.mk -V WITH_PKGNG | grep -q "[Yy][Ee][Ss]$" && use_pkgng="yes" # Keep restricted distfiles in a subdirectory for extra protection # against leakage Modified: projects/portbuild/scripts/portbuild ============================================================================== --- projects/portbuild/scripts/portbuild Fri Mar 8 13:11:45 2013 (r248055) +++ projects/portbuild/scripts/portbuild Fri Mar 8 15:01:40 2013 (r248056) @@ -260,7 +260,12 @@ mount_fs ${builddir}/src ${chroot}${CLIE # set overrides for uname buildenv.client ${arch} ${chroot}${CLIENT_SRCBASE} -mount -t devfs foo ${chroot}/dev +devfspath="null zero random urandom stdin stdout stderr fd fd/*" +mount -t devfs devfs ${chroot}/dev +devfs -m ${chroot}/dev rule apply hide +for p in ${devfspath} ; do + devfs -m ${chroot}/dev/ rule apply path "${p}" unhide +done mount -t fdescfs fdesc ${chroot}/dev/fd umount -f ${chroot}/compat/linux/proc > /dev/null 2>&1 From owner-svn-src-projects@FreeBSD.ORG Fri Mar 8 22:02:10 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 28EA896C; Fri, 8 Mar 2013 22:02:10 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 029D5CE2; Fri, 8 Mar 2013 22:02:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28M29pf084342; Fri, 8 Mar 2013 22:02:09 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28M29XK084335; Fri, 8 Mar 2013 22:02:09 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303082202.r28M29XK084335@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 8 Mar 2013 22:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r248076 - projects/bmake/share/mk X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 22:02:10 -0000 Author: sjg Date: Fri Mar 8 22:02:08 2013 New Revision: 248076 URL: http://svnweb.freebsd.org/changeset/base/248076 Log: Allow staging to be help up (by .WAIT) until other bits of all: are done. Modified: projects/bmake/share/mk/bsd.incs.mk projects/bmake/share/mk/bsd.lib.mk projects/bmake/share/mk/bsd.nls.mk projects/bmake/share/mk/bsd.sys.mk projects/bmake/share/mk/meta.stage.mk Modified: projects/bmake/share/mk/bsd.incs.mk ============================================================================== --- projects/bmake/share/mk/bsd.incs.mk Fri Mar 8 21:44:42 2013 (r248075) +++ projects/bmake/share/mk/bsd.incs.mk Fri Mar 8 22:02:08 2013 (r248076) @@ -99,7 +99,7 @@ buildincludes: stage_as .endif .endif .if !empty(INCSLINKS) -stage_files: stage_symlinks +staging: stage_symlinks STAGE_SYMLINKS.INCS= ${INCSLINKS} .endif .endif Modified: projects/bmake/share/mk/bsd.lib.mk ============================================================================== --- projects/bmake/share/mk/bsd.lib.mk Fri Mar 8 21:44:42 2013 (r248075) +++ projects/bmake/share/mk/bsd.lib.mk Fri Mar 8 22:02:08 2013 (r248076) @@ -114,10 +114,6 @@ PO_FLAG=-pg .if !defined(_SKIP_BUILD) all: beforebuild .WAIT beforebuild: objwarn -.if !defined(.PARSEDIR) -# this is a no-op -.WAIT: -.endif .endif .include Modified: projects/bmake/share/mk/bsd.nls.mk ============================================================================== --- projects/bmake/share/mk/bsd.nls.mk Fri Mar 8 21:44:42 2013 (r248075) +++ projects/bmake/share/mk/bsd.nls.mk Fri Mar 8 22:02:08 2013 (r248076) @@ -63,7 +63,7 @@ NLSDIR?= ${SHAREDIR}/nls # .if ${MK_STAGING_PROG} == "yes" .if !defined(_SKIP_BUILD) -all: stage_symlinks +staging: stage_symlinks .endif STAGE_SYMLINKS.NLS= ${NLSSYMLINKS} STAGE_SYMLINKS_DIR.NLS= ${STAGE_OBJTOP} Modified: projects/bmake/share/mk/bsd.sys.mk ============================================================================== --- projects/bmake/share/mk/bsd.sys.mk Fri Mar 8 21:44:42 2013 (r248075) +++ projects/bmake/share/mk/bsd.sys.mk Fri Mar 8 22:02:08 2013 (r248076) @@ -142,16 +142,21 @@ PHONY_NOTMAIN = afterdepend afterinstall .PHONY: ${PHONY_NOTMAIN} .NOTMAIN: ${PHONY_NOTMAIN} +.if !defined(.PARSEDIR) +# this is a no-op +.WAIT: +.endif + .if ${MK_STAGING} != "no" .if defined(_SKIP_BUILD) || !make(all) -stage_libs stage_files stage_as stage_links stage_symlinks: +staging stage_libs stage_files stage_as stage_links stage_symlinks: .else # allow targets like beforeinstall to be leveraged DESTDIR= ${STAGE_OBJTOP} -.if target(beforeinstall) +.if commands(beforeinstall) .if !empty(_LIBS) || ${MK_STAGING_PROG} != "no" -stage_files: beforeinstall +staging: beforeinstall .endif .endif @@ -167,7 +172,7 @@ stage_as.prog: ${PROG} .else STAGE_SETS+= prog stage_files.prog: ${PROG} -all: stage_files +staging: stage_files .endif .endif .endif @@ -182,24 +187,24 @@ beforebuild: buildincludes .for t in stage_libs stage_files stage_as .if target($t) -all: $t +staging: $t .endif .endfor .if !empty(STAGE_AS_SETS) -all: stage_as +staging: stage_as .endif .if !empty(_LIBS) || ${MK_STAGING_PROG} != "no" .if !empty(LINKS) -all: stage_links +staging: stage_links STAGE_SETS+= links STAGE_LINKS.links= ${LINKS} .endif .if !empty(SYMLINKS) -all: stage_symlinks +staging: stage_symlinks STAGE_SETS+= links STAGE_SYMLINKS.links= ${SYMLINKS} .endif Modified: projects/bmake/share/mk/meta.stage.mk ============================================================================== --- projects/bmake/share/mk/meta.stage.mk Fri Mar 8 21:44:42 2013 (r248075) +++ projects/bmake/share/mk/meta.stage.mk Fri Mar 8 22:02:08 2013 (r248076) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.20 2013/03/08 00:00:57 sjg Exp $ +# $Id: meta.stage.mk,v 1.22 2013/03/08 17:52:11 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -114,8 +114,7 @@ _STAGE_BASENAME_USE: .USE ${.TARGET:T} @${STAGE_FILE_SCRIPT}; StageFiles ${.TARGET:H:${STAGE_DIR_FILTER}} ${.TARGET:T} .if !empty(STAGE_INCSDIR) -CLEANFILES += stage_incs - +STAGE_TARGETS += stage_incs STAGE_INCS ?= ${.ALLSRC:N.dirdep} stage_incs: .dirdep @@ -124,7 +123,7 @@ stage_incs: .dirdep .endif .if !empty(STAGE_LIBDIR) -CLEANFILES += stage_libs +STAGE_TARGETS += stage_libs STAGE_LIBS ?= ${.ALLSRC:N.dirdep} @@ -161,6 +160,7 @@ STAGE_SYMLINKS.$s ?= ${.ALLSRC:N.dirdep} STAGE_LINKS_DIR.$s ?= ${STAGE_OBJTOP} STAGE_SYMLINKS_DIR.$s ?= ${STAGE_OBJTOP} +STAGE_TARGETS += stage_files .if $s != "_default" stage_files: stage_files.$s stage_files.$s: .dirdep @@ -170,6 +170,7 @@ stage_files: .dirdep @${STAGE_FILE_SCRIPT}; StageFiles ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_FILES.$s} @touch $@ +STAGE_TARGETS += stage_links .if $s != "_default" stage_links: stage_links.$s stage_links.$s: .dirdep @@ -179,6 +180,7 @@ stage_links: .dirdep @${STAGE_LINKS_SCRIPT}; StageLinks ${STAGE_LINKS_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_LINKS.$s} @touch $@ +STAGE_TARGETS += stage_symlinks .if $s != "_default" stage_symlinks: stage_symlinks.$s stage_symlinks.$s: .dirdep @@ -194,6 +196,8 @@ stage_symlinks: .dirdep .if !empty(STAGE_AS_SETS) CLEANFILES += ${STAGE_AS_SETS:@s@stage*$s@} +STAGE_TARGETS += stage_as + # sometimes things need to be renamed as they are staged # each ${file} will be staged as ${STAGE_AS_${file:T}} # one could achieve the same with SYMLINKS @@ -208,7 +212,20 @@ stage_as.$s: .dirdep .endfor .endif -# if we have to do any of these, do them in this order -.ORDER: stage_incs stage_libs stage_files stage_as stage_links stage_symlinks +CLEANFILES += ${STAGE_TARGETS} + +# stage_*links usually needs to follow any others. +.for t in ${STAGE_TARGETS:N*links:O:u} +.ORDER: $t stage_links +.ORDER: $t stage_symlinks +.endfor + +# make sure this exists +staging: + +# generally we want staging to wait until everything else is done +STAGING_WAIT ?= .WAIT + +all: ${STAGING_WAIT} staging .endif From owner-svn-src-projects@FreeBSD.ORG Fri Mar 8 22:15:01 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6AF85C7F; Fri, 8 Mar 2013 22:15:01 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC1AD32; Fri, 8 Mar 2013 22:15:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28MF0g1088116; Fri, 8 Mar 2013 22:15:00 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28MF0LB088114; Fri, 8 Mar 2013 22:15:00 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201303082215.r28MF0LB088114@svn.freebsd.org> From: "Simon J. Gerraty" Date: Fri, 8 Mar 2013 22:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r248077 - projects/bmake/pkgs X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 22:15:01 -0000 Author: sjg Date: Fri Mar 8 22:15:00 2013 New Revision: 248077 URL: http://svnweb.freebsd.org/changeset/base/248077 Log: Always report elapsed time Modified: projects/bmake/pkgs/Makefile Modified: projects/bmake/pkgs/Makefile ============================================================================== --- projects/bmake/pkgs/Makefile Fri Mar 8 22:02:08 2013 (r248076) +++ projects/bmake/pkgs/Makefile Fri Mar 8 22:15:00 2013 (r248077) @@ -131,16 +131,18 @@ dirdeps: ${_begin} .WAIT $t: dirdeps .endfor +elapsed_time= seconds=`expr ${now_utc} - ${start_utc}` + count-makefiles: .NOMETA - @echo "${TIME_STAMP} Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} seconds=`expr ${now_utc} - ${start_utc}`" + @echo "${TIME_STAMP} Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} ${elapsed_time}" .END: _build_finish _build_finish: .NOMETA - @echo "${TIME_STAMP} Finished ${.TARGETS}" + @echo "${TIME_STAMP} Finished ${.TARGETS} ${elapsed_time}" .ERROR: _build_failed _build_failed: .NOMETA - @echo "${TIME_STAMP} Failed ${.TARGETS}" + @echo "${TIME_STAMP} Failed ${.TARGETS} ${elapsed_time}" .endif # !empty(DIRDEPS) From owner-svn-src-projects@FreeBSD.ORG Sat Mar 9 11:57:57 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30AA198C; Sat, 9 Mar 2013 11:57:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03AFCBD6; Sat, 9 Mar 2013 11:57:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29BvuYe038519; Sat, 9 Mar 2013 11:57:56 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29Bvpfj038487; Sat, 9 Mar 2013 11:57:51 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303091157.r29Bvpfj038487@svn.freebsd.org> From: Martin Matuska Date: Sat, 9 Mar 2013 11:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r248094 - in projects/libzfs_core: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/tools/ctf/cvt contrib/libyaml contrib/openpam/doc/man contrib/openpam/lib crypto/openssh e... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 11:57:57 -0000 Author: mm Date: Sat Mar 9 11:57:51 2013 New Revision: 248094 URL: http://svnweb.freebsd.org/changeset/base/248094 Log: MFC @248093 Added: projects/libzfs_core/contrib/libyaml/ - copied from r248093, head/contrib/libyaml/ projects/libzfs_core/lib/libyaml/ - copied from r248093, head/lib/libyaml/ projects/libzfs_core/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c - copied unchanged from r248093, head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c projects/libzfs_core/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h - copied unchanged from r248093, head/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h projects/libzfs_core/sys/cddl/compat/opensolaris/sys/vm.h - copied unchanged from r248093, head/sys/cddl/compat/opensolaris/sys/vm.h projects/libzfs_core/sys/dev/drm2/drm_global.c - copied unchanged from r248093, head/sys/dev/drm2/drm_global.c projects/libzfs_core/sys/dev/drm2/drm_global.h - copied unchanged from r248093, head/sys/dev/drm2/drm_global.h projects/libzfs_core/sys/dev/drm2/ttm/ - copied from r248093, head/sys/dev/drm2/ttm/ projects/libzfs_core/usr.bin/truss/arm-fbsd.c - copied unchanged from r248093, head/usr.bin/truss/arm-fbsd.c projects/libzfs_core/usr.sbin/pkg/config.c - copied unchanged from r248093, head/usr.sbin/pkg/config.c projects/libzfs_core/usr.sbin/pkg/config.h - copied unchanged from r248093, head/usr.sbin/pkg/config.h Deleted: projects/libzfs_core/sbin/mount_ext2fs/ projects/libzfs_core/sbin/mount_reiserfs/ projects/libzfs_core/sbin/mount_std/ Modified: projects/libzfs_core/UPDATING projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c projects/libzfs_core/cddl/contrib/opensolaris/tools/ctf/cvt/output.c projects/libzfs_core/contrib/openpam/doc/man/openpam_straddch.3 projects/libzfs_core/contrib/openpam/lib/openpam_readline.c projects/libzfs_core/contrib/openpam/lib/openpam_readword.c projects/libzfs_core/crypto/openssh/FREEBSD-upgrade projects/libzfs_core/crypto/openssh/config.h projects/libzfs_core/etc/portsnap.conf projects/libzfs_core/lib/Makefile projects/libzfs_core/lib/libc/string/Makefile.inc projects/libzfs_core/lib/libstand/Makefile projects/libzfs_core/lib/libutil/gr_util.c projects/libzfs_core/lib/libutil/libutil.h projects/libzfs_core/sbin/geom/class/raid/graid.8 projects/libzfs_core/sbin/ipfw/ipfw2.c projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.8 projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.c projects/libzfs_core/sbin/mount_msdosfs/mount_msdosfs.c projects/libzfs_core/sbin/mount_nfs/mount_nfs.c projects/libzfs_core/sbin/mount_nullfs/mount_nullfs.c projects/libzfs_core/sbin/mount_udf/Makefile projects/libzfs_core/sbin/mount_udf/mount_udf.c projects/libzfs_core/sbin/mount_unionfs/mount_unionfs.c projects/libzfs_core/share/man/man4/eventtimers.4 projects/libzfs_core/share/man/man4/zyd.4 projects/libzfs_core/share/man/man7/development.7 projects/libzfs_core/share/man/man7/ports.7 projects/libzfs_core/share/man/man9/Makefile projects/libzfs_core/share/man/man9/condvar.9 projects/libzfs_core/share/man/man9/sleep.9 projects/libzfs_core/share/man/man9/sleepqueue.9 projects/libzfs_core/share/man/man9/timeout.9 projects/libzfs_core/share/mk/bsd.libnames.mk projects/libzfs_core/sys/amd64/amd64/machdep.c projects/libzfs_core/sys/amd64/amd64/pmap.c projects/libzfs_core/sys/amd64/conf/GENERIC projects/libzfs_core/sys/amd64/conf/NOTES projects/libzfs_core/sys/arm/arm/busdma_machdep-v6.c projects/libzfs_core/sys/arm/arm/cpufunc_asm_arm11x6.S projects/libzfs_core/sys/arm/arm/machdep.c projects/libzfs_core/sys/arm/arm/pmap-v6.c projects/libzfs_core/sys/arm/arm/pmap.c projects/libzfs_core/sys/arm/arm/swtch.S projects/libzfs_core/sys/arm/arm/vm_machdep.c projects/libzfs_core/sys/arm/broadcom/bcm2835/bcm2835_dma.c projects/libzfs_core/sys/arm/include/frame.h projects/libzfs_core/sys/cam/ctl/ctl.c projects/libzfs_core/sys/cddl/compat/opensolaris/sys/vnode.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/libzfs_core/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c projects/libzfs_core/sys/compat/linprocfs/linprocfs.c projects/libzfs_core/sys/conf/NOTES projects/libzfs_core/sys/conf/files projects/libzfs_core/sys/conf/files.amd64 projects/libzfs_core/sys/conf/files.i386 projects/libzfs_core/sys/conf/options projects/libzfs_core/sys/contrib/altq/altq/altq_hfsc.c projects/libzfs_core/sys/contrib/altq/altq/altq_hfsc.h projects/libzfs_core/sys/dev/agp/agp.c projects/libzfs_core/sys/dev/agp/agp_i810.c projects/libzfs_core/sys/dev/ath/if_ath.c projects/libzfs_core/sys/dev/ath/if_ath_tx.c projects/libzfs_core/sys/dev/drm/drmP.h projects/libzfs_core/sys/dev/drm2/drmP.h projects/libzfs_core/sys/dev/drm2/drm_drv.c projects/libzfs_core/sys/dev/drm2/drm_fb_helper.c projects/libzfs_core/sys/dev/drm2/drm_gem.c projects/libzfs_core/sys/dev/drm2/drm_mm.c projects/libzfs_core/sys/dev/drm2/drm_mm.h projects/libzfs_core/sys/dev/drm2/i915/i915_gem.c projects/libzfs_core/sys/dev/hwpmc/hwpmc_mod.c projects/libzfs_core/sys/dev/hwpmc/hwpmc_soft.c projects/libzfs_core/sys/dev/ixgbe/LICENSE projects/libzfs_core/sys/dev/ixgbe/ixgbe.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_82598.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_82599.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_82599.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_api.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_api.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_common.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_common.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_mbx.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_osdep.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_phy.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_phy.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_type.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_vf.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_vf.h projects/libzfs_core/sys/dev/ixgbe/ixgbe_x540.c projects/libzfs_core/sys/dev/ixgbe/ixgbe_x540.h projects/libzfs_core/sys/dev/ixgbe/ixv.c projects/libzfs_core/sys/dev/md/md.c projects/libzfs_core/sys/dev/netmap/netmap.c projects/libzfs_core/sys/dev/nvme/nvme.c projects/libzfs_core/sys/dev/nvme/nvme_ctrlr.c projects/libzfs_core/sys/dev/oce/oce_hw.c projects/libzfs_core/sys/dev/oce/oce_hw.h projects/libzfs_core/sys/dev/oce/oce_if.c projects/libzfs_core/sys/dev/oce/oce_if.h projects/libzfs_core/sys/dev/oce/oce_mbox.c projects/libzfs_core/sys/dev/oce/oce_queue.c projects/libzfs_core/sys/dev/oce/oce_sysctl.c projects/libzfs_core/sys/dev/oce/oce_util.c projects/libzfs_core/sys/dev/random/randomdev_soft.c projects/libzfs_core/sys/dev/sound/pci/hda/hdaa_patches.c projects/libzfs_core/sys/dev/sound/pci/hda/hdac.h projects/libzfs_core/sys/dev/sound/pci/hda/hdacc.c projects/libzfs_core/sys/dev/sound/pcm/dsp.c projects/libzfs_core/sys/dev/syscons/syscons.c projects/libzfs_core/sys/dev/syscons/syscons.h projects/libzfs_core/sys/dev/virtio/block/virtio_blk.c projects/libzfs_core/sys/fs/fuse/fuse_io.c projects/libzfs_core/sys/fs/fuse/fuse_vnops.c projects/libzfs_core/sys/fs/nfsclient/nfs_clbio.c projects/libzfs_core/sys/fs/nfsclient/nfs_clnode.c projects/libzfs_core/sys/fs/nfsclient/nfs_clvnops.c projects/libzfs_core/sys/fs/nfsserver/nfs_nfsdport.c projects/libzfs_core/sys/fs/procfs/procfs_map.c projects/libzfs_core/sys/fs/tmpfs/tmpfs_subr.c projects/libzfs_core/sys/fs/tmpfs/tmpfs_vnops.c projects/libzfs_core/sys/geom/label/g_label_ntfs.c projects/libzfs_core/sys/geom/part/g_part.c projects/libzfs_core/sys/geom/part/g_part.h projects/libzfs_core/sys/geom/part/g_part_mbr.c projects/libzfs_core/sys/geom/raid/g_raid.c projects/libzfs_core/sys/geom/raid/md_ddf.c projects/libzfs_core/sys/i386/conf/GENERIC projects/libzfs_core/sys/i386/conf/NOTES projects/libzfs_core/sys/i386/i386/machdep.c projects/libzfs_core/sys/i386/i386/pmap.c projects/libzfs_core/sys/i386/xen/pmap.c projects/libzfs_core/sys/ia64/ia64/machdep.c projects/libzfs_core/sys/ia64/ia64/pmap.c projects/libzfs_core/sys/kern/imgact_elf.c projects/libzfs_core/sys/kern/kern_clock.c projects/libzfs_core/sys/kern/kern_clocksource.c projects/libzfs_core/sys/kern/kern_condvar.c projects/libzfs_core/sys/kern/kern_event.c projects/libzfs_core/sys/kern/kern_exec.c projects/libzfs_core/sys/kern/kern_intr.c projects/libzfs_core/sys/kern/kern_proc.c projects/libzfs_core/sys/kern/kern_resource.c projects/libzfs_core/sys/kern/kern_sharedpage.c projects/libzfs_core/sys/kern/kern_shutdown.c projects/libzfs_core/sys/kern/kern_synch.c projects/libzfs_core/sys/kern/kern_tc.c projects/libzfs_core/sys/kern/kern_time.c projects/libzfs_core/sys/kern/kern_timeout.c projects/libzfs_core/sys/kern/subr_log.c projects/libzfs_core/sys/kern/subr_param.c projects/libzfs_core/sys/kern/subr_sleepqueue.c projects/libzfs_core/sys/kern/subr_uio.c projects/libzfs_core/sys/kern/subr_witness.c projects/libzfs_core/sys/kern/sys_generic.c projects/libzfs_core/sys/kern/sys_process.c projects/libzfs_core/sys/kern/sysv_shm.c projects/libzfs_core/sys/kern/uipc_shm.c projects/libzfs_core/sys/kern/uipc_syscalls.c projects/libzfs_core/sys/kern/vfs_aio.c projects/libzfs_core/sys/kern/vfs_bio.c projects/libzfs_core/sys/kern/vfs_cluster.c projects/libzfs_core/sys/kern/vfs_default.c projects/libzfs_core/sys/kern/vfs_subr.c projects/libzfs_core/sys/kern/vfs_syscalls.c projects/libzfs_core/sys/kern/vfs_vnops.c projects/libzfs_core/sys/mips/mips/machdep.c projects/libzfs_core/sys/mips/mips/pmap.c projects/libzfs_core/sys/modules/ath/Makefile projects/libzfs_core/sys/modules/drm2/drm2/Makefile projects/libzfs_core/sys/modules/uart/Makefile projects/libzfs_core/sys/modules/zfs/Makefile projects/libzfs_core/sys/net/if.c projects/libzfs_core/sys/net/route.c projects/libzfs_core/sys/net/route.h projects/libzfs_core/sys/net80211/ieee80211.c projects/libzfs_core/sys/net80211/ieee80211_freebsd.c projects/libzfs_core/sys/net80211/ieee80211_freebsd.h projects/libzfs_core/sys/net80211/ieee80211_hostap.c projects/libzfs_core/sys/net80211/ieee80211_ht.c projects/libzfs_core/sys/net80211/ieee80211_hwmp.c projects/libzfs_core/sys/net80211/ieee80211_mesh.c projects/libzfs_core/sys/net80211/ieee80211_output.c projects/libzfs_core/sys/net80211/ieee80211_power.c projects/libzfs_core/sys/net80211/ieee80211_proto.h projects/libzfs_core/sys/net80211/ieee80211_superg.c projects/libzfs_core/sys/net80211/ieee80211_var.h projects/libzfs_core/sys/net80211/ieee80211_wds.c projects/libzfs_core/sys/netinet/siftr.c projects/libzfs_core/sys/netinet/tcp_timer.c projects/libzfs_core/sys/nfsclient/nfs_bio.c projects/libzfs_core/sys/nfsclient/nfs_vnops.c projects/libzfs_core/sys/nfsserver/nfs_serv.c projects/libzfs_core/sys/ofed/drivers/infiniband/core/umem.c projects/libzfs_core/sys/ofed/include/linux/linux_compat.c projects/libzfs_core/sys/pc98/pc98/machdep.c projects/libzfs_core/sys/powerpc/aim/machdep.c projects/libzfs_core/sys/powerpc/aim/mmu_oea.c projects/libzfs_core/sys/powerpc/aim/mmu_oea64.c projects/libzfs_core/sys/powerpc/booke/machdep.c projects/libzfs_core/sys/powerpc/booke/pmap.c projects/libzfs_core/sys/security/mac/mac_process.c projects/libzfs_core/sys/sparc64/conf/GENERIC projects/libzfs_core/sys/sparc64/pci/psycho.c projects/libzfs_core/sys/sparc64/sparc64/machdep.c projects/libzfs_core/sys/sparc64/sparc64/pmap.c projects/libzfs_core/sys/sys/_callout.h projects/libzfs_core/sys/sys/callout.h projects/libzfs_core/sys/sys/condvar.h projects/libzfs_core/sys/sys/diskmbr.h projects/libzfs_core/sys/sys/mutex.h projects/libzfs_core/sys/sys/param.h projects/libzfs_core/sys/sys/pmckern.h projects/libzfs_core/sys/sys/rwlock.h projects/libzfs_core/sys/sys/sleepqueue.h projects/libzfs_core/sys/sys/sx.h projects/libzfs_core/sys/sys/systm.h projects/libzfs_core/sys/sys/time.h projects/libzfs_core/sys/ufs/ffs/ffs_rawread.c projects/libzfs_core/sys/ufs/ffs/ffs_vnops.c projects/libzfs_core/sys/vm/default_pager.c projects/libzfs_core/sys/vm/device_pager.c projects/libzfs_core/sys/vm/phys_pager.c projects/libzfs_core/sys/vm/sg_pager.c projects/libzfs_core/sys/vm/swap_pager.c projects/libzfs_core/sys/vm/uma_core.c projects/libzfs_core/sys/vm/vm_fault.c projects/libzfs_core/sys/vm/vm_glue.c projects/libzfs_core/sys/vm/vm_init.c projects/libzfs_core/sys/vm/vm_kern.c projects/libzfs_core/sys/vm/vm_map.c projects/libzfs_core/sys/vm/vm_meter.c projects/libzfs_core/sys/vm/vm_mmap.c projects/libzfs_core/sys/vm/vm_object.c projects/libzfs_core/sys/vm/vm_object.h projects/libzfs_core/sys/vm/vm_page.c projects/libzfs_core/sys/vm/vm_pageout.c projects/libzfs_core/sys/vm/vm_pager.c projects/libzfs_core/sys/vm/vm_pager.h projects/libzfs_core/sys/vm/vm_reserv.c projects/libzfs_core/sys/vm/vnode_pager.c projects/libzfs_core/tools/make_libdeps.sh projects/libzfs_core/tools/tools/cxgbetool/cxgbetool.c projects/libzfs_core/usr.bin/Makefile.arm projects/libzfs_core/usr.bin/c89/c89.c projects/libzfs_core/usr.bin/c99/c99.c projects/libzfs_core/usr.bin/truss/extern.h projects/libzfs_core/usr.bin/truss/main.c projects/libzfs_core/usr.sbin/bhyve/acpi.c projects/libzfs_core/usr.sbin/bhyve/pci_virtio_block.c projects/libzfs_core/usr.sbin/bhyve/pci_virtio_net.c projects/libzfs_core/usr.sbin/pkg/Makefile projects/libzfs_core/usr.sbin/pkg/pkg.c projects/libzfs_core/usr.sbin/rtadvd/rtadvd.c projects/libzfs_core/usr.sbin/tzsetup/tzsetup.c Directory Properties: projects/libzfs_core/ (props changed) projects/libzfs_core/cddl/contrib/opensolaris/ (props changed) projects/libzfs_core/contrib/openpam/ (props changed) projects/libzfs_core/crypto/openssh/ (props changed) projects/libzfs_core/lib/libc/ (props changed) projects/libzfs_core/lib/libutil/ (props changed) projects/libzfs_core/sbin/ (props changed) projects/libzfs_core/sbin/ipfw/ (props changed) projects/libzfs_core/share/man/man4/ (props changed) projects/libzfs_core/sys/ (props changed) projects/libzfs_core/sys/cddl/contrib/opensolaris/ (props changed) projects/libzfs_core/sys/conf/ (props changed) projects/libzfs_core/usr.sbin/bhyve/ (props changed) projects/libzfs_core/usr.sbin/rtadvd/ (props changed) Modified: projects/libzfs_core/UPDATING ============================================================================== --- projects/libzfs_core/UPDATING Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/UPDATING Sat Mar 9 11:57:51 2013 (r248094) @@ -26,6 +26,23 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130308: + CTL_DISABLE has also been added to the sparc64 GENERIC (for further + information, see the respective 20130304 entry). + +20130304: + Recent commits to callout(9) changed the size of struct callout, + so the KBI is probably heavily disturbed. Also, some functions + in callout(9)/sleep(9)/sleepqueue(9)/condvar(9) KPIs were replaced + by macros. Every kernel module using it won't load, so rebuild + is requested. + + The ctl device has been re-enabled in GENERIC for i386 and amd64, + but does not initialize by default (because of the new CTL_DISABLE + option) to save memory. To re-enable it, remove the CTL_DISABLE + option from the kernel config file or set kern.cam.ctl.disable=0 + in /boot/loader.conf. + 20130301: The ctl device has been disabled in GENERIC for i386 and amd64. This was done due to the extra memory being allocated at system Modified: projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Mar 9 11:57:51 2013 (r248094) @@ -1220,7 +1220,7 @@ dump_bpobj_cb(void *arg, const blkptr_t } static void -dump_bpobj(bpobj_t *bpo, char *name) +dump_bpobj(bpobj_t *bpo, char *name, int indent) { char bytes[32]; char comp[32]; @@ -1230,31 +1230,56 @@ dump_bpobj(bpobj_t *bpo, char *name) return; zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes); - if (bpo->bpo_havesubobj) { + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { zdb_nicenum(bpo->bpo_phys->bpo_comp, comp); zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp); - (void) printf("\n %s: %llu local blkptrs, %llu subobjs, " - "%s (%s/%s comp)\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + (void) printf(" %*s: object %llu, %llu local blkptrs, " + "%llu subobjs, %s (%s/%s comp)\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs, bytes, comp, uncomp); + + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + dump_bpobj(&subbpo, "subobj", indent + 1); + } } else { - (void) printf("\n %s: %llu blkptrs, %s\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, bytes); + (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + bytes); } if (dump_opt['d'] < 5) return; - (void) printf("\n"); - (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + if (indent == 0) { + (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + (void) printf("\n"); + } } static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; + uint64_t unused; char bytes[32]; char comp[32]; char uncomp[32]; @@ -1273,14 +1298,24 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { - (void) printf(" mintxg %llu -> obj %llu\n", - (longlong_t)dle->dle_mintxg, - (longlong_t)dle->dle_bpobj.bpo_object); + if (dump_opt['d'] >= 5) { + char buf[128]; + (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); - if (dump_opt['d'] >= 5) - dump_bpobj(&dle->dle_bpobj, ""); + dump_bpobj(&dle->dle_bpobj, buf, 0); + } else { + (void) printf("mintxg %llu -> obj %llu\n", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); + + } } } @@ -1303,7 +1338,7 @@ fuid_table_destroy() * print uid or gid information. * For normal POSIX id just the id is printed in decimal format. * For CIFS files with FUID the fuid is printed in hex followed by - * the doman-rid string. + * the domain-rid string. */ static void print_idstr(uint64_t id, const char *id_type) @@ -2560,10 +2595,11 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { - dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); + dump_bpobj(&spa->spa_deferred_bpobj, + "Deferred frees", 0); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool snapshot frees"); + "Pool snapshot frees", 0); } if (spa_feature_is_active(spa, Modified: projects/libzfs_core/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- projects/libzfs_core/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Sat Mar 9 11:57:51 2013 (r248094) @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, for (i = 0; i < nent; i++) { GElf_Sym sym; + char *bname; iidesc_t **tolist; GElf_Sym ssym; iidesc_match_t smatch; @@ -377,7 +378,8 @@ sort_iidescs(Elf *elf, const char *file, switch (GELF_ST_TYPE(sym.st_info)) { case STT_FILE: - match.iim_file = match.iim_name; + bname = strrchr(match.iim_name, '/'); + match.iim_file = bname == NULL ? match.iim_name : bname + 1; continue; case STT_OBJECT: tolist = iiburst->iib_objts; Modified: projects/libzfs_core/contrib/openpam/doc/man/openpam_straddch.3 ============================================================================== --- projects/libzfs_core/contrib/openpam/doc/man/openpam_straddch.3 Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/contrib/openpam/doc/man/openpam_straddch.3 Sat Mar 9 11:57:51 2013 (r248094) @@ -34,7 +34,7 @@ .\" .\" $Id$ .\" -.Dd May 26, 2012 +.Dd March 3, 2013 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME @@ -73,6 +73,21 @@ and argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. .Pp +The final argument, +.Fa ch , +is the character that should be appended to +the string. If +.Fa ch +is 0, nothing is appended, but a new buffer is +still allocated if +.Fa str +is NULL. This can be used to +.Do +bootstrap +.Dc +the +string. +.Pp If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, .Fa str @@ -91,7 +106,9 @@ If the function is successful, it increments the integer variable pointed to by .Fa len -and returns 0. +(unless +.Fa ch +was 0) and returns 0. Otherwise, it leaves the variables pointed to by .Fa str , .Fa size Modified: projects/libzfs_core/contrib/openpam/lib/openpam_readline.c ============================================================================== --- projects/libzfs_core/contrib/openpam/lib/openpam_readline.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/contrib/openpam/lib/openpam_readline.c Sat Mar 9 11:57:51 2013 (r248094) @@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, s size_t len, size; int ch; - if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); + line = NULL; + if (openpam_straddch(&line, &size, &len, 0) != 0) return (NULL); - } - len = 0; for (;;) { ch = fgetc(f); /* strip comment */ Modified: projects/libzfs_core/contrib/openpam/lib/openpam_readword.c ============================================================================== --- projects/libzfs_core/contrib/openpam/lib/openpam_readword.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/contrib/openpam/lib/openpam_readword.c Sat Mar 9 11:57:51 2013 (r248094) @@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, s /* begin quote */ quote = ch; /* edge case: empty quoted string */ - if (word == NULL && (word = malloc(1)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); - errno = ENOMEM; + if (openpam_straddch(&word, &size, &len, 0) != 0) return (NULL); - } - *word = '\0'; - size = 1; } else if (ch == quote && !escape) { /* end quote */ quote = 0; Modified: projects/libzfs_core/crypto/openssh/FREEBSD-upgrade ============================================================================== --- projects/libzfs_core/crypto/openssh/FREEBSD-upgrade Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/crypto/openssh/FREEBSD-upgrade Sat Mar 9 11:57:51 2013 (r248094) @@ -43,6 +43,7 @@ 7) Run configure with the appropriate arguments: $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \ + --disable-lastlog --disable-utmp --disable-wtmp \ --with-pam --with-tcp-wrappers --with-libedit \ --with-ssl-engine Modified: projects/libzfs_core/crypto/openssh/config.h ============================================================================== --- projects/libzfs_core/crypto/openssh/config.h Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/crypto/openssh/config.h Sat Mar 9 11:57:51 2013 (r248094) @@ -17,6 +17,9 @@ /* Define if your resolver libs need this for getrrsetbyname */ /* #undef BIND_8_COMPAT */ +/* The system has incomplete BSM API */ +/* #undef BROKEN_BSM_API */ + /* Define if cmsg_type is not passed correctly */ /* #undef BROKEN_CMSG_TYPE */ @@ -97,7 +100,7 @@ /* #undef DISABLE_FD_PASSING */ /* Define if you don't want to use lastlog */ -/* #undef DISABLE_LASTLOG */ +#define DISABLE_LASTLOG 1 /* Define if you don't want to use your system's login() call */ /* #undef DISABLE_LOGIN */ @@ -307,7 +310,7 @@ #define HAVE_DECL__GETSHORT 0 /* Define if you have /dev/ptmx */ -#define HAVE_DEV_PTMX 1 +/* #undef HAVE_DEV_PTMX */ /* Define if you have /dev/ptc */ /* #undef HAVE_DEV_PTS_AND_PTC */ @@ -316,7 +319,7 @@ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the `dirfd' function. */ -/* #undef HAVE_DIRFD */ +#define HAVE_DIRFD 1 /* Define to 1 if you have the `dirname' function. */ #define HAVE_DIRNAME 1 @@ -501,6 +504,9 @@ /* Define if HEADER.ad exists in arpa/nameser.h */ #define HAVE_HEADER_AD 1 +/* Define to 1 if you have the `HMAC_CTX_init' function. */ +#define HAVE_HMAC_CTX_INIT 1 + /* Define if you have ut_host in utmp.h */ /* #undef HAVE_HOST_IN_UTMP */ @@ -552,6 +558,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LASTLOG_H */ +/* Define if you want ldns support */ +/* #undef HAVE_LDNS */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ @@ -594,10 +603,19 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_AUDIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_FILTER_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LINUX_IF_TUN_H */ -/* Define if your libraries define login() */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_SECCOMP_H */ + +/* Define to 1 if you have the `login' function. */ /* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ @@ -805,6 +823,9 @@ /* Define to 1 if you have the `setgroups' function. */ #define HAVE_SETGROUPS 1 +/* Define to 1 if you have the `setlinebuf' function. */ +#define HAVE_SETLINEBUF 1 + /* Define to 1 if you have the `setlogin' function. */ #define HAVE_SETLOGIN 1 @@ -931,6 +952,9 @@ /* Define to 1 if you have the `strmode' function. */ #define HAVE_STRMODE 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strnvis' function. */ /* #undef HAVE_STRNVIS */ @@ -1172,7 +1196,7 @@ /* #undef HAVE_VHANGUP */ /* Define to 1 if you have the header file. */ -#define HAVE_VIS_H 1 +/* #undef HAVE_VIS_H */ /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 @@ -1351,15 +1375,21 @@ /* Sandbox using setrlimit(2) */ #define SANDBOX_RLIMIT 1 +/* Sandbox using seccomp filter */ +/* #undef SANDBOX_SECCOMP_FILTER */ + +/* setrlimit RLIMIT_FSIZE works */ +/* #undef SANDBOX_SKIP_RLIMIT_FSIZE */ + /* Sandbox using systrace(4) */ /* #undef SANDBOX_SYSTRACE */ +/* Specify the system call convention in use */ +/* #undef SECCOMP_AUDIT_ARCH */ + /* Define if your platform breaks doing a seteuid before a setuid */ /* #undef SETEUID_BREAKS_SETUID */ -/* The size of `char', as computed by sizeof. */ -#define SIZEOF_CHAR 1 - /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -1500,6 +1530,11 @@ /* Define if xauth is found in your path */ /* #undef XAUTH_PATH */ +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ Modified: projects/libzfs_core/etc/portsnap.conf ============================================================================== --- projects/libzfs_core/etc/portsnap.conf Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/etc/portsnap.conf Sat Mar 9 11:57:51 2013 (r248094) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 Modified: projects/libzfs_core/lib/Makefile ============================================================================== --- projects/libzfs_core/lib/Makefile Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/lib/Makefile Sat Mar 9 11:57:51 2013 (r248094) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ + libyaml \ libz \ ${_atf} \ ${_bind} \ Modified: projects/libzfs_core/lib/libc/string/Makefile.inc ============================================================================== --- projects/libzfs_core/lib/libc/string/Makefile.inc Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/lib/libc/string/Makefile.inc Sat Mar 9 11:57:51 2013 (r248094) @@ -46,7 +46,8 @@ MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ strcasecmp.3 strncasecmp_l.3 MLINKS+=strcat.3 strncat.3 -MLINKS+=strchr.3 strrchr.3 +MLINKS+=strchr.3 strrchr.3 \ + strchr.3 strchrnul.3 MLINKS+=strcmp.3 strncmp.3 MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ Modified: projects/libzfs_core/lib/libstand/Makefile ============================================================================== --- projects/libzfs_core/lib/libstand/Makefile Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/lib/libstand/Makefile Sat Mar 9 11:57:51 2013 (r248094) @@ -67,6 +67,9 @@ SRCS+= divsi3.S .else # Compiler support functions .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c Modified: projects/libzfs_core/lib/libutil/gr_util.c ============================================================================== --- projects/libzfs_core/lib/libutil/gr_util.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/lib/libutil/gr_util.c Sat Mar 9 11:57:51 2013 (r248094) @@ -49,6 +49,8 @@ static char group_dir[PATH_MAX]; static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; +static size_t grmemlen(const struct group *, const char *, int *); +static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); /* * Initialize statics @@ -429,90 +431,121 @@ gr_make(const struct group *gr) struct group * gr_dup(const struct group *gr) { + return (gr_add(gr, NULL)); +} +/* + * Add a new member name to a struct group. + */ +struct group * +gr_add(const struct group *gr, const char *newmember) +{ struct group *newgr; - char *dst; size_t len; - int ndx; int num_mem; - /* Calculate size of the group. */ - len = sizeof(*newgr); - if (gr->gr_name != NULL) - len += strlen(gr->gr_name) + 1; - if (gr->gr_passwd != NULL) - len += strlen(gr->gr_passwd) + 1; - if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) - len += strlen(gr->gr_mem[num_mem]) + 1; - len += (num_mem + 1) * sizeof(*gr->gr_mem); - } else - num_mem = -1; + num_mem = 0; + len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ if ((newgr = malloc(len)) == NULL) return (NULL); - /* point new gr_mem to end of struct + 1 */ - if (gr->gr_mem != NULL) + return (grcopy(gr, newgr, newmember, num_mem)); +} + +/* It is safer to walk the pointers given at gr_mem since there is no + * guarantee the gr_mem + strings are continguous in the given struct group + * but compact the new group into the following form. + * + * The new struct is laid out like this in memory. The example given is + * for a group with two members only. + * + * { + * (char *name) + * (char *passwd) + * (int gid) + * (gr_mem * newgrp + sizeof(struct group) + sizeof(**)) points to gr_mem area + * gr_mem area + * (member1 *) + * (member2 *) + * (NULL) + * (name string) + * (passwd string) + * (member1 string) + * (member2 string) + * } + */ +/* + * Copy the guts of a group plus given name to a preallocated group struct + */ +static struct group * +grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +{ + char *dst; + int i; + + if (name != NULL) + ndx++; + /* point new gr_mem to end of struct + 1 if there are names */ + if (ndx != 0) newgr->gr_mem = (char **)(newgr + 1); else newgr->gr_mem = NULL; /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[num_mem + 1]; + dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; - } else { + } else newgr->gr_name = NULL; - } if (gr->gr_passwd != NULL) { newgr->gr_passwd = dst; dst = stpcpy(dst, gr->gr_passwd) + 1; - } else { + } else newgr->gr_passwd = NULL; - } newgr->gr_gid = gr->gr_gid; - if (gr->gr_mem != NULL) { - for (ndx = 0; ndx < num_mem; ndx++) { - newgr->gr_mem[ndx] = dst; - dst = stpcpy(dst, gr->gr_mem[ndx]) + 1; + if (ndx != 0) { + for (i = 0; gr->gr_mem[i] != NULL; i++) { + newgr->gr_mem[i] = dst; + dst = stpcpy(dst, gr->gr_mem[i]) + 1; + } + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; } - newgr->gr_mem[ndx] = NULL; + newgr->gr_mem[i] = NULL; } return (newgr); } /* - * Add a new member name to a struct group. + * Calculate length of a struct group + given name */ -struct group * -gr_add(struct group *gr, char *newmember) +static size_t +grmemlen(const struct group *gr, const char *name, int *num_mem) { - size_t mlen; - int num_mem=0; - char **members; - struct group *newgr; - - if (newmember == NULL) - return(gr_dup(gr)); + size_t len; + int i; + if (gr == NULL) + return (0); + /* Calculate size of the group. */ + len = sizeof(*gr); + if (gr->gr_name != NULL) + len += strlen(gr->gr_name) + 1; + if (gr->gr_passwd != NULL) + len += strlen(gr->gr_passwd) + 1; if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) { - if (strcmp(gr->gr_mem[num_mem], newmember) == 0) { - errno = EEXIST; - return (NULL); - } + for (len = i = 0; gr->gr_mem[i] != NULL; i++) { + len += strlen(gr->gr_mem[i]) + 1; + len += sizeof(*gr->gr_mem); } + *num_mem = i; } - /* Allocate enough for current pointers + 1 more and NULL marker */ - mlen = (num_mem + 2) * sizeof(*gr->gr_mem); - if ((members = malloc(mlen)) == NULL) - return (NULL); - memcpy(members, gr->gr_mem, num_mem * sizeof(*gr->gr_mem)); - members[num_mem++] = newmember; - members[num_mem] = NULL; - gr->gr_mem = members; - newgr = gr_dup(gr); - free(members); - return (newgr); + if (name != NULL) { + len += strlen(name) + 1; + if (gr->gr_mem == NULL) + len += sizeof(*gr->gr_mem); + } + return(len); } /* Modified: projects/libzfs_core/lib/libutil/libutil.h ============================================================================== --- projects/libzfs_core/lib/libutil/libutil.h Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/lib/libutil/libutil.h Sat Mar 9 11:57:51 2013 (r248094) @@ -167,7 +167,7 @@ int gr_copy(int __ffd, int _tfd, const struct group * gr_dup(const struct group *_gr); struct group * - gr_add(struct group *_gr, char *_newmember); + gr_add(const struct group *_gr, const char *_newmember); int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); Modified: projects/libzfs_core/sbin/geom/class/raid/graid.8 ============================================================================== --- projects/libzfs_core/sbin/geom/class/raid/graid.8 Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/geom/class/raid/graid.8 Sat Mar 9 11:57:51 2013 (r248094) @@ -305,6 +305,9 @@ Write errors are always considered as di Time to wait for missing array components on startup. .It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 Enable taste for specific metadata or transformation module. +.It Va kern.geom.raid.legacy_aliases : No 0 +Enable geom raid emulation of /dev/ar%d devices from ataraid(4) +This should aid the upgrade of systems from legacy to modern releases. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: projects/libzfs_core/sbin/ipfw/ipfw2.c ============================================================================== --- projects/libzfs_core/sbin/ipfw/ipfw2.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/ipfw/ipfw2.c Sat Mar 9 11:57:51 2013 (r248094) @@ -3083,9 +3083,14 @@ chkarg: } else { len = sizeof(c->max_log); if (sysctlbyname("net.inet.ip.fw.verbose_limit", - &c->max_log, &len, NULL, 0) == -1) + &c->max_log, &len, NULL, 0) == -1) { + if (co.test_only) { + c->max_log = 0; + break; + } errx(1, "sysctlbyname(\"%s\")", "net.inet.ip.fw.verbose_limit"); + } } } break; @@ -3986,9 +3991,13 @@ ipfw_table_handler(int ac, char *av[]) mask = 0; // XXX uninitialized ? len = sizeof(tables_max); if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len, - NULL, 0) == -1) - errx(1, "Can't determine maximum number of ipfw tables. " - "Perhaps you forgot to load ipfw module?"); + NULL, 0) == -1) { + if (co.test_only) + tables_max = 128; /* Old conservative default */ + else + errx(1, "Can't determine maximum number of ipfw tables." + " Perhaps you forgot to load ipfw module?"); + } memset(&xent, 0, sizeof(xent)); Modified: projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.8 ============================================================================== --- projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.8 Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.8 Sat Mar 9 11:57:51 2013 (r248094) @@ -32,7 +32,7 @@ .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" $FreeBSD$ .\" -.Dd October 3, 2005 +.Dd March 5, 2013 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -80,7 +80,7 @@ See the man page for possible options and their meanings. The following cd9660 specific options are available: .Pp -.Bl -tag -width "nostrictjoliet" -compact +.Bl -tag -width "brokenjoliet" -compact .It Cm extatt Same as .Fl e . @@ -93,7 +93,7 @@ Same as .It Cm norrip Same as .Fl r . -.It Cm nostrictjoliet +.It Cm brokenjoliet Same as .Fl b . .El Modified: projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.c ============================================================================== --- projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_cd9660/mount_cd9660.c Sat Mar 9 11:57:51 2013 (r248094) @@ -83,7 +83,7 @@ main(int argc, char **argv) { struct iovec *iov; int iovlen; - int ch, mntflags, opts; + int ch, mntflags; char *dev, *dir, *p, *val, mntpath[MAXPATHLEN]; int verbose; int ssector; /* starting sector, 0 for 1st session */ @@ -91,7 +91,7 @@ main(int argc, char **argv) iov = NULL; iovlen = 0; - mntflags = opts = verbose = 0; + mntflags = verbose = 0; ssector = -1; while ((ch = getopt(argc, argv, "begjo:rs:vC:")) != -1) @@ -109,7 +109,7 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "nojoliet", NULL, (size_t)-1); break; case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); p = strchr(optarg, '='); val = NULL; if (p != NULL) { Modified: projects/libzfs_core/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- projects/libzfs_core/sbin/mount_msdosfs/mount_msdosfs.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_msdosfs/mount_msdosfs.c Sat Mar 9 11:57:51 2013 (r248094) @@ -69,7 +69,7 @@ main(int argc, char **argv) struct iovec *iov = NULL; int iovlen = 0; struct stat sb; - int c, mntflags, set_gid, set_uid, set_mask, set_dirmask; + int c, set_gid, set_uid, set_mask, set_dirmask; char *dev, *dir, mntpath[MAXPATHLEN], *csp; char fstype[] = "msdosfs"; char errmsg[255] = {0}; @@ -78,9 +78,8 @@ main(int argc, char **argv) mode_t mask = 0, dirmask = 0; uid_t uid = 0; gid_t gid = 0; - getmnt_silent = 1; - mntflags = set_gid = set_uid = set_mask = set_dirmask = 0; + set_gid = set_uid = set_mask = set_dirmask = 0; while ((c = getopt(argc, argv, "sl9u:g:m:M:o:L:D:W:")) != -1) { switch (c) { @@ -219,7 +218,7 @@ main(int argc, char **argv) build_iovec_argf(&iov, &iovlen, "mask", "%u", mask); build_iovec_argf(&iov, &iovlen, "dirmask", "%u", dirmask); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0]) err(1, "%s: %s", dev, errmsg); else Modified: projects/libzfs_core/sbin/mount_nfs/mount_nfs.c ============================================================================== --- projects/libzfs_core/sbin/mount_nfs/mount_nfs.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_nfs/mount_nfs.c Sat Mar 9 11:57:51 2013 (r248094) @@ -130,7 +130,7 @@ enum tryret { TRYRET_LOCALERR /* Local failure. */ }; -static int fallback_mount(struct iovec *iov, int iovlen, int mntflags); +static int fallback_mount(struct iovec *iov, int iovlen); static int sec_name_to_num(char *sec); static char *sec_num_to_name(int num); static int getnfsargs(char *, struct iovec **iov, int *iovlen); @@ -149,13 +149,12 @@ main(int argc, char *argv[]) { int c; struct iovec *iov; - int mntflags, num, iovlen; + int num, iovlen; int osversion; char *name, *p, *spec, *fstype; char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50]; - mntflags = 0; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); @@ -427,10 +426,10 @@ main(int argc, char *argv[]) */ osversion = getosreldate(); if (osversion >= 702100) { - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(1, "%s, %s", mntpath, errmsg); } else { - if (fallback_mount(iov, iovlen, mntflags)) + if (fallback_mount(iov, iovlen)) err(1, "%s, %s", mntpath, errmsg); } @@ -473,7 +472,7 @@ copyopt(struct iovec **newiov, int *newi * parameters. It should be eventually be removed. */ static int -fallback_mount(struct iovec *iov, int iovlen, int mntflags) +fallback_mount(struct iovec *iov, int iovlen) { struct nfs_args args = { .version = NFS_ARGSVERSION, @@ -663,7 +662,7 @@ fallback_mount(struct iovec *iov, int io copyopt(&newiov, &newiovlen, iov, iovlen, "fspath"); copyopt(&newiov, &newiovlen, iov, iovlen, "errmsg"); - return nmount(newiov, newiovlen, mntflags); + return nmount(newiov, newiovlen, 0); } static int Modified: projects/libzfs_core/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- projects/libzfs_core/sbin/mount_nullfs/mount_nullfs.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_nullfs/mount_nullfs.c Sat Mar 9 11:57:51 2013 (r248094) @@ -68,12 +68,11 @@ main(int argc, char *argv[]) char source[MAXPATHLEN]; char target[MAXPATHLEN]; char errmsg[255]; - int ch, mntflags, iovlen; + int ch, iovlen; char nullfs[] = "nullfs"; iov = NULL; iovlen = 0; - mntflags = 0; errmsg[0] = '\0'; while ((ch = getopt(argc, argv, "o:")) != -1) switch(ch) { @@ -111,7 +110,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0] != 0) err(1, "%s: %s", source, errmsg); else Modified: projects/libzfs_core/sbin/mount_udf/Makefile ============================================================================== --- projects/libzfs_core/sbin/mount_udf/Makefile Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_udf/Makefile Sat Mar 9 11:57:51 2013 (r248094) @@ -9,7 +9,6 @@ LDADD= -lkiconv MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} -I${.CURDIR}/../../sys .PATH: ${MOUNT} -WARNS?= 1 # Needs to be dynamically linked for optional dlopen() access to # userland libiconv Modified: projects/libzfs_core/sbin/mount_udf/mount_udf.c ============================================================================== --- projects/libzfs_core/sbin/mount_udf/mount_udf.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_udf/mount_udf.c Sat Mar 9 11:57:51 2013 (r248094) @@ -73,18 +73,19 @@ void usage(void); int main(int argc, char **argv) { - struct iovec iov[12]; - int ch, i, mntflags, opts, udf_flags; - char *dev, *dir, mntpath[MAXPATHLEN]; - char *cs_disk, *cs_local; - int verbose; + char mntpath[MAXPATHLEN]; + char fstype[] = "udf"; + struct iovec *iov; + char *cs_disk, *cs_local, *dev, *dir; + int ch, i, iovlen, mntflags, udf_flags, verbose; - i = mntflags = opts = udf_flags = verbose = 0; + i = iovlen = mntflags = udf_flags = verbose = 0; cs_disk = cs_local = NULL; + iov = NULL; while ((ch = getopt(argc, argv, "o:vC:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); break; case 'v': verbose++; @@ -120,32 +121,13 @@ main(int argc, char **argv) */ mntflags |= MNT_RDONLY; - iov[i].iov_base = "fstype"; - iov[i++].iov_len = sizeof("fstype"); - iov[i].iov_base = "udf"; - iov[i].iov_len = strlen(iov[i].iov_base) + 1; - i++; - iov[i].iov_base = "fspath"; - iov[i++].iov_len = sizeof("fspath"); - iov[i].iov_base = mntpath; - iov[i++].iov_len = strlen(mntpath) + 1; - iov[i].iov_base = "from"; - iov[i++].iov_len = sizeof("from"); - iov[i].iov_base = dev; - iov[i++].iov_len = strlen(dev) + 1; - iov[i].iov_base = "flags"; - iov[i++].iov_len = sizeof("flags"); - iov[i].iov_base = &udf_flags; - iov[i++].iov_len = sizeof(udf_flags); + build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); + build_iovec(&iov, &iovlen, "from", dev, (size_t)-1); + build_iovec(&iov, &iovlen, "flags", &udf_flags, sizeof(udf_flags)); if (udf_flags & UDFMNT_KICONV) { - iov[i].iov_base = "cs_disk"; - iov[i++].iov_len = sizeof("cs_disk"); - iov[i].iov_base = cs_disk; - iov[i++].iov_len = strlen(cs_disk) + 1; - iov[i].iov_base = "cs_local"; - iov[i++].iov_len = sizeof("cs_local"); - iov[i].iov_base = cs_local; - iov[i++].iov_len = strlen(cs_local) + 1; + build_iovec(&iov, &iovlen, "cs_disk", cs_disk, (size_t)-1); + build_iovec(&iov, &iovlen, "cs_local", cs_local, (size_t)-1); } if (nmount(iov, i, mntflags) < 0) err(1, "%s", dev); Modified: projects/libzfs_core/sbin/mount_unionfs/mount_unionfs.c ============================================================================== --- projects/libzfs_core/sbin/mount_unionfs/mount_unionfs.c Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/sbin/mount_unionfs/mount_unionfs.c Sat Mar 9 11:57:51 2013 (r248094) @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { struct iovec *iov; - int ch, mntflags, iovlen; + int ch, iovlen; char source [MAXPATHLEN], target[MAXPATHLEN], errmsg[255]; char uid_str[20], gid_str[20]; char fstype[] = "unionfs"; @@ -137,7 +137,6 @@ main(int argc, char *argv[]) iov = NULL; iovlen = 0; - mntflags = 0; memset(errmsg, 0, sizeof(errmsg)); while ((ch = getopt(argc, argv, "bo:")) != -1) { @@ -190,7 +189,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "from", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(EX_OSERR, "%s: %s", source, errmsg); exit(0); } Modified: projects/libzfs_core/share/man/man4/eventtimers.4 ============================================================================== --- projects/libzfs_core/share/man/man4/eventtimers.4 Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/share/man/man4/eventtimers.4 Sat Mar 9 11:57:51 2013 (r248094) @@ -143,14 +143,6 @@ By default this options is disabled. If chosen timer is per-CPU and runs in periodic mode, this option has no effect - all interrupts are always generating. -.It Va kern.eventtimer.activetick -makes each CPU to receive all kinds of timer interrupts when they are busy. -Disabling it allows to skip some -.Fn hardclock -calls in some cases. -By default this options is enabled. -If chosen timer is per-CPU, this option has no effect - all interrupts are -always generating, as timer reprogramming is too expensive for that case. .El .Sh SEE ALSO .Xr apic 4 , Modified: projects/libzfs_core/share/man/man4/zyd.4 ============================================================================== --- projects/libzfs_core/share/man/man4/zyd.4 Sat Mar 9 10:16:08 2013 (r248093) +++ projects/libzfs_core/share/man/man4/zyd.4 Sat Mar 9 11:57:51 2013 (r248094) @@ -32,7 +32,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 2, 2009 +.Dd March 7, 2013 .Dt ZYD 4 .Os .Sh NAME @@ -121,6 +121,7 @@ driver: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***