Displaying 1 result from an estimated 1 matches for "intr_rwsem_up_read".
2012 Apr 25
5
[PATCH v2 4/4] drm/nouveau: gpu lockup recovery
...mutex_init(&r->mutex);
+}
+
+int intr_rwsem_down_read_interruptible(struct intr_rwsem *r)
+{
+ while (down_read_trylock(&r->rwsem) == 0) {
+ int ret = mutex_lock_interruptible(&r->mutex);
+ if (ret)
+ return ret;
+ mutex_unlock(&r->mutex);
+ }
+ return 0;
+}
+
+void intr_rwsem_up_read(struct intr_rwsem *r)
+{
+ up_read(&r->rwsem);
+}
+
+void intr_rwsem_down_write(struct intr_rwsem *r)
+{
+ mutex_lock(&r->mutex);
+ down_write(&r->rwsem);
+}
+
+void intr_rwsem_up_write(struct intr_rwsem *r)
+{
+ up_write(&r->rwsem);
+ mutex_unlock(&r->mutex);
+}...