lkml.org 
[lkml]   [2005]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] namespace.c: fix bind mount from foreign namespace
Miklos Szeredi wrote:
> + if (ns1 < ns2) {
> + down_write(&ns1->sem);
> + down_write(&ns2->sem);
> + } else {
> + down_write(&ns2->sem);
> + down_write(&ns1->sem);
> + }

That's a bit smaller (source and compiled) as:

if (ns2 < ns1)
down_write(&ns2->sem);
down_write(&ns1->sem);
if (ns2 > ns1)
down_write(&ns2->sem);

(And you'll notice that does the right thing if ns2==ns1 too, in case
that gives you any ideas.)

Otherwise, the patch looks convincing to me.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-05-17 03:33    [W:0.219 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site