LWN.net Logo

Btrfs aims for the mainline

Btrfs aims for the mainline

Posted Jan 7, 2009 23:21 UTC (Wed) by tialaramex (subscriber, #21167)
In reply to: Btrfs aims for the mainline by MisterIO
Parent article: Btrfs aims for the mainline

I assume (but haven't checked) that the kernel's mutex functions do not have the 0 on success behaviour seen in pthread_mutex_trylock(3p)


(Log in to post comments)

Btrfs aims for the mainline

Posted Jan 7, 2009 23:28 UTC (Wed) by tialaramex (subscriber, #21167) [Link]

Oh, or did you mean 513 as distinct from the 512 claimed by the author? No, this is the usual C idiom for doing something N times...

for (int k = 0; k < N; ++k) { /* do something */ }

It won't do them N+1 times because after the Nth iteration k is N and will fail the condition (k < N)

(Actually mine is a slightly more modern idiom, requiring C9X semantics, and it has the K&R increment style, but it amounts to the same thing)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds