Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162858502
D36528.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36528.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/rwsem.h b/sys/compat/linuxkpi/common/include/linux/rwsem.h
--- a/sys/compat/linuxkpi/common/include/linux/rwsem.h
+++ b/sys/compat/linuxkpi/common/include/linux/rwsem.h
@@ -46,6 +46,7 @@
#define down_read(_rw) sx_slock(&(_rw)->sx)
#define up_read(_rw) sx_sunlock(&(_rw)->sx)
#define down_read_trylock(_rw) !!sx_try_slock(&(_rw)->sx)
+#define down_read_killable(_rw) linux_down_read_killable(_rw)
#define down_write_trylock(_rw) !!sx_try_xlock(&(_rw)->sx)
#define down_write_killable(_rw) linux_down_write_killable(_rw)
#define downgrade_write(_rw) sx_downgrade(&(_rw)->sx)
@@ -80,6 +81,7 @@
sx_init_flags(&rw->sx, name, SX_NOWITNESS);
}
+extern int linux_down_read_killable(struct rw_semaphore *);
extern int linux_down_write_killable(struct rw_semaphore *);
#endif /* _LINUXKPI_LINUX_RWSEM_H_ */
diff --git a/sys/compat/linuxkpi/common/src/linux_lock.c b/sys/compat/linuxkpi/common/src/linux_lock.c
--- a/sys/compat/linuxkpi/common/src/linux_lock.c
+++ b/sys/compat/linuxkpi/common/src/linux_lock.c
@@ -159,6 +159,19 @@
return (error);
}
+int
+linux_down_read_killable(struct rw_semaphore *rw)
+{
+ int error;
+
+ error = -sx_slock_sig(&rw->sx);
+ if (error != 0) {
+ linux_schedule_save_interrupt_value(current, error);
+ error = -EINTR;
+ }
+ return (error);
+}
+
int
linux_down_write_killable(struct rw_semaphore *rw)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 18, 5:17 PM (16 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35201464
Default Alt Text
D36528.diff (1 KB)
Attached To
Mode
D36528: Added LinuxKPI down_read_killable()
Attached
Detach File
Event Timeline
Log In to Comment