LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* how exactly is the macro SPIN_LOCK_UNLOCKED going to be removed?
@ 2007-01-16 14:14 Robert P. J. Day
  0 siblings, 0 replies; only message in thread
From: Robert P. J. Day @ 2007-01-16 14:14 UTC (permalink / raw)
  To: Linux kernel mailing list


  (the following applies equally well to RW_LOCK_UNLOCKED.)

according to Documentation/spinlocks.txt:

======================================
Macros SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated and will
be removed soon. So for any new code dynamic initialization should be
used:

   spinlock_t xxx_lock;
   rwlock_t xxx_rw_lock;

   static int __init xxx_init(void)
   {
        spin_lock_init(&xxx_lock);
        rwlock_init(&xxx_rw_lock);
        ...
   }

   module_init(xxx_init);
...
======================================

  fair enough, i can see how *some* of that replacement is going to be
done.  new spinlocks can be created based on the macro:

#define DEFINE_SPINLOCK(x)      spinlock_t x = __SPIN_LOCK_UNLOCKED(x)

  so i'm assuming that the underlying macro __SPIN_LOCK_UNLOCKED is
sticking around.

  also, since defining a spinlock that way requires a lock name,
things like this:

  ...
  .lock           = SPIN_LOCK_UNLOCKED,
  ...

will have to be replaced with the form:

  ...
  .death_lock     = __SPIN_LOCK_UNLOCKED(tcp_death_row.death_lock)
  ...

is that correct so far?  but i'm not sure what's going to happen with
stuff like this:

  spinlock_t cris_atomic_locks[] =
    { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED};

what's the deal with *that*?  or am i misunderstanding this
completely?

rday

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-16 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16 14:14 how exactly is the macro SPIN_LOCK_UNLOCKED going to be removed? Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).