svn commit: r244285 - in projects/calloutng/sys: kern netinet sys
Alexander Motin
mav at FreeBSD.org
Sun Dec 16 09:39:23 UTC 2012
Author: mav
Date: Sun Dec 16 09:39:20 2012
New Revision: 244285
URL: http://svnweb.freebsd.org/changeset/base/244285
Log:
Cleanup tabs and whitespaces in modified code. Should be no functional
changes.
Modified:
projects/calloutng/sys/kern/kern_clocksource.c
projects/calloutng/sys/kern/kern_condvar.c
projects/calloutng/sys/kern/kern_synch.c
projects/calloutng/sys/kern/kern_tc.c
projects/calloutng/sys/kern/kern_timeout.c
projects/calloutng/sys/kern/subr_sleepqueue.c
projects/calloutng/sys/kern/sys_generic.c
projects/calloutng/sys/netinet/tcp_timer.c
projects/calloutng/sys/sys/callout.h
projects/calloutng/sys/sys/condvar.h
projects/calloutng/sys/sys/sleepqueue.h
projects/calloutng/sys/sys/systm.h
projects/calloutng/sys/sys/time.h
Modified: projects/calloutng/sys/kern/kern_clocksource.c
==============================================================================
--- projects/calloutng/sys/kern/kern_clocksource.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/kern/kern_clocksource.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -873,12 +873,12 @@ cpu_new_callout(int cpu, struct bintime
state = DPCPU_ID_PTR(cpu, timerstate);
ET_HW_LOCK(state);
- /*
- * If there is callout time already set earlier -- do nothing.
- * This check may appear redundant because we check already in
- * callout_process() but this double check guarantees we're safe
- * with respect to race conditions between interrupts execution
- * and scheduling.
+ /*
+ * If there is callout time already set earlier -- do nothing.
+ * This check may appear redundant because we check already in
+ * callout_process() but this double check guarantees we're safe
+ * with respect to race conditions between interrupts execution
+ * and scheduling.
*/
state->nextcallopt = bt_opt;
if (state->nextcall.sec != -1 &&
Modified: projects/calloutng/sys/kern/kern_condvar.c
==============================================================================
--- projects/calloutng/sys/kern/kern_condvar.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/kern/kern_condvar.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -274,7 +274,7 @@ _cv_wait_sig(struct cv *cvp, struct lock
* cv_signal or cv_broadcast, EWOULDBLOCK if the timeout expires.
*/
int
-_cv_timedwait(struct cv *cvp, struct lock_object *lock, struct bintime *bt,
+_cv_timedwait(struct cv *cvp, struct lock_object *lock, struct bintime *bt,
struct bintime *precision, int timo, int flags)
{
WITNESS_SAVE_DECL(lock_witness);
@@ -311,10 +311,10 @@ _cv_timedwait(struct cv *cvp, struct loc
DROP_GIANT();
sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0);
- if (bt == NULL)
+ if (bt == NULL)
sleepq_set_timeout_flags(cvp, timo, flags);
else
- sleepq_set_timeout_bt(cvp, bt, precision);
+ sleepq_set_timeout_bt(cvp, bt, precision);
if (lock != &Giant.lock_object) {
if (class->lc_flags & LC_SLEEPABLE)
sleepq_release(cvp);
@@ -340,12 +340,12 @@ _cv_timedwait(struct cv *cvp, struct loc
/*
* Wait on a condition variable 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
+ * 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.
*/
int
-_cv_timedwait_sig(struct cv *cvp, struct lock_object *lock,
+_cv_timedwait_sig(struct cv *cvp, struct lock_object *lock,
struct bintime *bt, struct bintime *precision, int timo, int flags)
{
WITNESS_SAVE_DECL(lock_witness);
@@ -383,7 +383,7 @@ _cv_timedwait_sig(struct cv *cvp, struct
sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR |
SLEEPQ_INTERRUPTIBLE, 0);
- if (bt == NULL)
+ if (bt == NULL)
sleepq_set_timeout_flags(cvp, timo, flags);
else
sleepq_set_timeout_bt(cvp, bt, precision);
Modified: projects/calloutng/sys/kern/kern_synch.c
==============================================================================
--- projects/calloutng/sys/kern/kern_synch.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/kern/kern_synch.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -146,7 +146,7 @@ sleepinit(void)
*/
int
_sleep(void *ident, struct lock_object *lock, int priority,
- const char *wmesg, int timo, struct bintime *bt,
+ const char *wmesg, int timo, struct bintime *bt,
struct bintime *precision, int flags)
{
struct thread *td;
@@ -233,7 +233,7 @@ _sleep(void *ident, struct lock_object *
* return from cursig().
*/
sleepq_add(ident, lock, wmesg, sleepq_flags, 0);
- if (bt)
+ if (bt)
sleepq_set_timeout_bt(ident, bt, precision);
else if (timo)
sleepq_set_timeout_flags(ident, timo, flags);
Modified: projects/calloutng/sys/kern/kern_tc.c
==============================================================================
--- projects/calloutng/sys/kern/kern_tc.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/kern/kern_tc.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -1718,7 +1718,7 @@ tc_ticktock(int cnt)
tc_windup();
}
-static void __inline
+static void __inline
tc_adjprecision(void)
{
struct timespec ts;
@@ -1739,7 +1739,7 @@ tc_adjprecision(void)
timespec2bintime(&ts, &bt_timethreshold);
}
-static int
+static int
sysctl_kern_timecounter_adjprecision(SYSCTL_HANDLER_ARGS)
{
int error, val;
Modified: projects/calloutng/sys/kern/kern_timeout.c
==============================================================================
--- projects/calloutng/sys/kern/kern_timeout.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/kern/kern_timeout.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -207,7 +207,7 @@ static MALLOC_DEFINE(M_CALLOUT, "callout
static void
cc_cme_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;
@@ -228,7 +228,6 @@ cc_cme_migrating(struct callout_cpu *cc,
{
#ifdef SMP
-
return (cc->cc_exec_entity[direct].ce_migration_cpu != CPUBLOCK);
#else
return (0);
@@ -371,7 +370,7 @@ callout_hash(struct bintime *bt)
return (int) ((bt->sec << CC_HASH_SHIFT) +
(bt->frac >> (64 - CC_HASH_SHIFT)));
-}
+}
static inline int
get_bucket(struct bintime *bt)
@@ -914,7 +913,7 @@ _callout_reset_on(struct callout *c, str
else
bintime_mul(&pr, to_ticks);
}
- } else {
+ } else {
to_bt = *bt;
if (precision != NULL)
pr = *precision;
Modified: projects/calloutng/sys/kern/subr_sleepqueue.c
==============================================================================
--- projects/calloutng/sys/kern/subr_sleepqueue.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/kern/subr_sleepqueue.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -362,7 +362,7 @@ sleepq_add(void *wchan, struct lock_obje
* Sets a timeout that will remove the current thread from the specified
* sleep queue after timo ticks if the thread has not already been awakened.
*/
-void
+void
_sleepq_set_timeout(void *wchan, struct bintime *bt, struct bintime *precision,
int timo, int flags)
{
@@ -376,7 +376,7 @@ _sleepq_set_timeout(void *wchan, struct
MPASS(TD_ON_SLEEPQ(td));
MPASS(td->td_sleepqueue == NULL);
MPASS(wchan != NULL);
- if (bt == NULL)
+ if (bt == NULL)
callout_reset_flags_on(&td->td_slpcallout, timo,
sleepq_timeout, td, PCPU_GET(cpuid), flags | C_DIRECT_EXEC);
else
Modified: projects/calloutng/sys/kern/sys_generic.c
==============================================================================
--- projects/calloutng/sys/kern/sys_generic.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/kern/sys_generic.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -999,7 +999,7 @@ kern_select(struct thread *td, int nd, f
if (tvp != NULL) {
atv = *tvp;
- if (atv.tv_sec < 0 || atv.tv_usec < 0 ||
+ if (atv.tv_sec < 0 || atv.tv_usec < 0 ||
atv.tv_usec >= 1000000) {
error = EINVAL;
goto done;
@@ -1281,7 +1281,7 @@ sys_poll(td, uap)
if (uap->timeout != INFTIM) {
atv.tv_sec = uap->timeout / 1000;
atv.tv_usec = (uap->timeout % 1000) * 1000;
- if (atv.tv_sec < 0 || atv.tv_usec < 0 ||
+ if (atv.tv_sec < 0 || atv.tv_usec < 0 ||
atv.tv_usec >= 1000000) {
error = EINVAL;
goto done;
@@ -1307,7 +1307,7 @@ sys_poll(td, uap)
if (bintime_cmp(&rbt, &abt, >=))
break;
error = seltdwait(td, &abt, &precision, 0);
- } else {
+ } else {
error = seltdwait(td, NULL, NULL, 0);
}
if (error)
@@ -1671,7 +1671,7 @@ seltdwait(struct thread *td, struct bint
mtx_unlock(&stp->st_mtx);
return (0);
}
- if (bt == NULL && timo > 0)
+ if (bt == NULL && timo > 0)
error = cv_timedwait_sig(&stp->st_wait, &stp->st_mtx, timo);
else if (bt != NULL)
error = cv_timedwait_sig_bt(&stp->st_wait, &stp->st_mtx,
Modified: projects/calloutng/sys/netinet/tcp_timer.c
==============================================================================
--- projects/calloutng/sys/netinet/tcp_timer.c Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/netinet/tcp_timer.c Sun Dec 16 09:39:20 2012 (r244285)
@@ -713,37 +713,38 @@ tcp_timer_active(struct tcpcb *tp, int t
#define ticks_to_msecs(t) (1000*(t) / hz)
static int
-delta_bintime_in_msecs(struct bintime bt, struct bintime now)
+delta_bintime_in_msecs(struct bintime bt, struct bintime now)
{
+
bintime_sub(&bt, &now);
return (((uint64_t)1000 * (uint64_t)(bt.frac >> 32)) >> 32) +
(bt.sec * 1000);
}
void
-tcp_timer_to_xtimer(struct tcpcb *tp, struct tcp_timer *timer,
+tcp_timer_to_xtimer(struct tcpcb *tp, struct tcp_timer *timer,
struct xtcp_timer *xtimer)
{
struct bintime bt, now;
-
+
bzero(xtimer, sizeof(*xtimer));
if (timer == NULL)
return;
bintime_clear(&bt);
- getbinuptime(&now);
- if (callout_active(&timer->tt_delack))
+ getbinuptime(&now);
+ if (callout_active(&timer->tt_delack))
xtimer->tt_delack = delta_bintime_in_msecs(
timer->tt_delack.c_time, now);
- if (callout_active(&timer->tt_rexmt))
+ if (callout_active(&timer->tt_rexmt))
xtimer->tt_rexmt = delta_bintime_in_msecs(
timer->tt_rexmt.c_time, now);
- if (callout_active(&timer->tt_persist))
+ if (callout_active(&timer->tt_persist))
xtimer->tt_persist = delta_bintime_in_msecs(
timer->tt_persist.c_time, now);
- if (callout_active(&timer->tt_keep))
+ if (callout_active(&timer->tt_keep))
xtimer->tt_keep = delta_bintime_in_msecs(
timer->tt_keep.c_time, now);
- if (callout_active(&timer->tt_2msl))
+ if (callout_active(&timer->tt_2msl))
xtimer->tt_2msl = delta_bintime_in_msecs(
timer->tt_2msl.c_time, now);
xtimer->t_rcvtime = ticks_to_msecs(ticks - tp->t_rcvtime);
Modified: projects/calloutng/sys/sys/callout.h
==============================================================================
--- projects/calloutng/sys/sys/callout.h Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/sys/callout.h Sun Dec 16 09:39:20 2012 (r244285)
@@ -80,11 +80,11 @@ int _callout_reset_on(struct callout *,
#define callout_reset_on(c, to_ticks, fn, arg, cpu) \
_callout_reset_on((c), NULL, NULL, (to_ticks), (fn), (arg), \
(cpu), C_PRELSET(tc_timeexp))
-#define callout_reset_flags_on(c, to_ticks, fn, arg, cpu, flags) \
+#define callout_reset_flags_on(c, to_ticks, fn, arg, cpu, flags) \
_callout_reset_on((c), NULL, NULL, (to_ticks), (fn), (arg), (cpu), \
(flags))
-#define callout_reset_bt_on(c, bt, pr, fn, arg, cpu, flags) \
- _callout_reset_on((c), (bt), (pr), 0, (fn), (arg), (cpu), (flags))
+#define callout_reset_bt_on(c, bt, pr, fn, arg, cpu, flags) \
+ _callout_reset_on((c), (bt), (pr), 0, (fn), (arg), (cpu), (flags))
#define callout_reset(c, on_tick, fn, arg) \
callout_reset_on((c), (on_tick), (fn), (arg), (c)->c_cpu)
#define callout_reset_flags(c, on_tick, fn, arg, flags) \
Modified: projects/calloutng/sys/sys/condvar.h
==============================================================================
--- projects/calloutng/sys/sys/condvar.h Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/sys/condvar.h Sun Dec 16 09:39:20 2012 (r244285)
@@ -56,10 +56,10 @@ void _cv_wait(struct cv *cvp, struct loc
void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock);
int _cv_wait_sig(struct cv *cvp, struct lock_object *lock);
int _cv_timedwait(struct cv *cvp, struct lock_object *lock,
- struct bintime *bt, struct bintime *precision, int timo,
+ struct bintime *bt, struct bintime *precision, int timo,
int flags);
int _cv_timedwait_sig(struct cv *cvp, struct lock_object *lock,
- struct bintime *bt, struct bintime *precision, int timo,
+ struct bintime *bt, struct bintime *precision, int timo,
int flags);
void cv_signal(struct cv *cvp);
Modified: projects/calloutng/sys/sys/sleepqueue.h
==============================================================================
--- projects/calloutng/sys/sys/sleepqueue.h Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/sys/sleepqueue.h Sun Dec 16 09:39:20 2012 (r244285)
@@ -108,7 +108,7 @@ struct sleepqueue *sleepq_lookup(void *w
void sleepq_release(void *wchan);
void sleepq_remove(struct thread *td, void *wchan);
int sleepq_signal(void *wchan, int flags, int pri, int queue);
-void _sleepq_set_timeout(void *wchan, struct bintime *bt,
+void _sleepq_set_timeout(void *wchan, struct bintime *bt,
struct bintime *precision, int timo, int flags);
#define sleepq_set_timeout(wchan, timo) \
_sleepq_set_timeout((wchan), NULL, NULL, (timo), 0)
Modified: projects/calloutng/sys/sys/systm.h
==============================================================================
--- projects/calloutng/sys/sys/systm.h Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/sys/systm.h Sun Dec 16 09:39:20 2012 (r244285)
@@ -345,7 +345,7 @@ static __inline void splx(intrmask_t ip
* less often.
*/
int _sleep(void *chan, struct lock_object *lock, int pri, const char *wmesg,
- int timo, struct bintime *bt, struct bintime *precision,
+ int timo, struct bintime *bt, struct bintime *precision,
int flags) __nonnull(1);
#define msleep(chan, mtx, pri, wmesg, timo) \
_sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (timo), \
Modified: projects/calloutng/sys/sys/time.h
==============================================================================
--- projects/calloutng/sys/sys/time.h Sun Dec 16 07:09:52 2012 (r244284)
+++ projects/calloutng/sys/sys/time.h Sun Dec 16 09:39:20 2012 (r244285)
@@ -304,7 +304,7 @@ extern struct timeval boottime;
extern int tc_timeexp;
extern int tc_timepercentage;
extern int tc_timethreshold;
-extern struct bintime bt_timethreshold;
+extern struct bintime bt_timethreshold;
/*
* Functions for looking at our clock: [get]{bin,nano,micro}[up]time()
More information about the svn-src-projects
mailing list