Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0d1f295 authored by Robert P. J. Day's avatar Robert P. J. Day Committed by Jesper Juhl
Browse files

DOCUMENTATION: Use newer DEFINE_SPINLOCK macro in docs.

parent dd89db1d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -854,7 +854,7 @@ The change is shown below, in standard patch format: the
 };
 };


-static DEFINE_MUTEX(cache_lock);
-static DEFINE_MUTEX(cache_lock);
+static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cache_lock);
 static LIST_HEAD(cache);
 static LIST_HEAD(cache);
 static unsigned int cache_num = 0;
 static unsigned int cache_num = 0;
 #define MAX_CACHE_SIZE 10
 #define MAX_CACHE_SIZE 10
@@ -1238,7 +1238,7 @@ Here is the "lock-per-object" implementation:
-        int popularity;
-        int popularity;
 };
 };


 static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED;
 static DEFINE_SPINLOCK(cache_lock);
@@ -77,6 +84,7 @@
@@ -77,6 +84,7 @@
         obj->id = id;
         obj->id = id;
         obj->popularity = 0;
         obj->popularity = 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1097,7 +1097,7 @@ lock themselves, if required. Drivers that explicitly used the
io_request_lock for serialization need to be modified accordingly.
io_request_lock for serialization need to be modified accordingly.
Usually it's as easy as adding a global lock:
Usually it's as easy as adding a global lock:


	static spinlock_t my_driver_lock = SPIN_LOCK_UNLOCKED;
	static DEFINE_SPINLOCK(my_driver_lock);


and passing the address to that lock to blk_init_queue().
and passing the address to that lock to blk_init_queue().


+1 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@ would execute while the cli()-ed section is executing.


but from now on a more direct method of locking has to be used:
but from now on a more direct method of locking has to be used:


	spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
	DEFINE_SPINLOCK(driver_lock);
	struct driver_data;
	struct driver_data;


	irq_handler (...)
	irq_handler (...)