shithub: lwext4

Download patch

ref: e92d26d0e1e1e52f4f9a8f81865e56f7aad5ff57
parent: d7ff253da29b9e67963089f83160fda5f0c5afeb
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Mon Jan 18 06:21:58 EST 2021

fix locks

--- a/include/ext4.h
+++ b/include/ext4.h
@@ -63,10 +63,13 @@
 struct ext4_lock {
 
 	/**@brief   Lock access to mount point.*/
-	void (*lock)(void);
+	void (*lock)(void *aux);
 
 	/**@brief   Unlock access to mount point.*/
-	void (*unlock)(void);
+	void (*unlock)(void *aux);
+
+	/**@brief   Auxilary pointer.*/
+	void *p_user;
 };
 
 /********************************FILE DESCRIPTOR*****************************/
--- a/src/ext4.c
+++ b/src/ext4.c
@@ -50,17 +50,17 @@
 #include <string.h>
 
 /**@brief   Mount point OS dependent lock*/
-#define EXT4_MP_LOCK(_m)                                                       \
-	do {                                                                   \
+#define EXT4_MP_LOCK(_m)                                               \
+	do {                                                               \
 		if ((_m)->os_locks)                                            \
-			(_m)->os_locks->lock();                                \
+			(_m)->os_locks->lock((_m)->os_locks->p_user);              \
 	} while (0)
 
 /**@brief   Mount point OS dependent unlock*/
-#define EXT4_MP_UNLOCK(_m)                                                     \
-	do {                                                                   \
+#define EXT4_MP_UNLOCK(_m)                                             \
+	do {                                                               \
 		if ((_m)->os_locks)                                            \
-			(_m)->os_locks->unlock();                              \
+			(_m)->os_locks->unlock((_m)->os_locks->p_user);            \
 	} while (0)
 
 /**@brief   Mount point descriptor.*/