Skip to content
Snippets Groups Projects
Commit 1743e047 authored by Nikita Danilov's avatar Nikita Danilov
Browse files

libcfs: add spin_lock_nested() function to user level and old linux kernels.

parent 7167033c
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,13 @@
* - spin_unlock_irqrestore(x, f)
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
static inline void spin_lock_nested(spinlock_t *lock, unsigned subclass)
{
spin_lock(lock);
}
#endif
/*
* rw_semaphore (use Linux kernel's primitives)
*
......
......@@ -72,6 +72,7 @@
*
* - spin_lock_init(x)
* - spin_lock(x)
* - spin_lock_nested(x, subclass)
* - spin_unlock(x)
* - spin_trylock(x)
*
......@@ -90,6 +91,7 @@ typedef struct spin_lock spinlock_t;
void spin_lock_init(spinlock_t *lock);
void spin_lock(spinlock_t *lock);
void spin_lock_nested(spinlock_t *lock, unsigned int subclass);
void spin_unlock(spinlock_t *lock);
int spin_trylock(spinlock_t *lock);
void spin_lock_bh_init(spinlock_t *lock);
......
......@@ -61,6 +61,7 @@
*
* - spin_lock_init(x)
* - spin_lock(x)
* - spin_lock_nested(x, subclass)
* - spin_unlock(x)
* - spin_trylock(x)
*
......@@ -81,6 +82,12 @@ void spin_lock(spinlock_t *lock)
(void)lock;
}
void spin_lock_nested(spinlock_t *lock, unsigned int subclass)
{
(void)lock;
(void)subclass;
}
void spin_unlock(spinlock_t *lock)
{
(void)lock;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment