@@ -289,17 +289,17 @@ zvol_geom_open(struct g_provider *pp, int flag, int count)
289
289
*/
290
290
if ((flag & FWRITE ) && ((zv -> zv_flags & ZVOL_RDONLY ) ||
291
291
dmu_objset_incompatible_encryption_version (zv -> zv_objset ))) {
292
- err = EROFS ;
292
+ err = SET_ERROR ( EROFS ) ;
293
293
goto out_open_count ;
294
294
}
295
295
if (zv -> zv_flags & ZVOL_EXCL ) {
296
- err = EBUSY ;
296
+ err = SET_ERROR ( EBUSY ) ;
297
297
goto out_open_count ;
298
298
}
299
299
#ifdef FEXCL
300
300
if (flag & FEXCL ) {
301
301
if (zv -> zv_open_count != 0 ) {
302
- err = EBUSY ;
302
+ err = SET_ERROR ( EBUSY ) ;
303
303
goto out_open_count ;
304
304
}
305
305
zv -> zv_flags |= ZVOL_EXCL ;
@@ -323,7 +323,7 @@ zvol_geom_open(struct g_provider *pp, int flag, int count)
323
323
mutex_exit (& zv -> zv_state_lock );
324
324
if (drop_suspend )
325
325
rw_exit (& zv -> zv_suspend_lock );
326
- return (SET_ERROR ( err ) );
326
+ return (err );
327
327
}
328
328
329
329
/*ARGSUSED*/
@@ -614,7 +614,7 @@ zvol_geom_bio_strategy(struct bio *bp)
614
614
goto sync ;
615
615
break ;
616
616
default :
617
- error = EOPNOTSUPP ;
617
+ error = SET_ERROR ( EOPNOTSUPP ) ;
618
618
goto resume ;
619
619
}
620
620
@@ -689,7 +689,7 @@ zvol_geom_bio_strategy(struct bio *bp)
689
689
690
690
bp -> bio_completed = bp -> bio_length - resid ;
691
691
if (bp -> bio_completed < bp -> bio_length && off > volsize )
692
- error = EINVAL ;
692
+ error = SET_ERROR ( EINVAL ) ;
693
693
694
694
switch (bp -> bio_cmd ) {
695
695
case BIO_FLUSH :
@@ -870,17 +870,17 @@ zvol_cdev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
870
870
}
871
871
872
872
if ((flags & FWRITE ) && (zv -> zv_flags & ZVOL_RDONLY )) {
873
- err = EROFS ;
873
+ err = SET_ERROR ( EROFS ) ;
874
874
goto out_opened ;
875
875
}
876
876
if (zv -> zv_flags & ZVOL_EXCL ) {
877
- err = EBUSY ;
877
+ err = SET_ERROR ( EBUSY ) ;
878
878
goto out_opened ;
879
879
}
880
880
#ifdef FEXCL
881
881
if (flags & FEXCL ) {
882
882
if (zv -> zv_open_count != 0 ) {
883
- err = EBUSY ;
883
+ err = SET_ERROR ( EBUSY ) ;
884
884
goto out_opened ;
885
885
}
886
886
zv -> zv_flags |= ZVOL_EXCL ;
@@ -907,7 +907,7 @@ zvol_cdev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
907
907
mutex_exit (& zv -> zv_state_lock );
908
908
if (drop_suspend )
909
909
rw_exit (& zv -> zv_suspend_lock );
910
- return (SET_ERROR ( err ) );
910
+ return (err );
911
911
}
912
912
913
913
static int
@@ -1022,7 +1022,7 @@ zvol_cdev_ioctl(struct cdev *dev, ulong_t cmd, caddr_t data,
1022
1022
length <= 0 ) {
1023
1023
printf ("%s: offset=%jd length=%jd\n" , __func__ , offset ,
1024
1024
length );
1025
- error = EINVAL ;
1025
+ error = SET_ERROR ( EINVAL ) ;
1026
1026
break ;
1027
1027
}
1028
1028
rw_enter (& zv -> zv_suspend_lock , ZVOL_RW_READER );
@@ -1076,7 +1076,7 @@ zvol_cdev_ioctl(struct cdev *dev, ulong_t cmd, caddr_t data,
1076
1076
refd = metaslab_class_get_alloc (spa_normal_class (spa ));
1077
1077
arg -> value .off = refd / DEV_BSIZE ;
1078
1078
} else
1079
- error = ENOIOCTL ;
1079
+ error = SET_ERROR ( ENOIOCTL ) ;
1080
1080
break ;
1081
1081
}
1082
1082
case FIOSEEKHOLE :
@@ -1092,7 +1092,7 @@ zvol_cdev_ioctl(struct cdev *dev, ulong_t cmd, caddr_t data,
1092
1092
break ;
1093
1093
}
1094
1094
default :
1095
- error = ENOIOCTL ;
1095
+ error = SET_ERROR ( ENOIOCTL ) ;
1096
1096
}
1097
1097
1098
1098
return (error );
0 commit comments