X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fseqlock.h;h=6b0648cfdffcf869ee59784db66e81ae8991a382;hb=5b94d541806da24c8dbbff629486d65ce71dec46;hp=5a095572881d0757030522bbd5d7dd4467b547ae;hpb=a748422ee45725e04e1d3792fa19dfa90ddfd116;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 5a095572881..6b0648cfdff 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -26,7 +26,6 @@ * by Keith Owens and Andrea Arcangeli */ -#include #include #include @@ -39,9 +38,20 @@ typedef struct { * These macros triggered gcc-3.x compile-time problems. We think these are * OK now. Be cautious. */ -#define SEQLOCK_UNLOCKED { 0, SPIN_LOCK_UNLOCKED } -#define seqlock_init(x) do { *(x) = (seqlock_t) SEQLOCK_UNLOCKED; } while (0) +#define __SEQLOCK_UNLOCKED(lockname) \ + { 0, __SPIN_LOCK_UNLOCKED(lockname) } +#define SEQLOCK_UNLOCKED \ + __SEQLOCK_UNLOCKED(old_style_seqlock_init) + +#define seqlock_init(x) \ + do { \ + (x)->sequence = 0; \ + spin_lock_init(&(x)->lock); \ + } while (0) + +#define DEFINE_SEQLOCK(x) \ + seqlock_t x = __SEQLOCK_UNLOCKED(x) /* Lock out other writers and update the count. * Acts like a normal spin_lock/unlock.