Commit d46a20d2 authored by Peng Tao's avatar Peng Tao Committed by Greg Kroah-Hartman

staging/lustre/libcfs: remove NIDSTR_LOCK/UNLOCK

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarPeng Tao <bergwolf@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1527469d
...@@ -65,23 +65,20 @@ void libcfs_init_nidstrings(void) ...@@ -65,23 +65,20 @@ void libcfs_init_nidstrings(void)
spin_lock_init(&libcfs_nidstring_lock); spin_lock_init(&libcfs_nidstring_lock);
} }
# define NIDSTR_LOCK(f) spin_lock_irqsave(&libcfs_nidstring_lock, f)
# define NIDSTR_UNLOCK(f) spin_unlock_irqrestore(&libcfs_nidstring_lock, f)
static char * static char *
libcfs_next_nidstring(void) libcfs_next_nidstring(void)
{ {
char *str; char *str;
unsigned long flags; unsigned long flags;
NIDSTR_LOCK(flags); spin_lock_irqsave(&libcfs_nidstring_lock, flags);
str = libcfs_nidstrings[libcfs_nidstring_idx++]; str = libcfs_nidstrings[libcfs_nidstring_idx++];
if (libcfs_nidstring_idx == if (libcfs_nidstring_idx ==
sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0])) sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0]))
libcfs_nidstring_idx = 0; libcfs_nidstring_idx = 0;
NIDSTR_UNLOCK(flags); spin_unlock_irqrestore(&libcfs_nidstring_lock, flags);
return str; return str;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment