aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dma-debug.c1
-rw-r--r--lib/idr.c11
-rw-r--r--lib/raid6/algos.c1
-rw-r--r--lib/raid6/mktables.c1
-rw-r--r--lib/raid6/recov.c1
5 files changed, 11 insertions, 4 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 79700fa2dfc4..74c6c7fce749 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -24,6 +24,7 @@
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/debugfs.h> 25#include <linux/debugfs.h>
26#include <linux/uaccess.h> 26#include <linux/uaccess.h>
27#include <linux/export.h>
27#include <linux/device.h> 28#include <linux/device.h>
28#include <linux/types.h> 29#include <linux/types.h>
29#include <linux/sched.h> 30#include <linux/sched.h>
diff --git a/lib/idr.c b/lib/idr.c
index bbf211aea4eb..ed055b297c81 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -944,6 +944,7 @@ int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
944{ 944{
945 int ret, id; 945 int ret, id;
946 unsigned int max; 946 unsigned int max;
947 unsigned long flags;
947 948
948 BUG_ON((int)start < 0); 949 BUG_ON((int)start < 0);
949 BUG_ON((int)end < 0); 950 BUG_ON((int)end < 0);
@@ -959,7 +960,7 @@ again:
959 if (!ida_pre_get(ida, gfp_mask)) 960 if (!ida_pre_get(ida, gfp_mask))
960 return -ENOMEM; 961 return -ENOMEM;
961 962
962 spin_lock(&simple_ida_lock); 963 spin_lock_irqsave(&simple_ida_lock, flags);
963 ret = ida_get_new_above(ida, start, &id); 964 ret = ida_get_new_above(ida, start, &id);
964 if (!ret) { 965 if (!ret) {
965 if (id > max) { 966 if (id > max) {
@@ -969,7 +970,7 @@ again:
969 ret = id; 970 ret = id;
970 } 971 }
971 } 972 }
972 spin_unlock(&simple_ida_lock); 973 spin_unlock_irqrestore(&simple_ida_lock, flags);
973 974
974 if (unlikely(ret == -EAGAIN)) 975 if (unlikely(ret == -EAGAIN))
975 goto again; 976 goto again;
@@ -985,10 +986,12 @@ EXPORT_SYMBOL(ida_simple_get);
985 */ 986 */
986void ida_simple_remove(struct ida *ida, unsigned int id) 987void ida_simple_remove(struct ida *ida, unsigned int id)
987{ 988{
989 unsigned long flags;
990
988 BUG_ON((int)id < 0); 991 BUG_ON((int)id < 0);
989 spin_lock(&simple_ida_lock); 992 spin_lock_irqsave(&simple_ida_lock, flags);
990 ida_remove(ida, id); 993 ida_remove(ida, id);
991 spin_unlock(&simple_ida_lock); 994 spin_unlock_irqrestore(&simple_ida_lock, flags);
992} 995}
993EXPORT_SYMBOL(ida_simple_remove); 996EXPORT_SYMBOL(ida_simple_remove);
994 997
diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
index b595f560bee7..8b02f60ffc86 100644
--- a/lib/raid6/algos.c
+++ b/lib/raid6/algos.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/raid/pq.h> 19#include <linux/raid/pq.h>
20#include <linux/module.h>
20#ifndef __KERNEL__ 21#ifndef __KERNEL__
21#include <sys/mman.h> 22#include <sys/mman.h>
22#include <stdio.h> 23#include <stdio.h>
diff --git a/lib/raid6/mktables.c b/lib/raid6/mktables.c
index 3b1500843bba..8a3780902cec 100644
--- a/lib/raid6/mktables.c
+++ b/lib/raid6/mktables.c
@@ -60,6 +60,7 @@ int main(int argc, char *argv[])
60 uint8_t exptbl[256], invtbl[256]; 60 uint8_t exptbl[256], invtbl[256];
61 61
62 printf("#include <linux/raid/pq.h>\n"); 62 printf("#include <linux/raid/pq.h>\n");
63 printf("#include <linux/export.h>\n");
63 64
64 /* Compute multiplication table */ 65 /* Compute multiplication table */
65 printf("\nconst u8 __attribute__((aligned(256)))\n" 66 printf("\nconst u8 __attribute__((aligned(256)))\n"
diff --git a/lib/raid6/recov.c b/lib/raid6/recov.c
index 8590d19cf522..fe275d7b6b36 100644
--- a/lib/raid6/recov.c
+++ b/lib/raid6/recov.c
@@ -18,6 +18,7 @@
18 * the syndrome.) 18 * the syndrome.)
19 */ 19 */
20 20
21#include <linux/export.h>
21#include <linux/raid/pq.h> 22#include <linux/raid/pq.h>
22 23
23/* Recover two failed data blocks. */ 24/* Recover two failed data blocks. */