Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Pawel Jakub Dawidek
On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote:
 I've thought about the process of fixing hardcoded provider names there,
 and it is absolutely not trivial. If we take the symlinking way (patch
 is already posted to current@), I think it will be much easier for
 everybody, and especially users, if I hack all mentioned above GEOM
 classes to ignore adX/adaY difference in provider names. And it should
 perfectly fit into remaining time window.

Could you be more specific what the hack would do exactly?

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://yomoli.com


pgpXhRtrwEsT6.pgp
Description: PGP signature


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Pawel Jakub Dawidek
On Mon, Apr 25, 2011 at 12:16:22PM -0700, Garrett Cooper wrote:
 I'd prefer having an UPDATING note with all of the affected areas so that 
 people can understand what needs to change and adjust their systems 
 accordingly. As far as geom based hardcoding is concerned: maybe this can 
 serve as a good lesson of what shouldn't be done and what should be 
 fixed/have a translation layer added for this item?

Hardcoding provider names in metadata is not mistake. It was added to
protect against hacks like the 'c' partition. In the system there might
be serval providers representing exactly same data and hardcoding
provider name allows to choose the proper one.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://yomoli.com


pgpj6tdABF9oo.pgp
Description: PGP signature


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Alexander Motin

On 26.04.2011 10:00, Pawel Jakub Dawidek wrote:

On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote:

I've thought about the process of fixing hardcoded provider names there,
and it is absolutely not trivial. If we take the symlinking way (patch
is already posted to current@), I think it will be much easier for
everybody, and especially users, if I hack all mentioned above GEOM
classes to ignore adX/adaY difference in provider names. And it should
perfectly fit into remaining time window.


Could you be more specific what the hack would do exactly?


I would write some comparison function, which would search both names 
for adX/adaY prefixes, if they found on both arguments, trimmed them and 
compared remaining parts.


I think for usual purpose of name hardcoding device name part is less 
important. Comparing partition names part should be enough. The tricky 
part there is to properly identify device part, so I was thinking about 
specific hack for adX/adaY.


--
Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221055 - in head/sys: kern ofed/include/linux

2011-04-26 Thread Jeff Roberson
Author: jeff
Date: Tue Apr 26 07:30:52 2011
New Revision: 221055
URL: http://svn.freebsd.org/changeset/base/221055

Log:
   - Catch up to falloc() changes.
   - PHOLD() before using a task structure on the stack.
   - Fix a LOR between the sleepq lock and thread lock in _intr_drain().

Modified:
  head/sys/kern/kern_intr.c
  head/sys/ofed/include/linux/file.h
  head/sys/ofed/include/linux/workqueue.h

Modified: head/sys/kern/kern_intr.c
==
--- head/sys/kern/kern_intr.c   Tue Apr 26 04:52:35 2011(r221054)
+++ head/sys/kern/kern_intr.c   Tue Apr 26 07:30:52 2011(r221055)
@@ -746,7 +746,6 @@ intr_handler_source(void *cookie)
 void
 _intr_drain(int irq)
 {
-   struct mtx *mtx;
struct intr_event *ie;
struct intr_thread *ithd;
struct thread *td;
@@ -758,13 +757,21 @@ _intr_drain(int irq)
return;
ithd = ie-ie_thread;
td = ithd-it_thread;
+   /*
+* We set the flag and wait for it to be cleared to avoid
+* long delays with potentially busy interrupt handlers
+* were we to only sample TD_AWAITING_INTR() every tick.
+*/
thread_lock(td);
-   mtx = td-td_lock;
if (!TD_AWAITING_INTR(td)) {
ithd-it_flags |= IT_WAIT;
-   msleep_spin(ithd, mtx, isync, 0);
+   while (ithd-it_flags  IT_WAIT) {
+   thread_unlock(td);
+   pause(idrain, 1);
+   thread_lock(td);
+   }
}
-   mtx_unlock_spin(mtx);
+   thread_unlock(td);
return;
 }
 

Modified: head/sys/ofed/include/linux/file.h
==
--- head/sys/ofed/include/linux/file.h  Tue Apr 26 04:52:35 2011
(r221054)
+++ head/sys/ofed/include/linux/file.h  Tue Apr 26 07:30:52 2011
(r221055)
@@ -92,7 +92,7 @@ get_unused_fd(void)
int error;
int fd;
 
-   error = falloc(curthread, file, fd);
+   error = falloc(curthread, file, fd, 0);
if (error)
return -error;
return fd;

Modified: head/sys/ofed/include/linux/workqueue.h
==
--- head/sys/ofed/include/linux/workqueue.h Tue Apr 26 04:52:35 2011
(r221054)
+++ head/sys/ofed/include/linux/workqueue.h Tue Apr 26 07:30:52 2011
(r221055)
@@ -160,9 +160,11 @@ flush_taskqueue(struct taskqueue *tq)
 {
struct task flushtask;
 
+   PHOLD(curproc);
TASK_INIT(flushtask, 0, _flush_fn, NULL);
taskqueue_enqueue(tq, flushtask);
taskqueue_drain(tq, flushtask);
+   PRELE(curproc);
 }
 
 static inline int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Pawel Jakub Dawidek
On Tue, Apr 26, 2011 at 10:19:55AM +0300, Alexander Motin wrote:
 On 26.04.2011 10:00, Pawel Jakub Dawidek wrote:
 On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote:
 I've thought about the process of fixing hardcoded provider names there,
 and it is absolutely not trivial. If we take the symlinking way (patch
 is already posted to current@), I think it will be much easier for
 everybody, and especially users, if I hack all mentioned above GEOM
 classes to ignore adX/adaY difference in provider names. And it should
 perfectly fit into remaining time window.
 
 Could you be more specific what the hack would do exactly?
 
 I would write some comparison function, which would search both
 names for adX/adaY prefixes, if they found on both arguments,
 trimmed them and compared remaining parts.
 
 I think for usual purpose of name hardcoding device name part is
 less important. Comparing partition names part should be enough. The
 tricky part there is to properly identify device part, so I was
 thinking about specific hack for adX/adaY.

I was wondering how would you match X and Y, but this is indeed not
important. So on taste we could do (totally untested):

static bool
provider_name_matches(const char *ppname, const char *hcname)
{

if (strcmp(ppname, hcname) == 0)
return (true);
if (strncmp(hcname, ad, 2) != 0 ||
hcname[2]  '0' || hcname[2]  '9') {
return (false);
}
if (strncmp(ppname, ada, 3) != 0 ||
ppname[3]  '0' || ppname[3]  '9') {
return (false);
}
/* Skip 'ad[0-9]+'. */
hcname += 3;
while (hcname[0] = '0'  hcname[0] = '9')
hcname++;
/* Skip 'ada[0-9]+'.
ppname += 4;
while (ppname[0] = '0'  ppname[0] = '9')
ppname++;

return (strcmp(ppname, hcname) == 0);
}

That could work.

Another possibility I was thinking of was to create GEOM providers for
both names and orphan the other name once one of them is opened for
writing.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://yomoli.com


pgpfCNMRsuX9G.pgp
Description: PGP signature


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Alexander Motin

On 26.04.2011 10:35, Pawel Jakub Dawidek wrote:

On Tue, Apr 26, 2011 at 10:19:55AM +0300, Alexander Motin wrote:

On 26.04.2011 10:00, Pawel Jakub Dawidek wrote:

On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote:

I've thought about the process of fixing hardcoded provider names there,
and it is absolutely not trivial. If we take the symlinking way (patch
is already posted to current@), I think it will be much easier for
everybody, and especially users, if I hack all mentioned above GEOM
classes to ignore adX/adaY difference in provider names. And it should
perfectly fit into remaining time window.


Could you be more specific what the hack would do exactly?


I would write some comparison function, which would search both
names for adX/adaY prefixes, if they found on both arguments,
trimmed them and compared remaining parts.

I think for usual purpose of name hardcoding device name part is
less important. Comparing partition names part should be enough. The
tricky part there is to properly identify device part, so I was
thinking about specific hack for adX/adaY.


I was wondering how would you match X and Y, but this is indeed not
important. So on taste we could do (totally untested):

static bool
provider_name_matches(const char *ppname, const char *hcname)
{

if (strcmp(ppname, hcname) == 0)
return (true);
if (strncmp(hcname, ad, 2) != 0 ||
hcname[2]  '0' || hcname[2]  '9') {
return (false);
}
if (strncmp(ppname, ada, 3) != 0 ||
ppname[3]  '0' || ppname[3]  '9') {
return (false);
}
/* Skip 'ad[0-9]+'. */
hcname += 3;
while (hcname[0]= '0'  hcname[0]= '9')
hcname++;
/* Skip 'ada[0-9]+'.
ppname += 4;
while (ppname[0]= '0'  ppname[0]= '9')
ppname++;

return (strcmp(ppname, hcname) == 0);
}

That could work.


Yes, I was thinking about something like that. May be just symmetric, so 
it could handle some cases of downgrade.



Another possibility I was thinking of was to create GEOM providers for
both names and orphan the other name once one of them is opened for
writing.


I've even implemented patch (posted on current@) with close idea (I was 
creating extra geom with legacy name), and it will have the same 
problem: if somebody open any partition on the device with the new name, 
all legacy names will become inaccessible (busy), and vice versa. It 
could be not a big problem if it would only be user's choice -- we could 
say just: use one or another, not both. But provider could be chosen 
blindly by some GEOM class, such as glabel, and then it turns into pure 
lottery.


--
Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Pawel Jakub Dawidek
On Tue, Apr 26, 2011 at 10:50:17AM +0300, Alexander Motin wrote:
 On 26.04.2011 10:35, Pawel Jakub Dawidek wrote:
 On Tue, Apr 26, 2011 at 10:19:55AM +0300, Alexander Motin wrote:
 On 26.04.2011 10:00, Pawel Jakub Dawidek wrote:
 On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote:
 I've thought about the process of fixing hardcoded provider names there,
 and it is absolutely not trivial. If we take the symlinking way (patch
 is already posted to current@), I think it will be much easier for
 everybody, and especially users, if I hack all mentioned above GEOM
 classes to ignore adX/adaY difference in provider names. And it should
 perfectly fit into remaining time window.
 
 Could you be more specific what the hack would do exactly?
 
 I would write some comparison function, which would search both
 names for adX/adaY prefixes, if they found on both arguments,
 trimmed them and compared remaining parts.
 
 I think for usual purpose of name hardcoding device name part is
 less important. Comparing partition names part should be enough. The
 tricky part there is to properly identify device part, so I was
 thinking about specific hack for adX/adaY.
 
 I was wondering how would you match X and Y, but this is indeed not
 important. So on taste we could do (totally untested):
 
 static bool
 provider_name_matches(const char *ppname, const char *hcname)
 {
 
  if (strcmp(ppname, hcname) == 0)
  return (true);
  if (strncmp(hcname, ad, 2) != 0 ||
  hcname[2]  '0' || hcname[2]  '9') {
  return (false);
  }
  if (strncmp(ppname, ada, 3) != 0 ||
  ppname[3]  '0' || ppname[3]  '9') {
  return (false);
  }
  /* Skip 'ad[0-9]+'. */
  hcname += 3;
  while (hcname[0]= '0'  hcname[0]= '9')
  hcname++;
  /* Skip 'ada[0-9]+'.
  ppname += 4;
  while (ppname[0]= '0'  ppname[0]= '9')
  ppname++;
 
  return (strcmp(ppname, hcname) == 0);
 }
 
 That could work.
 
 Yes, I was thinking about something like that. May be just
 symmetric, so it could handle some cases of downgrade.

Ok, so this will handle hardcoded provider names. I think this is good
enough.

Now, what about fstab? There is a problem to figure out which disk we
booted from once we enter the kernel. I was wondering if we could detect
that someone is trying to mount root which from 'ad[0-9]+X' and
then we could scan all ada[0-9]+X looking for UFS file system and
/etc/fstab in there and / entry which matches vfs.root.mountfrom variable.
This should cover 99% of cases. 1% is for cases where another disk have
identical partitioning scheme and /etc/fstab file. There also might be
cases where someone defines vfs.root.mountfrom in /boot/loader.conf and
doesn't really use /etc/fstab.

 Another possibility I was thinking of was to create GEOM providers for
 both names and orphan the other name once one of them is opened for
 writing.
 
 I've even implemented patch (posted on current@) with close idea (I
 was creating extra geom with legacy name), and it will have the same
 problem: if somebody open any partition on the device with the new
 name, all legacy names will become inaccessible (busy), and vice
 versa. It could be not a big problem if it would only be user's
 choice -- we could say just: use one or another, not both. But
 provider could be chosen blindly by some GEOM class, such as glabel,
 and then it turns into pure lottery.

Good point.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://yomoli.com


pgpGT9bP9O3pb.pgp
Description: PGP signature


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Alexander Motin

On 26.04.2011 11:02, Pawel Jakub Dawidek wrote:

Now, what about fstab? There is a problem to figure out which disk we
booted from once we enter the kernel. I was wondering if we could detect
that someone is trying to mount root which from 'ad[0-9]+X' and
then we could scan all ada[0-9]+X  looking for UFS file system and
/etc/fstab in there and / entry which matches vfs.root.mountfrom variable.
This should cover 99% of cases. 1% is for cases where another disk have
identical partitioning scheme and /etc/fstab file. There also might be
cases where someone defines vfs.root.mountfrom in /boot/loader.conf and
doesn't really use /etc/fstab.


I think it will be unpredictable. Many disks may have s1a and especially 
s1d.


What do you think about this:
http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901
? I've found that zpool utility don't likes symbolic links, but except 
this and together with fixing hardcoding problem IMHO it looks not bad.


--
Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Pawel Jakub Dawidek
On Tue, Apr 26, 2011 at 11:18:06AM +0300, Alexander Motin wrote:
 What do you think about this:
 http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901
 ? I've found that zpool utility don't likes symbolic links, but
 except this and together with fixing hardcoding problem IMHO it
 looks not bad.

It does look good, indeed.

What's the problem with zpool? It should operate on GEOM providers only.
Also, ZFS should not be affected by providers name changes.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://yomoli.com


pgpY4srdbkuXs.pgp
Description: PGP signature


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Alexander Motin

On 26.04.2011 11:34, Pawel Jakub Dawidek wrote:

On Tue, Apr 26, 2011 at 11:18:06AM +0300, Alexander Motin wrote:

What do you think about this:
http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901
? I've found that zpool utility don't likes symbolic links, but
except this and together with fixing hardcoding problem IMHO it
looks not bad.


It does look good, indeed.

What's the problem with zpool?


make_dev_alias() creates symlink to the original device. After that, 
attempt to do `zpool create test /dev/ad12 /dev/ad13` fails. May be 
because it doesn't resolve symlink and can't find geom with name ad12.



It should operate on GEOM providers only.


OK. If `zpool create` is the only possible problem there, then I think 
we can live with it.


--
Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf

2011-04-26 Thread Pawel Jakub Dawidek
On Tue, Apr 26, 2011 at 11:45:37AM +0300, Alexander Motin wrote:
 On 26.04.2011 11:34, Pawel Jakub Dawidek wrote:
 On Tue, Apr 26, 2011 at 11:18:06AM +0300, Alexander Motin wrote:
 What do you think about this:
 http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901
 ? I've found that zpool utility don't likes symbolic links, but
 except this and together with fixing hardcoding problem IMHO it
 looks not bad.
 
 It does look good, indeed.
 
 What's the problem with zpool?
 
 make_dev_alias() creates symlink to the original device. After that,
 attempt to do `zpool create test /dev/ad12 /dev/ad13` fails. May be
 because it doesn't resolve symlink and can't find geom with name
 ad12.

IIRC zpool go straight to GEOM providers and doesn't even look into
/dev/. Feel free to ignore this issue. Actually I think it is even
better as people will notice that they should not use legacy names.

 It should operate on GEOM providers only.
 
 OK. If `zpool create` is the only possible problem there, then I
 think we can live with it.

I agree.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://yomoli.com


pgp1saQkv5dbM.pgp
Description: PGP signature


Re: svn commit: r221053 - head/usr.bin/rlogin

2011-04-26 Thread Gavin Atkinson
On Tue, 2011-04-26 at 04:09 +, David E. O'Brien wrote:
 Author: obrien
 Date: Tue Apr 26 04:09:20 2011
 New Revision: 221053
 URL: http://svn.freebsd.org/changeset/base/221053
 
 Log:
   This builds OK using the parent dir's WARNS=6.
   [built on both AMD64 and i386]

As a general rule, just compiling on i386 and amd64 are not sufficient
to test WARNS bumps.  It's usually sufficient to also crossbuild to a
platform like sparc64 which has stricter alignment, but for a full test
a make universe is best, as this will also catch other issues (for
example arm, where char is unsigned).

Thanks,

Gavin


-- 
Gavin Atkinson
FreeBSD committer and bugmeister
GPG: A093262B (313A A79F 697D 3A5C 216A  EDF5 935D EF44 A093 262B)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221059 - in head/sys: kern sys

2011-04-26 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 26 11:39:56 2011
New Revision: 221059
URL: http://svn.freebsd.org/changeset/base/221059

Log:
  Implement the delayed task execution extension to the taskqueue
  mechanism. The caller may specify a timeout in ticks after which the
  task will be scheduled.
  
  Sponsored by: The FreeBSD Foundation
  Reviewed by:  jeff, jhb
  MFC after:1 month

Added:
  head/sys/sys/_callout.h
 - copied, changed from r221058, head/sys/sys/callout.h
Modified:
  head/sys/kern/subr_taskqueue.c
  head/sys/sys/callout.h
  head/sys/sys/taskqueue.h

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Tue Apr 26 10:02:15 2011
(r221058)
+++ head/sys/kern/subr_taskqueue.c  Tue Apr 26 11:39:56 2011
(r221059)
@@ -61,12 +61,15 @@ struct taskqueue {
int tq_tcount;
int tq_spin;
int tq_flags;
+   int tq_callouts;
 };
 
 #defineTQ_FLAGS_ACTIVE (1  0)
 #defineTQ_FLAGS_BLOCKED(1  1)
 #defineTQ_FLAGS_PENDING(1  2)
 
+#defineDT_CALLOUT_ARMED(1  0)
+
 #defineTQ_LOCK(tq) 
\
do {\
if ((tq)-tq_spin)  \
@@ -83,6 +86,17 @@ struct taskqueue {
mtx_unlock((tq)-tq_mutex);\
} while (0)
 
+void
+_timeout_task_init(struct taskqueue *queue, struct timeout_task *timeout_task,
+int priority, task_fn_t func, void *context)
+{
+
+   TASK_INIT(timeout_task-t, priority, func, context);
+   callout_init_mtx(timeout_task-c, queue-tq_mutex, 0);
+   timeout_task-q = queue;
+   timeout_task-f = 0;
+}
+
 static __inline int
 TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm,
 int t)
@@ -129,7 +143,7 @@ static void
 taskqueue_terminate(struct thread **pp, struct taskqueue *tq)
 {
 
-   while (tq-tq_tcount  0) {
+   while (tq-tq_tcount  0 || tq-tq_callouts  0) {
wakeup(tq);
TQ_SLEEP(tq, pp, tq-tq_mutex, PWAIT, taskqueue_destroy, 0);
}
@@ -143,26 +157,24 @@ taskqueue_free(struct taskqueue *queue)
queue-tq_flags = ~TQ_FLAGS_ACTIVE;
taskqueue_terminate(queue-tq_threads, queue);
KASSERT(TAILQ_EMPTY(queue-tq_active), (Tasks still running?));
+   KASSERT(queue-tq_callouts == 0, (Armed timeout tasks));
mtx_destroy(queue-tq_mutex);
free(queue-tq_threads, M_TASKQUEUE);
free(queue, M_TASKQUEUE);
 }
 
-int
-taskqueue_enqueue(struct taskqueue *queue, struct task *task)
+static int
+taskqueue_enqueue_locked(struct taskqueue *queue, struct task *task)
 {
struct task *ins;
struct task *prev;
 
-   TQ_LOCK(queue);
-
/*
 * Count multiple enqueues.
 */
if (task-ta_pending) {
task-ta_pending++;
-   TQ_UNLOCK(queue);
-   return 0;
+   return (0);
}
 
/*
@@ -190,9 +202,60 @@ taskqueue_enqueue(struct taskqueue *queu
else
queue-tq_flags |= TQ_FLAGS_PENDING;
 
+   return (0);
+}
+int
+taskqueue_enqueue(struct taskqueue *queue, struct task *task)
+{
+   int res;
+
+   TQ_LOCK(queue);
+   res = taskqueue_enqueue_locked(queue, task);
TQ_UNLOCK(queue);
 
-   return 0;
+   return (res);
+}
+
+static void
+taskqueue_timeout_func(void *arg)
+{
+   struct taskqueue *queue;
+   struct timeout_task *timeout_task;
+
+   timeout_task = arg;
+   queue = timeout_task-q;
+   KASSERT((timeout_task-f  DT_CALLOUT_ARMED) != 0, (Stray timeout));
+   timeout_task-f = ~DT_CALLOUT_ARMED;
+   queue-tq_callouts--;
+   taskqueue_enqueue_locked(timeout_task-q, timeout_task-t);
+}
+
+int
+taskqueue_enqueue_timeout(struct taskqueue *queue,
+struct timeout_task *timeout_task, int ticks)
+{
+   int res;
+
+   TQ_LOCK(queue);
+   KASSERT(timeout_task-q == NULL || timeout_task-q == queue,
+   (Migrated queue));
+   KASSERT(!queue-tq_spin, (Timeout for spin-queue));
+   timeout_task-q = queue;
+   res = timeout_task-t.ta_pending;
+   if (ticks == 0) {
+   taskqueue_enqueue_locked(queue, timeout_task-t);
+   } else {
+   if ((timeout_task-f  DT_CALLOUT_ARMED) != 0) {
+   res++;
+   } else {
+   queue-tq_callouts++;
+   timeout_task-f |= DT_CALLOUT_ARMED;
+   }
+   callout_reset(timeout_task-c, ticks, taskqueue_timeout_func,
+   timeout_task);
+   }
+   TQ_UNLOCK(queue);
+   return (res);
 }
 
 void
@@ -271,6 +334,19 @@ 

svn commit: r221060 - head/share/man/man9

2011-04-26 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 26 11:43:57 2011
New Revision: 221060
URL: http://svn.freebsd.org/changeset/base/221060

Log:
  Document timeout_task.
  
  While there, fix the type of the func argument of INIT_TASK macro,
  and use the modern name of the analogous facility from Linux kernel.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 month

Modified:
  head/share/man/man9/taskqueue.9

Modified: head/share/man/man9/taskqueue.9
==
--- head/share/man/man9/taskqueue.9 Tue Apr 26 11:39:56 2011
(r221059)
+++ head/share/man/man9/taskqueue.9 Tue Apr 26 11:43:57 2011
(r221060)
@@ -28,7 +28,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 18, 2009
+.Dd April 26, 2011
 .Dt TASKQUEUE 9
 .Os
 .Sh NAME
@@ -52,6 +52,8 @@ struct task {
task_fn_t   ta_func;/* task handler */
void*ta_context;/* argument for handler */
 };
+
+struct timeout_task;
 .Ed
 .Ft struct taskqueue *
 .Fn taskqueue_create const char *name int mflags taskqueue_enqueue_fn 
enqueue void *context
@@ -64,19 +66,26 @@ struct task {
 .Ft int
 .Fn taskqueue_enqueue_fast struct taskqueue *queue struct task *task
 .Ft int
+.Fn taskqueue_enqueue_timeout struct taskqueue *queue struct timeout_task 
*timeout_task int ticks
+.Ft int
 .Fn taskqueue_cancel struct taskqueue *queue struct task *task u_int 
*pendp
+.Ft int
+.Fn taskqueue_cancel_timeout struct taskqueue *queue struct timeout_task 
*timeout_task u_int *pendp
 .Ft void
 .Fn taskqueue_drain struct taskqueue *queue struct task *task
+.Ft void
+.Fn taskqueue_drain_timeout struct taskqueue *queue struct timeout_task 
*timeout_task
 .Ft int
 .Fn taskqueue_member struct taskqueue *queue struct thread *td
 .Ft void
 .Fn taskqueue_run struct taskqueue *queue
-.Fn TASK_INIT struct task *task int priority task_fn_t *func void 
*context
+.Fn TASK_INIT struct task *task int priority task_fn_t func void 
*context
 .Fn TASKQUEUE_DECLARE name
 .Fn TASKQUEUE_DEFINE name taskqueue_enqueue_fn enqueue void *context 
init
 .Fn TASKQUEUE_FAST_DEFINE name taskqueue_enqueue_fn enqueue void 
*context init
 .Fn TASKQUEUE_DEFINE_THREAD name
 .Fn TASKQUEUE_FAST_DEFINE_THREAD name
+.Fn TIMEOUT_TASK_INIT struct taskqueue *queue struct timeout_task 
*timeout_task int priority task_fn_t func void *context
 .Sh DESCRIPTION
 These functions provide a simple interface for asynchronous execution
 of code.
@@ -164,6 +173,14 @@ is called on the task pointer passed to
 .Fn taskqueue_enqueue .
 .Pp
 The
+.Fn taskqueue_enqueue_timeout
+is used to schedule the enqueue after the specified amount of
+.Va ticks .
+Only non-fast task queues can be used for
+.Va timeout_task
+scheduling.
+.Pp
+The
 .Fn taskqueue_cancel
 function is used to cancel a task.
 The
@@ -188,9 +205,16 @@ Note that, as with
 the caller is responsible for ensuring that the task is not re-enqueued
 after being canceled.
 .Pp
+Similarly, the
+.Fn taskqueue_cancel_timeout
+function is used to cancel the scheduled task execution.
+.Pp
 The
 .Fn taskqueue_drain
-function is used to wait for the task to finish.
+function is used to wait for the task to finish, and
+the
+.Fn taskqueue_drain_timeout
+function is used to wait for the scheduled task to finish.
 There is no guarantee that the task will not be
 enqueued after call to
 .Fn taskqueue_drain .
@@ -218,6 +242,9 @@ A convenience macro,
 is provided to initialise a
 .Va task
 structure.
+A macro
+.Fn TIMEOUT_TASK_INIT queue timeout_task priority func context
+initializes the timeout_task structure.
 The values of
 .Va priority ,
 .Va func ,
@@ -342,7 +369,7 @@ be created with a dedicated processing t
 .Sh HISTORY
 This interface first appeared in
 .Fx 5.0 .
-There is a similar facility called tqueue in the Linux kernel.
+There is a similar facility called work_queue in the Linux kernel.
 .Sh AUTHORS
 This manual page was written by
 .An Doug Rabson .
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r221059 - in head/sys: kern sys

2011-04-26 Thread Kostik Belousov
On Tue, Apr 26, 2011 at 01:44:00PM +0200, Hans Petter Selasky wrote:
 On Tuesday 26 April 2011 13:39:56 Konstantin Belousov wrote:
  +   pending = !!callout_stop(timeout_task-c);
 
 pending = (callout_stop(timeout_task-c) != 0);
 
 ?

This line is about conversion from a boolean value to {0, 1} value set.
If !! construct does not look stylish, then wouldn't we need to go
with
pending = (callout_stop(timeout_task-c) != 0) ? 1 : 0;
instead ?

Feel free to adjust whatever variant you prefer and commit it.


pgp2WJcYRFZ8V.pgp
Description: PGP signature


Re: svn commit: r221059 - in head/sys: kern sys

2011-04-26 Thread Hans Petter Selasky
On Tuesday 26 April 2011 13:53:33 Kostik Belousov wrote:
 On Tue, Apr 26, 2011 at 01:44:00PM +0200, Hans Petter Selasky wrote:
  On Tuesday 26 April 2011 13:39:56 Konstantin Belousov wrote:
   +   pending = !!callout_stop(timeout_task-c);
  
  pending = (callout_stop(timeout_task-c) != 0);
  
  ?

Hi,

This is just a nit I noticed.

 
 This line is about conversion from a boolean value to {0, 1} value set.
 If !! construct does not look stylish, then wouldn't we need to go
 with
   pending = (callout_stop(timeout_task-c) != 0) ? 1 : 0;
 instead ?

The output from ! is already a boolean and pending is a u_int, so to be 
correct it should be similar to what you suggest. I'm not sure what case 
produce the less amount of code and which the compiler understands the best. 
Probably it does not matter that much.

I was thinking that !! is depreceated, but man style is silent about it.

 Feel free to adjust whatever variant you prefer and commit it.

Ok.

--HPS
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r221053 - head/usr.bin/rlogin

2011-04-26 Thread John Baldwin
On Tuesday, April 26, 2011 12:09:20 am David E. O'Brien wrote:
 Author: obrien
 Date: Tue Apr 26 04:09:20 2011
 New Revision: 221053
 URL: http://svn.freebsd.org/changeset/base/221053
 
 Log:
   This builds OK using the parent dir's WARNS=6.
   [built on both AMD64 and i386]

This breaks the tinderbox on at least arm, ia64, mips, and sparc64.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r221053 - head/usr.bin/rlogin

2011-04-26 Thread Warner Losh

On Apr 26, 2011, at 3:57 AM, Gavin Atkinson wrote:

 On Tue, 2011-04-26 at 04:09 +, David E. O'Brien wrote:
 Author: obrien
 Date: Tue Apr 26 04:09:20 2011
 New Revision: 221053
 URL: http://svn.freebsd.org/changeset/base/221053
 
 Log:
  This builds OK using the parent dir's WARNS=6.
  [built on both AMD64 and i386]
 
 As a general rule, just compiling on i386 and amd64 are not sufficient
 to test WARNS bumps.  It's usually sufficient to also crossbuild to a
 platform like sparc64 which has stricter alignment, but for a full test
 a make universe is best, as this will also catch other issues (for
 example arm, where char is unsigned).

I read the test log as not really tested, feel free to back it out if it fails 
on a different architecture

:)

Warner

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221066 - in head/sys: fs/nfsclient nfsclient

2011-04-26 Thread Rick Macklem
Author: rmacklem
Date: Tue Apr 26 13:50:11 2011
New Revision: 221066
URL: http://svn.freebsd.org/changeset/base/221066

Log:
  Fix a kernel linking problem introduced by r221032, r221040
  when building kernels that don't have options NFS_ROOT
  specified. I plan on moving the functions that use these
  data structures into the shared code in sys/nfs/nfs_diskless.c
  in a future commit. At that time, these definitions will no
  longer be needed in nfs_vfsops.c and nfs_clvfsops.c.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/nfsclient/nfs_vfsops.c

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cTue Apr 26 13:09:54 2011
(r221065)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cTue Apr 26 13:50:11 2011
(r221066)
@@ -137,10 +137,17 @@ VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK
 MODULE_VERSION(newnfs, 1);
 
 /*
- * This structure must be filled in by a primary bootstrap or bootstrap
- * server for a diskless/dataless machine. It is initialized below just
- * to ensure that it is allocated to initialized data (.data not .bss).
+ * This structure is now defined in sys/nfs/nfs_diskless.c so that it
+ * can be shared by both NFS clients. It is declared here so that it
+ * will be defined for kernels built without NFS_ROOT, although it
+ * isn't used in that case.
  */
+#if !defined(NFS_ROOT)  !defined(NFSCLIENT)
+struct nfs_disklessnfs_diskless = { { { 0 } } };
+struct nfsv3_diskless  nfsv3_diskless = { { { 0 } } };
+intnfs_diskless_valid = 0;
+#endif
+
 SYSCTL_INT(_vfs_newnfs, OID_AUTO, diskless_valid, CTLFLAG_RD,
 nfs_diskless_valid, 0,
 Has the diskless struct been filled correctly);

Modified: head/sys/nfsclient/nfs_vfsops.c
==
--- head/sys/nfsclient/nfs_vfsops.c Tue Apr 26 13:09:54 2011
(r221065)
+++ head/sys/nfsclient/nfs_vfsops.c Tue Apr 26 13:50:11 2011
(r221066)
@@ -164,6 +164,18 @@ static struct nfs_rpcops nfs_rpcops = {
nfs_commit,
 };
 
+/*
+ * This structure is now defined in sys/nfs/nfs_diskless.c so that it
+ * can be shared by both NFS clients. It is declared here so that it
+ * will be defined for kernels built without NFS_ROOT, although it
+ * isn't used in that case.
+ */
+#ifndef NFS_ROOT
+struct nfs_disklessnfs_diskless = { { { 0 } } };
+struct nfsv3_diskless  nfsv3_diskless = { { { 0 } } };
+intnfs_diskless_valid = 0;
+#endif
+
 SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD,
 nfs_diskless_valid, 0,
 Has the diskless struct been filled correctly);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221069 - head/sys/amd64/amd64

2011-04-26 Thread Maxim Sobolev
Author: sobomax
Date: Tue Apr 26 16:14:55 2011
New Revision: 221069
URL: http://svn.freebsd.org/changeset/base/221069

Log:
  With the typical memory size of the system in tenth of gigabytes
  counting memory being dumped in 16MB increments is somewhat silly.
  Especially if the dump fails and everything you've got for debugging
  is screen filled with numbers in 16 decrements... Replace that with
  percentage-based progress with max 10 updates all fitting into one
  line.
  
  Collapse other very useful piece of crash information (total ram) into
  the same line to save some more space.
  
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/minidump_machdep.c

Modified: head/sys/amd64/amd64/minidump_machdep.c
==
--- head/sys/amd64/amd64/minidump_machdep.c Tue Apr 26 15:11:13 2011
(r221068)
+++ head/sys/amd64/amd64/minidump_machdep.c Tue Apr 26 16:14:55 2011
(r221069)
@@ -62,7 +62,7 @@ static off_t dumplo;
 /* Handle chunked writes. */
 static size_t fragsz;
 static void *dump_va;
-static size_t counter, progress;
+static size_t counter, progress, dumpsize;
 
 CTASSERT(sizeof(*vm_page_dump) == 8);
 
@@ -94,6 +94,40 @@ blk_flush(struct dumperinfo *di)
return (error);
 }
 
+static struct {
+   int min_per;
+   int max_per;
+   int visited;
+} progress_track[10] = {
+   {  0,  10, 0},
+   { 10,  20, 0},
+   { 20,  30, 0},
+   { 30,  40, 0},
+   { 40,  50, 0},
+   { 50,  60, 0},
+   { 60,  70, 0},
+   { 70,  80, 0},
+   { 80,  90, 0},
+   { 90, 100, 0}
+};
+
+static void
+report_progress(size_t progress, size_t dumpsize)
+{
+   int sofar, i;
+
+   sofar = 100 - ((progress * 100) / dumpsize);
+   for (i = 0; i  10; i++) {
+   if (sofar  progress_track[i].min_per || sofar  
progress_track[i].max_per)
+   continue;
+   if (progress_track[i].visited)
+   return;
+   progress_track[i].visited = 1;
+   printf(..%d%%, sofar);
+   return;
+   }
+}
+
 static int
 blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
 {
@@ -130,7 +164,7 @@ blk_write(struct dumperinfo *di, char *p
counter += len;
progress -= len;
if (counter  24) {
-   printf( %ld, PG2MB(progress  PAGE_SHIFT));
+   report_progress(progress, dumpsize);
counter = (124) - 1;
}
if (ptr) {
@@ -170,7 +204,6 @@ static pd_entry_t fakepd[NPDEPG];
 void
 minidumpsys(struct dumperinfo *di)
 {
-   uint64_t dumpsize;
uint32_t pmapsize;
vm_offset_t va;
int error;
@@ -290,8 +323,8 @@ minidumpsys(struct dumperinfo *di)
 
mkdumpheader(kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, 
di-blocksize);
 
-   printf(Physical memory: %ju MB\n, ptoa((uintmax_t)physmem) / 1048576);
-   printf(Dumping %llu MB:, (long long)dumpsize  20);
+   printf(Dumping %llu out of %ju MB:, (long long)dumpsize  20,
+   ptoa((uintmax_t)physmem) / 1048576);
 
/* Dump leader */
error = dump_write(di, kdh, 0, dumplo, sizeof(kdh));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221071 - in head: . sys/amd64/conf sys/arm/conf sys/cam sys/cam/ata sys/conf sys/geom sys/i386/conf sys/mips/conf sys/modules/cam sys/pc98/conf

2011-04-26 Thread Alexander Motin
Author: mav
Date: Tue Apr 26 17:01:49 2011
New Revision: 221071
URL: http://svn.freebsd.org/changeset/base/221071

Log:
   - Add shim to simplify migration to the CAM-based ATA. For each new adaX
  device in /dev/ create symbolic link with adY name, trying to mimic old ATA
  numbering. Imitation is not complete, but should be enough in most cases to
  mount file systems without touching /etc/fstab.
   - To know what behavior to mimic, restore ATA_STATIC_ID option in cases
  where it was present before.
   - Add some more details to UPDATING.

Modified:
  head/UPDATING
  head/sys/amd64/conf/GENERIC
  head/sys/arm/conf/CRB
  head/sys/arm/conf/EP80219
  head/sys/arm/conf/IQ31244
  head/sys/cam/ata/ata_da.c
  head/sys/cam/cam_xpt.c
  head/sys/cam/cam_xpt.h
  head/sys/conf/NOTES
  head/sys/geom/geom_dev.c
  head/sys/i386/conf/GENERIC
  head/sys/i386/conf/XBOX
  head/sys/mips/conf/OCTEON1
  head/sys/mips/conf/std.SWARM
  head/sys/modules/cam/Makefile
  head/sys/pc98/conf/GENERIC

Modified: head/UPDATING
==
--- head/UPDATING   Tue Apr 26 16:56:43 2011(r221070)
+++ head/UPDATING   Tue Apr 26 17:01:49 2011(r221071)
@@ -30,7 +30,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
them respectively (adX - adaY, acdX - cdY, afdX - daY, astX - saY,
where 'Y's are the sequential numbers starting from zero for each type
in order of detection, unless configured otherwise with tunables,
-   see cam(4)).
+   see cam(4)). There will be symbolic links created in /dev/ to map
+   old adX devices to the respective adaY. They should provide basic
+   compatibility for file systems mounting in most cases, but they do
+   not support old user-level APIs and do not have respective providers
+   in GEOM. Consider using updated management tools with new device names.
+
+   It is possible to load devices ahci, ata, siis and mvs as modules,
+   but option ATA_CAM should remain in kernel configuration to make ata
+   module work as CAM driver supporting legacy ATA controllers. Device ata
+   still can be used in modular fashion (atacore + ...). Modules atadisk
+   and atapi* are not used and won't affect operation in ATA_CAM mode.
 
ataraid(4) functionality is now supported by the RAID GEOM class.
To use it you can load geom_raid kernel module and use graid(8) tool
@@ -49,7 +59,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
device atapicd # ATAPI CDROM drives
device atapifd # ATAPI floppy drives
device atapist # ATAPI tape drives
-   optionsATA_STATIC_ID   # Static device numbering
 
 20110423:
The default NFS server has been changed to the new server, which

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Tue Apr 26 16:56:43 2011(r221070)
+++ head/sys/amd64/conf/GENERIC Tue Apr 26 17:01:49 2011(r221071)
@@ -93,6 +93,7 @@ devicefdc
 device ahci# AHCI-compatible SATA controllers
 device ata # Legacy ATA/SATA controllers
 optionsATA_CAM # Handle legacy controllers with CAM
+optionsATA_STATIC_ID   # Static device numbering
 device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA
 device siis# SiliconImage SiI3124/SiI3132/SiI3531 SATA
 

Modified: head/sys/arm/conf/CRB
==
--- head/sys/arm/conf/CRB   Tue Apr 26 16:56:43 2011(r221070)
+++ head/sys/arm/conf/CRB   Tue Apr 26 17:01:49 2011(r221071)
@@ -74,6 +74,7 @@ devicepci
 
 device ata
 optionsATA_CAM
+optionsATA_STATIC_ID   # Static device numbering
 
 device scbus   # SCSI bus (required for ATA/SCSI)
 device cd  # CD

Modified: head/sys/arm/conf/EP80219
==
--- head/sys/arm/conf/EP80219   Tue Apr 26 16:56:43 2011(r221070)
+++ head/sys/arm/conf/EP80219   Tue Apr 26 17:01:49 2011(r221071)
@@ -74,6 +74,7 @@ devicepci
 
 device ata
 optionsATA_CAM
+optionsATA_STATIC_ID   # Static device numbering
 
 device scbus   # SCSI bus (required for ATA/SCSI)
 device cd  # CD

Modified: head/sys/arm/conf/IQ31244
==
--- head/sys/arm/conf/IQ31244   Tue Apr 26 16:56:43 2011(r221070)
+++ head/sys/arm/conf/IQ31244   Tue Apr 26 17:01:49 2011(r221071)
@@ -73,6 +73,7 @@ devicepci
 
 device ata
 optionsATA_CAM
+optionsATA_STATIC_ID  

svn commit: r221073 - head/sys/dev/usb/controller

2011-04-26 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Apr 26 18:50:35 2011
New Revision: 221073
URL: http://svn.freebsd.org/changeset/base/221073

Log:
  Fix for missing EHCI datatoggle change case.
  
  Reported by:  Mike Tancsa
  MFC after:3 days
  Approved by:  thompsa (mentor)

Modified:
  head/sys/dev/usb/controller/ehci.c

Modified: head/sys/dev/usb/controller/ehci.c
==
--- head/sys/dev/usb/controller/ehci.c  Tue Apr 26 18:18:10 2011
(r221072)
+++ head/sys/dev/usb/controller/ehci.c  Tue Apr 26 18:50:35 2011
(r221073)
@@ -1196,6 +1196,8 @@ ehci_data_toggle_update(struct usb_xfer 
dt ^= 1;/* short packet at the end */
else if (actlen != xlen)
dt ^= 1;/* zero length packet at the end */
+   else if (xlen == 0)
+   dt ^= 1;/* zero length transfer */
 
xfer-endpoint-toggle_next ^= dt;
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r221071 - in head: . sys/amd64/conf sys/arm/conf sys/cam sys/cam/ata sys/conf sys/geom sys/i386/conf sys/mips/conf sys/modules/cam sys/pc98/conf

2011-04-26 Thread Robert Watson

On Tue, 26 Apr 2011, Alexander Motin wrote:


  - Add shim to simplify migration to the CAM-based ATA. For each new adaX
 device in /dev/ create symbolic link with adY name, trying to mimic old ATA
 numbering. Imitation is not complete, but should be enough in most cases to
 mount file systems without touching /etc/fstab.
  - To know what behavior to mimic, restore ATA_STATIC_ID option in cases
 where it was present before.
  - Add some more details to UPDATING.


Thanks for working on this!  I'll give it a spin on some of my test boxes next 
week and see how it works out.


Robert
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221074 - head/sbin/hastctl

2011-04-26 Thread Mikolaj Golub
Author: trociny
Date: Tue Apr 26 19:11:15 2011
New Revision: 221074
URL: http://svn.freebsd.org/changeset/base/221074

Log:
  Fix assert messages.
  
  Approved by:  pjd (mentor)

Modified:
  head/sbin/hastctl/hastctl.c

Modified: head/sbin/hastctl/hastctl.c
==
--- head/sbin/hastctl/hastctl.c Tue Apr 26 18:50:35 2011(r221073)
+++ head/sbin/hastctl/hastctl.c Tue Apr 26 19:11:15 2011(r221074)
@@ -465,7 +465,7 @@ main(int argc, char *argv[])
}
break;
default:
-   assert(!Impossible role!);
+   assert(!Impossible command!);
}
 
/* Setup control connection... */
@@ -512,7 +512,7 @@ main(int argc, char *argv[])
error = control_status(nv);
break;
default:
-   assert(!Impossible role!);
+   assert(!Impossible command!);
}
 
exit(error);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221075 - head/sbin/hastd

2011-04-26 Thread Mikolaj Golub
Author: trociny
Date: Tue Apr 26 19:22:54 2011
New Revision: 221075
URL: http://svn.freebsd.org/changeset/base/221075

Log:
  For conversation between hastctl and hastd we should use HASTCTL_CMD
  defines.
  
  Approved by:  pjd (mentor)
  MFC after:1 week

Modified:
  head/sbin/hastd/control.c

Modified: head/sbin/hastd/control.c
==
--- head/sbin/hastd/control.c   Tue Apr 26 19:11:15 2011(r221074)
+++ head/sbin/hastd/control.c   Tue Apr 26 19:22:54 2011(r221075)
@@ -324,7 +324,7 @@ control_handle(struct hastd_config *cfg)
error = EHAST_INVALID;
goto fail;
}
-   if (cmd == HASTCTL_SET_ROLE) {
+   if (cmd == HASTCTL_CMD_SETROLE) {
role = nv_get_uint8(nvin, role);
switch (role) {
case HAST_ROLE_INIT:
@@ -345,11 +345,11 @@ control_handle(struct hastd_config *cfg)
ii = 0;
TAILQ_FOREACH(res, cfg-hc_resources, hr_next) {
switch (cmd) {
-   case HASTCTL_SET_ROLE:
+   case HASTCTL_CMD_SETROLE:
control_set_role_common(cfg, nvout, role, res,
res-hr_name, ii++);
break;
-   case HASTCTL_STATUS:
+   case HASTCTL_CMD_STATUS:
control_status(cfg, nvout, res, res-hr_name,
ii++);
break;
@@ -368,11 +368,11 @@ control_handle(struct hastd_config *cfg)
if (str == NULL)
break;
switch (cmd) {
-   case HASTCTL_SET_ROLE:
+   case HASTCTL_CMD_SETROLE:
control_set_role_common(cfg, nvout, role, NULL,
str, ii);
break;
-   case HASTCTL_STATUS:
+   case HASTCTL_CMD_STATUS:
control_status(cfg, nvout, NULL, str, ii);
break;
default:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221076 - head/sbin/hastd

2011-04-26 Thread Mikolaj Golub
Author: trociny
Date: Tue Apr 26 19:38:30 2011
New Revision: 221076
URL: http://svn.freebsd.org/changeset/base/221076

Log:
  Rename HASTCTL_ defines, which are used for conversion between main
  hastd process and workers, remove unused one and set different range
  of numbers. This is done in order not to confuse them with HASTCTL_CMD
  defines, used for conversation between hastctl and hastd, and to avoid
  bugs like the one fixed in in r221075.
  
  Approved by:  pjd (mentor)
  MFC after:1 week

Modified:
  head/sbin/hastd/control.c
  head/sbin/hastd/control.h
  head/sbin/hastd/hastd.c

Modified: head/sbin/hastd/control.c
==
--- head/sbin/hastd/control.c   Tue Apr 26 19:22:54 2011(r221075)
+++ head/sbin/hastd/control.c   Tue Apr 26 19:38:30 2011(r221076)
@@ -162,7 +162,7 @@ control_status_worker(struct hast_resour
 * Prepare and send command to worker process.
 */
cnvout = nv_alloc();
-   nv_add_uint8(cnvout, HASTCTL_STATUS, cmd);
+   nv_add_uint8(cnvout, CONTROL_STATUS, cmd);
error = nv_error(cnvout);
if (error != 0) {
pjdlog_common(LOG_ERR, 0, error,
@@ -427,7 +427,7 @@ ctrl_thread(void *arg)
}
nvout = nv_alloc();
switch (cmd) {
-   case HASTCTL_STATUS:
+   case CONTROL_STATUS:
if (res-hr_remotein != NULL 
res-hr_remoteout != NULL) {
nv_add_string(nvout, complete, status);
@@ -448,7 +448,7 @@ ctrl_thread(void *arg)
}
nv_add_int16(nvout, 0, error);
break;
-   case HASTCTL_RELOAD:
+   case CONTROL_RELOAD:
/*
 * When parent receives SIGHUP and discovers that
 * something related to us has changes, it sends reload

Modified: head/sbin/hastd/control.h
==
--- head/sbin/hastd/control.h   Tue Apr 26 19:22:54 2011(r221075)
+++ head/sbin/hastd/control.h   Tue Apr 26 19:38:30 2011(r221076)
@@ -32,9 +32,8 @@
 #ifndef_CONTROL_H_
 #define_CONTROL_H_
 
-#defineHASTCTL_SET_ROLE1
-#defineHASTCTL_STATUS  2
-#defineHASTCTL_RELOAD  3
+#defineCONTROL_STATUS  10
+#defineCONTROL_RELOAD  11
 
 struct hastd_config;
 struct hast_resource;

Modified: head/sbin/hastd/hastd.c
==
--- head/sbin/hastd/hastd.c Tue Apr 26 19:22:54 2011(r221075)
+++ head/sbin/hastd/hastd.c Tue Apr 26 19:38:30 2011(r221076)
@@ -424,7 +424,7 @@ resource_reload(const struct hast_resour
PJDLOG_ASSERT(res-hr_role == HAST_ROLE_PRIMARY);
 
nvout = nv_alloc();
-   nv_add_uint8(nvout, HASTCTL_RELOAD, cmd);
+   nv_add_uint8(nvout, CONTROL_RELOAD, cmd);
nv_add_string(nvout, res-hr_remoteaddr, remoteaddr);
nv_add_string(nvout, res-hr_sourceaddr, sourceaddr);
nv_add_int32(nvout, (int32_t)res-hr_replication, replication);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221077 - head/sys/dev/usb/net

2011-04-26 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Apr 26 19:40:37 2011
New Revision: 221077
URL: http://svn.freebsd.org/changeset/base/221077

Log:
  The maximum NCM frame size must be so that it
  will generate a short terminated USB transfer if
  the maximum NCM frame size is greater than what
  the driver can handle.
  
  Reported by:  Matthias Benesch
  MFC after:7 days
  Approved by:  thompsa (mentor)

Modified:
  head/sys/dev/usb/net/if_cdcereg.h

Modified: head/sys/dev/usb/net/if_cdcereg.h
==
--- head/sys/dev/usb/net/if_cdcereg.h   Tue Apr 26 19:38:30 2011
(r221076)
+++ head/sys/dev/usb/net/if_cdcereg.h   Tue Apr 26 19:40:37 2011
(r221077)
@@ -39,7 +39,7 @@
 #defineCDCE_IND_SIZE_MAX 32/* bytes */
 
 #defineCDCE_NCM_TX_MINLEN 512  /* bytes, must be power of two 
*/
-#defineCDCE_NCM_TX_MAXLEN (1UL  14)  /* bytes */
+#defineCDCE_NCM_TX_MAXLEN (16384 + 4)  /* bytes, must be short 
terminated */
 #defineCDCE_NCM_TX_FRAMES_MAX 8/* units */
 
 #defineCDCE_NCM_RX_MAXLEN (1UL  14)  /* bytes */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221088 - head/usr.bin/rlogin

2011-04-26 Thread Doug Barton
Author: dougb
Date: Tue Apr 26 22:02:51 2011
New Revision: 221088
URL: http://svn.freebsd.org/changeset/base/221088

Log:
  Revert r221053 by replacing WARNS?= 3 since it's breaking the build on
  several arches.

Modified:
  head/usr.bin/rlogin/Makefile

Modified: head/usr.bin/rlogin/Makefile
==
--- head/usr.bin/rlogin/MakefileTue Apr 26 21:47:38 2011
(r221087)
+++ head/usr.bin/rlogin/MakefileTue Apr 26 22:02:51 2011
(r221088)
@@ -7,4 +7,6 @@ BINOWN= root
 BINMODE=4555
 PRECIOUSPROG=
 
+WARNS?=3
+
 .include bsd.prog.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221092 - head/contrib/tzdata

2011-04-26 Thread Edwin Groothuis
Author: edwin
Date: Tue Apr 26 22:14:10 2011
New Revision: 221092
URL: http://svn.freebsd.org/changeset/base/221092

Log:
  MFV of tzdata2011g, 221089.
  
  - Egypt has cancelled the move to DST for now.

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/europe
  head/contrib/tzdata/southamerica
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==
--- head/contrib/tzdata/africa  Tue Apr 26 22:13:58 2011(r221091)
+++ head/contrib/tzdata/africa  Tue Apr 26 22:14:10 2011(r221092)
@@ -1,5 +1,5 @@
 # pre
-# @(#)africa   8.30
+# @(#)africa   8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -212,7 +212,21 @@ Rule   Egypt   1989only-   May  6  
1:001:00
 Rule   Egypt   19901994-   May  1  1:001:00S
 # IATA (after 1990) says transitions are at 0:00.
 # Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
-Rule   Egypt   1995max -   Apr lastFri  0:00s  1:00S
+
+# From Alexander Krivenyshev (2011-04-20):
+# ...Egypt's interim cabinet decided on Wednesday to cancel daylight
+# saving time after a poll posted on its website showed the majority of
+# Egyptians would approve the cancellation.
+#
+# Egypt to cancel daylight saving time
+# a href=http://www.almasryalyoum.com/en/node/407168;
+# http://www.almasryalyoum.com/en/node/407168
+# /a
+# or
+# a href=http://www.worldtimezone.com/dst_news/dst_news_egypt04.html;
+# http://www.worldtimezone.com/dst_news/dst_news_egypt04.html
+# /a
+Rule   Egypt   19952010-   Apr lastFri  0:00s  1:00S
 Rule   Egypt   19952005-   Sep lastThu 23:00s  0   -
 # From Steffen Thorsen (2006-09-19):
 # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
@@ -313,7 +327,7 @@ RuleEgypt   2008only-   Aug lastThu 
23:00
 Rule   Egypt   2009only-   Aug 20  23:00s  0   -
 Rule   Egypt   2010only-   Aug 11  0:000   -
 Rule   Egypt   2010only-   Sep 10  0:001:00S
-Rule   Egypt   2010max -   Sep lastThu 23:00s  0   -
+Rule   Egypt   2010only-   Sep lastThu 23:00s  0   -
 
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Africa/Cairo2:05:00 -   LMT 1900 Oct

Modified: head/contrib/tzdata/europe
==
--- head/contrib/tzdata/europe  Tue Apr 26 22:13:58 2011(r221091)
+++ head/contrib/tzdata/europe  Tue Apr 26 22:14:10 2011(r221092)
@@ -1,5 +1,5 @@
 # pre
-# @(#)europe   8.31
+# @(#)europe   8.32
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -146,7 +146,7 @@
 # A monument to Willett was unveiled on 1927-05-21, in an open space in
 # a 45-acre wood near Chislehurst, Kent that was purchased by popular
 # subscription and open to the public.  On the south face of the monolith,
-# designed by G. W. Miller, is the the William Willett Memorial Sundial,
+# designed by G. W. Miller, is the...William Willett Memorial Sundial,
 # which is permanently set to Summer Time.
 
 # From Winston Churchill (1934-04-28):
@@ -1786,7 +1786,7 @@ Zone  Europe/Oslo 0:43:00 -   LMT 1895 
Jan 
 #
 # All these events predate our cutoff date of 1970.  Unless we can
 # come up with more definitive info about the timekeeping during the
-# war years it's probably best just do do the following for now:
+# war years it's probably best just do...the following for now:
 Link   Europe/Oslo Arctic/Longyearbyen
 
 # Poland

Modified: head/contrib/tzdata/southamerica
==
--- head/contrib/tzdata/southamericaTue Apr 26 22:13:58 2011
(r221091)
+++ head/contrib/tzdata/southamericaTue Apr 26 22:14:10 2011
(r221092)
@@ -1,5 +1,5 @@
 # pre
-# @(#)southamerica 8.48
+# @(#)southamerica 8.49
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -745,7 +745,7 @@ ZoneAmerica/La_Paz  -4:32:36 -  LMT 1890
 #
 # As a result of the above Decree I believe the America/Rio_Branco
 # timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall
-# be created to represent the the west side of the Para State. I
+# be created to represent the...west side of the Para State. I
 # suggest this new timezone be called Santarem as the most
 # important/populated city in the affected area.
 #
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r221088 - head/usr.bin/rlogin

2011-04-26 Thread Doug Barton

On 04/26/2011 15:18, Andrew Thompson wrote:

On 27 April 2011 10:02, Doug Bartondo...@freebsd.org  wrote:

Author: dougb
Date: Tue Apr 26 22:02:51 2011
New Revision: 221088
URL: http://svn.freebsd.org/changeset/base/221088

Log:
  Revert r221053 by replacing WARNS?= 3 since it's breaking the build on
  several arches.


r221079 from jhb may have already fixed it.


Great, I'll let someone who cares do the testing to determine that. Once 
it's tested I have no objections to someone reverting my reversion. :)



Doug

--

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r220983 - head

2011-04-26 Thread Daniel O'Connor

On 26/04/2011, at 1:31, Warner Losh wrote:
 This is why I prefer IDs since they are nominally unique (UFS ones, GPTs 
 damn well better be :)
 
 Although I concede it is rather annoying to work out which is which, or type 
 them out manually..
 
 For things like ZFS, UUIDs aren't so bad because it hides them.

Yes, I use GPT with ZFS, it's good :)

 For things like /etc/fstab, I prefer the named approach.  This allows me to 
 survive a newfs on a partition if I have to without having to hack my 
 /etc/fstab.  I have a large /tmp partition at times, and it gets newfs'd if 
 there's a bad problem...

Yeah, but..
IMHO if the installer supports it then it is dramatically less painful..

I haven't looked to see how hard it is to add, hopefully I will get some time 
to look RSN and it shouldn't be too difficult.

FWIW the above shell snippet is found in a post [sys]install shell script I 
used for 6.x and later so it has had a bit of testing.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221101 - in head/sys/geom: . concat journal mirror raid3 shsec stripe virstor

2011-04-26 Thread Alexander Motin
Author: mav
Date: Wed Apr 27 00:10:26 2011
New Revision: 221101
URL: http://svn.freebsd.org/changeset/base/221101

Log:
  Implement relaxed comparision for hardcoded provider names to make it
  ignore adX/adaY difference in both directions to simplify migration to
  the CAM-based ATA or back.

Modified:
  head/sys/geom/concat/g_concat.c
  head/sys/geom/geom.h
  head/sys/geom/geom_subr.c
  head/sys/geom/journal/g_journal.c
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/raid3/g_raid3.c
  head/sys/geom/shsec/g_shsec.c
  head/sys/geom/stripe/g_stripe.c
  head/sys/geom/virstor/g_virstor.c

Modified: head/sys/geom/concat/g_concat.c
==
--- head/sys/geom/concat/g_concat.c Tue Apr 26 23:00:32 2011
(r221100)
+++ head/sys/geom/concat/g_concat.c Wed Apr 27 00:10:26 2011
(r221101)
@@ -678,7 +678,8 @@ g_concat_taste(struct g_class *mp, struc
if (md.md_version  4)
md.md_provsize = pp-mediasize;
 
-   if (md.md_provider[0] != '\0'  strcmp(md.md_provider, pp-name) != 0)
+   if (md.md_provider[0] != '\0' 
+   !g_compare_names(md.md_provider, pp-name))
return (NULL);
if (md.md_provsize != pp-mediasize)
return (NULL);

Modified: head/sys/geom/geom.h
==
--- head/sys/geom/geom.hTue Apr 26 23:00:32 2011(r221100)
+++ head/sys/geom/geom.hWed Apr 27 00:10:26 2011(r221101)
@@ -238,6 +238,7 @@ void g_waitidlelock(void);
 /* geom_subr.c */
 int g_access(struct g_consumer *cp, int nread, int nwrite, int nexcl);
 int g_attach(struct g_consumer *cp, struct g_provider *pp);
+int g_compare_names(const char *namea, const char *nameb);
 void g_destroy_consumer(struct g_consumer *cp);
 void g_destroy_geom(struct g_geom *pp);
 void g_destroy_provider(struct g_provider *pp);

Modified: head/sys/geom/geom_subr.c
==
--- head/sys/geom/geom_subr.c   Tue Apr 26 23:00:32 2011(r221100)
+++ head/sys/geom/geom_subr.c   Wed Apr 27 00:10:26 2011(r221101)
@@ -1017,6 +1017,43 @@ g_getattr__(const char *attr, struct g_c
return (0);
 }
 
+static int
+g_get_device_prefix_len(const char *name)
+{
+   int len;
+
+   if (strncmp(name, ada, 3) == 0)
+   len = 3;
+   else if (strncmp(name, ad, 2) == 0)
+   len = 2;
+   else
+   return (0);
+   if (name[len]  '0' || name[len]  '9')
+   return (0);
+   do {
+   len++;
+   } while (name[len] = '0'  name[len] = '9');
+   return (len);
+}
+
+int
+g_compare_names(const char *namea, const char *nameb)
+{
+   int deva, devb;
+
+   if (strcmp(namea, nameb) == 0)
+   return (1);
+   deva = g_get_device_prefix_len(namea);
+   if (deva == 0)
+   return (0);
+   devb = g_get_device_prefix_len(nameb);
+   if (devb == 0)
+   return (0);
+   if (strcmp(namea + deva, nameb + devb) == 0)
+   return (1);
+   return (0);
+}
+
 #if defined(DIAGNOSTIC) || defined(DDB)
 /*
  * This function walks the mesh and returns a non-zero integer if it

Modified: head/sys/geom/journal/g_journal.c
==
--- head/sys/geom/journal/g_journal.c   Tue Apr 26 23:00:32 2011
(r221100)
+++ head/sys/geom/journal/g_journal.c   Wed Apr 27 00:10:26 2011
(r221101)
@@ -2527,7 +2527,8 @@ g_journal_taste(struct g_class *mp, stru
return (NULL);
gp = NULL;
 
-   if (md.md_provider[0] != '\0'  strcmp(md.md_provider, pp-name) != 0)
+   if (md.md_provider[0] != '\0' 
+   !g_compare_names(md.md_provider, pp-name))
return (NULL);
if (md.md_provsize != 0  md.md_provsize != pp-mediasize)
return (NULL);

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Tue Apr 26 23:00:32 2011
(r221100)
+++ head/sys/geom/mirror/g_mirror.c Wed Apr 27 00:10:26 2011
(r221101)
@@ -3007,7 +3007,8 @@ g_mirror_taste(struct g_class *mp, struc
return (NULL);
gp = NULL;
 
-   if (md.md_provider[0] != '\0'  strcmp(md.md_provider, pp-name) != 0)
+   if (md.md_provider[0] != '\0' 
+   !g_compare_names(md.md_provider, pp-name))
return (NULL);
if (md.md_provsize != 0  md.md_provsize != pp-mediasize)
return (NULL);

Modified: head/sys/geom/raid3/g_raid3.c
==
--- head/sys/geom/raid3/g_raid3.c   Tue Apr 26 23:00:32 2011
(r221100)
+++ head/sys/geom/raid3/g_raid3.c   Wed Apr 27 00:10:26 2011 

svn commit: r221102 - head/sys/x86/cpufreq

2011-04-26 Thread Jung-uk Kim
Author: jkim
Date: Wed Apr 27 00:32:35 2011
New Revision: 221102
URL: http://svn.freebsd.org/changeset/base/221102

Log:
  Use ACPI-supplied CPU frequencies instead of estimated ones as we are about
  to use other values from the same table anyway.
  
  MFC after:3 days

Modified:
  head/sys/x86/cpufreq/powernow.c

Modified: head/sys/x86/cpufreq/powernow.c
==
--- head/sys/x86/cpufreq/powernow.c Wed Apr 27 00:10:26 2011
(r221101)
+++ head/sys/x86/cpufreq/powernow.c Wed Apr 27 00:32:35 2011
(r221102)
@@ -801,15 +801,13 @@ pn_decode_acpi(device_t dev, device_t pe
if ((sc-errata  A0_ERRATA) 
(pn7_fid_to_mult[state.fid] % 10) == 5)
continue;
-   state.freq = 100 * pn7_fid_to_mult[state.fid] * sc-fsb;
break;
case PN8_TYPE:
state.fid = ACPI_PN8_CTRL_TO_FID(ctrl);
state.vid = ACPI_PN8_CTRL_TO_VID(ctrl);
-   state.freq = 100 * pn8_fid_to_mult[state.fid] * sc-fsb;
break;
}
-
+   state.freq = sets[i].freq * 1000;
state.power = sets[i].power;
 
j = n;
@@ -841,6 +839,7 @@ pn_decode_acpi(device_t dev, device_t pe
device_printf(dev, ACPI MAX frequency not found\n);
return (EINVAL);
}
+   sc-fsb = state.freq / 100 / pn7_fid_to_mult[state.fid];
break;
case PN8_TYPE:
sc-vst = ACPI_PN8_CTRL_TO_VST(ctrl),
@@ -856,6 +855,7 @@ pn_decode_acpi(device_t dev, device_t pe
if (sc-powernow_max_states = 2 
(sc-powernow_states[sc-powernow_max_states - 2].fid  8))
return (EINVAL);
+   sc-fsb = state.freq / 100 / pn8_fid_to_mult[state.fid];
break;
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221108 - head/sbin/fsck_ffs

2011-04-26 Thread Dag-Erling Smorgrav
Author: des
Date: Wed Apr 27 02:35:57 2011
New Revision: 221108
URL: http://svn.freebsd.org/changeset/base/221108

Log:
  Fix boo-boo in previous commit.
  
  MFC after:3 weeks

Modified:
  head/sbin/fsck_ffs/fsck_ffs.8

Modified: head/sbin/fsck_ffs/fsck_ffs.8
==
--- head/sbin/fsck_ffs/fsck_ffs.8   Wed Apr 27 02:32:41 2011
(r221107)
+++ head/sbin/fsck_ffs/fsck_ffs.8   Wed Apr 27 02:35:57 2011
(r221108)
@@ -38,7 +38,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl BFprfny
+.Op Fl BFfnpry
 .Op Fl b Ar block
 .Op Fl c Ar level
 .Op Fl m Ar mode
@@ -143,6 +143,12 @@ The following flags are interpreted by
 A check is done on the specified and possibly active file system.
 The set of corrections that can be done is limited to those done
 when running in preen mode (see the
+.Fl p
+flag).
+If unexpected errors are found,
+the file system is marked as needing a foreground check and
+.Nm
+exits without attempting any further cleaning.
 .It Fl F
 Determine whether the file system needs to be cleaned immediately
 in foreground, or if its cleaning can be deferred to background.
@@ -164,12 +170,6 @@ The only thing that
 .Nm
 does is to determine whether a foreground or background
 check is needed and exit with an appropriate status code.
-.Fl p
-flag).
-If unexpected errors are found,
-the file system is marked as needing a foreground check and
-.Nm
-exits without attempting any further cleaning.
 .It Fl b
 Use the block specified immediately after the flag as
 the super block for the file system.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r221110 - head/sbin/fsck_ffs

2011-04-26 Thread Dag-Erling Smorgrav
Author: des
Date: Wed Apr 27 02:55:03 2011
New Revision: 221110
URL: http://svn.freebsd.org/changeset/base/221110

Log:
  Mechanical whitespace cleanup.
  
  MFC after:3 weeks

Modified:
  head/sbin/fsck_ffs/ea.c
  head/sbin/fsck_ffs/inode.c
  head/sbin/fsck_ffs/main.c
  head/sbin/fsck_ffs/pass2.c
  head/sbin/fsck_ffs/suj.c
  head/sbin/fsck_ffs/utilities.c

Modified: head/sbin/fsck_ffs/ea.c
==
--- head/sbin/fsck_ffs/ea.c Wed Apr 27 02:41:26 2011(r221109)
+++ head/sbin/fsck_ffs/ea.c Wed Apr 27 02:55:03 2011(r221110)
@@ -83,4 +83,3 @@ eascan(struct inodesc *idesc, struct ufs
return (STOP);
 #endif
 }
-

Modified: head/sbin/fsck_ffs/inode.c
==
--- head/sbin/fsck_ffs/inode.c  Wed Apr 27 02:41:26 2011(r221109)
+++ head/sbin/fsck_ffs/inode.c  Wed Apr 27 02:55:03 2011(r221110)
@@ -91,18 +91,18 @@ ckinode(union dinode *dp, struct inodesc
/* An empty block in a directory XXX */
getpathname(pathbuf, idesc-id_number,
idesc-id_number);
-   pfatal(DIRECTORY %s: CONTAINS EMPTY BLOCKS,
+   pfatal(DIRECTORY %s: CONTAINS EMPTY BLOCKS,
pathbuf);
-   if (reply(ADJUST LENGTH) == 1) {
+   if (reply(ADJUST LENGTH) == 1) {
dp = ginode(idesc-id_number);
-   DIP_SET(dp, di_size,
+   DIP_SET(dp, di_size,
i * sblock.fs_bsize);
printf(
YOU MUST RERUN FSCK AFTERWARDS\n);
rerun = 1;
-   inodirty();
-   
-   }
+   inodirty();
+
+   }
}
continue;
}
@@ -130,19 +130,19 @@ ckinode(union dinode *dp, struct inodesc
/* An empty block in a directory XXX */
getpathname(pathbuf, idesc-id_number,
idesc-id_number);
-   pfatal(DIRECTORY %s: CONTAINS EMPTY BLOCKS,
+   pfatal(DIRECTORY %s: CONTAINS EMPTY BLOCKS,
pathbuf);
-   if (reply(ADJUST LENGTH) == 1) {
+   if (reply(ADJUST LENGTH) == 1) {
dp = ginode(idesc-id_number);
-   DIP_SET(dp, di_size,
+   DIP_SET(dp, di_size,
DIP(dp, di_size) - remsize);
remsize = 0;
printf(
YOU MUST RERUN FSCK AFTERWARDS\n);
rerun = 1;
-   inodirty();
+   inodirty();
break;
-   }
+   }
}
}
remsize -= sizepb;
@@ -209,20 +209,20 @@ iblock(struct inodesc *idesc, long ileve
/* An empty block in a directory XXX */
getpathname(pathbuf, idesc-id_number,
idesc-id_number);
-   pfatal(DIRECTORY %s: CONTAINS EMPTY BLOCKS,
+   pfatal(DIRECTORY %s: CONTAINS EMPTY BLOCKS,
pathbuf);
-   if (reply(ADJUST LENGTH) == 1) {
+   if (reply(ADJUST LENGTH) == 1) {
dp = ginode(idesc-id_number);
-   DIP_SET(dp, di_size,
+   DIP_SET(dp, di_size,
DIP(dp, di_size) - isize);
isize = 0;
printf(
YOU MUST RERUN FSCK AFTERWARDS\n);
rerun = 1;
-   inodirty();
+   inodirty();
bp-b_flags = ~B_INUSE;
 

Re: svn commit: r220983 - head

2011-04-26 Thread Nathan Whitehorn

On 04/26/11 18:48, Daniel O'Connor wrote:


On 26/04/2011, at 1:31, Warner Losh wrote:

This is why I prefer IDs since they are nominally unique (UFS
ones, GPTs damn well better be :)

Although I concede it is rather annoying to work out which is
which, or type them out manually..


For things like ZFS, UUIDs aren't so bad because it hides them.


Yes, I use GPT with ZFS, it's good :)


For things like /etc/fstab, I prefer the named approach.  This
allows me to survive a newfs on a partition if I have to without
having to hack my /etc/fstab.  I have a large /tmp partition at
times, and it gets newfs'd if there's a bad problem...


Yeah, but.. IMHO if the installer supports it then it is dramatically
less painful..

I haven't looked to see how hard it is to add, hopefully I will get
some time to look RSN and it shouldn't be too difficult.


It's not difficult to add -- the issue is that the mechanism is 
unreliable. It doesn't work for all partition types supporting labels, 
it's hard to figure out what the name of the label provider is in a 
generic way, and the label providers have a nasty habit of disappearing 
periodically when you use the underlying provider for anything. Also, 
retastes don't always work. For example, if I change the label of a GPT 
partition, the label provider does not reflect the change until a disk 
reattach (e.g. a reboot).


If it's a feature that we enable by default, and that the installer 
relies upon, it has to work better than that.

-Nathan
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r220983 - head

2011-04-26 Thread Warner Losh

On Apr 26, 2011, at 9:00 PM, Nathan Whitehorn wrote:

 On 04/26/11 18:48, Daniel O'Connor wrote:
 
 On 26/04/2011, at 1:31, Warner Losh wrote:
 This is why I prefer IDs since they are nominally unique (UFS
 ones, GPTs damn well better be :)
 
 Although I concede it is rather annoying to work out which is
 which, or type them out manually..
 
 For things like ZFS, UUIDs aren't so bad because it hides them.
 
 Yes, I use GPT with ZFS, it's good :)
 
 For things like /etc/fstab, I prefer the named approach.  This
 allows me to survive a newfs on a partition if I have to without
 having to hack my /etc/fstab.  I have a large /tmp partition at
 times, and it gets newfs'd if there's a bad problem...
 
 Yeah, but.. IMHO if the installer supports it then it is dramatically
 less painful..
 
 I haven't looked to see how hard it is to add, hopefully I will get
 some time to look RSN and it shouldn't be too difficult.
 
 It's not difficult to add -- the issue is that the mechanism is unreliable. 
 It doesn't work for all partition types supporting labels, it's hard to 
 figure out what the name of the label provider is in a generic way, and the 
 label providers have a nasty habit of disappearing periodically when you use 
 the underlying provider for anything. Also, retastes don't always work. For 
 example, if I change the label of a GPT partition, the label provider does 
 not reflect the change until a disk reattach (e.g. a reboot).

I know that for ufs, it works well, except for the root partition which 
requires some dancing to retrofit.  But if you relabel a partition, it shows up 
right away in /dev/ufs/newlbl.  Guess not all of them are that reliable.

The new names, and slightly non-deterministic probe order make it more 
important that we shake out the bugs from this as best we can.  I think that 
names/uuid are critical to the future, and we need to fix any remaining issues.

 If it's a feature that we enable by default, and that the installer relies 
 upon, it has to work better than that.


Thanks for the report.  Who are you working with to resolve these issues?  Some 
of them surprise me, but you speak of them as if they are widely known...  
Without owners, these issues will languish.

Warner___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org