staging/lustre/libcfs: remove NIDSTR_LOCK/UNLOCK
authorPeng Tao <bergwolf@gmail.com>
Wed, 5 Mar 2014 13:27:20 +0000 (21:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Mar 2014 03:23:56 +0000 (19:23 -0800)
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/nidstrings.c

index 732ae5540bf4e163df67c32e0fe1b3d78d45eeeb..cfb274fc9cbdf0b98548b56130502201b3e7e779 100644 (file)
@@ -65,23 +65,20 @@ void libcfs_init_nidstrings(void)
        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 *
 libcfs_next_nidstring(void)
 {
        char      *str;
        unsigned long  flags;
 
-       NIDSTR_LOCK(flags);
+       spin_lock_irqsave(&libcfs_nidstring_lock, flags);
 
        str = libcfs_nidstrings[libcfs_nidstring_idx++];
        if (libcfs_nidstring_idx ==
            sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0]))
                libcfs_nidstring_idx = 0;
 
-       NIDSTR_UNLOCK(flags);
+       spin_unlock_irqrestore(&libcfs_nidstring_lock, flags);
        return str;
 }