scst: Convert mutex_release() and rwlock_release() to the kernel v5.5 prototypes (backport r8694 from the trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.4.x@8852 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-04-08 14:33:12 +00:00
parent fbbe2910da
commit 6b8598f3d0
3 changed files with 15 additions and 4 deletions

View File

@@ -853,6 +853,17 @@ static inline void lockdep_unregister_key(struct lock_class_key *key)
}
#endif
/*
* See also commit 5facae4f3549 ("locking/lockdep: Remove unused @nested
* argument from lock_release()").
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
#undef rwlock_release
#define rwlock_release(l, i) lock_release(l, 1, i)
#undef mutex_release
#define mutex_release(l, i) lock_release(l, 0, i)
#endif
/* <linux/mempoool.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
/*

View File

@@ -979,7 +979,7 @@ out:
if (res == 0)
lock_acquired(&scst_suspend_dep_map, _RET_IP_);
else
rwlock_release(&scst_suspend_dep_map, 1, _RET_IP_);
rwlock_release(&scst_suspend_dep_map, _RET_IP_);
#endif
TRACE_EXIT_RES(res);
@@ -1059,7 +1059,7 @@ void scst_resume_activity(void)
TRACE_ENTRY();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
rwlock_release(&scst_suspend_dep_map, 1, _RET_IP_);
rwlock_release(&scst_suspend_dep_map, _RET_IP_);
#endif
mutex_lock(&scst_suspend_mutex);

View File

@@ -464,7 +464,7 @@ static void scst_process_sysfs_works(void)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
if (work->dep_map)
mutex_release(work->dep_map, 0, _RET_IP_);
mutex_release(work->dep_map, _RET_IP_);
#endif
spin_lock(&sysfs_work_lock);
@@ -1213,7 +1213,7 @@ void scst_kobject_put_and_wait(struct kobject *kobj, const char *category,
out_free:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
lock_acquired(dep_map, _RET_IP_);
mutex_release(dep_map, 0, _RET_IP_);
mutex_release(dep_map, _RET_IP_);
#endif
kfree(name);