diff --git a/include/linux/zio-buffer.h b/include/linux/zio-buffer.h
index 4f9ef345faa518693008405f5442a94831315fb8..7a588586bba7d336a9d8404628ba26deab57c573 100644
--- a/include/linux/zio-buffer.h
+++ b/include/linux/zio-buffer.h
@@ -162,6 +162,7 @@ struct zio_bi {
 	/* Those using generic_read need this information */
 	unsigned long flags;			/* input or output, etc */
 	wait_queue_head_t q;			/* for reading or writing */
+	struct spinlock		lock;
 
 	/* Standard and extended attributes for this object */
 	struct zio_attribute_set		zattr_set;
diff --git a/include/linux/zio-trigger.h b/include/linux/zio-trigger.h
index b2ba0c86c964f86fdba76ee7170961f001fedfd9..e568575a011b073c259c451b7459b3236bb3989f 100644
--- a/include/linux/zio-trigger.h
+++ b/include/linux/zio-trigger.h
@@ -38,6 +38,7 @@ struct zio_ti {
 	struct zio_cset		*cset;
 
 	unsigned long		flags;		/* input or output, etc */
+	struct spinlock		lock;
 	struct zio_control	*current_ctrl;	/* the active one */
 	/* This is for software stamping */
 	struct timespec		tstamp;
diff --git a/zio-sys.c b/zio-sys.c
index 8ca3278b661b15c2ea562f86656776075c61d1dd..83155526e4d1128437181b6f7ea4c160b7ea9c41 100644
--- a/zio-sys.c
+++ b/zio-sys.c
@@ -352,7 +352,7 @@ static void __zattr_set_free(struct zio_attribute_set *zattr_set)
 }
 
 /* When touching attributes, we always use the spinlock for the hosting dev */
-static spinlock_t *zdev_get_spinlock(struct zio_obj_head *head)
+static spinlock_t *__get_spinlock(struct zio_obj_head *head)
 {
 	spinlock_t *lock;
 
@@ -367,10 +367,10 @@ static spinlock_t *zdev_get_spinlock(struct zio_obj_head *head)
 		lock = &to_zio_chan(&head->kobj)->cset->zdev->lock;
 		break;
 	case ZTI: /* we might not want to take a lock but... */
-		lock = &to_zio_ti(&head->kobj)->cset->zdev->lock;
+		lock = &to_zio_ti(&head->kobj)->lock;
 		break;
 	case ZBI:
-		lock = &to_zio_bi(&head->kobj)->cset->zdev->lock;
+		lock = &to_zio_bi(&head->kobj)->lock;
 		break;
 	default:
 		WARN(1, "ZIO: unknown zio object %i\n", head->zobj_type);
@@ -434,7 +434,7 @@ static ssize_t zattr_show(struct kobject *kobj, struct attribute *attr,
 	}
 
 	if (zattr->s_op->info_get) {
-		lock = zdev_get_spinlock(to_zio_head(kobj));
+		lock = __get_spinlock(to_zio_head(kobj));
 		spin_lock(lock);
 		err = zattr->s_op->info_get(kobj, zattr, &zattr->value);
 		spin_unlock(lock);
@@ -457,7 +457,7 @@ static ssize_t zattr_store(struct kobject *kobj, struct attribute *attr,
 	if (err)
 		return -EINVAL;
 	if (zattr->s_op->conf_set) {
-		lock = zdev_get_spinlock(to_zio_head(kobj));
+		lock = __get_spinlock(to_zio_head(kobj));
 		spin_lock(lock);
 		err = zattr->s_op->conf_set(kobj, zattr, (uint32_t)val);
 		spin_unlock(lock);