Remove the bio_empty_barrier() check.
[zfs.git] / module / zfs / vdev_disk.c
index c562256..e902a70 100644 (file)
@@ -121,8 +121,15 @@ vdev_elevator_switch(vdev_t *v, char *elevator)
        char *device = bdev->bd_disk->disk_name;
        int error;
 
-       /* Skip devices which are not whole disks (partitions) */
-       if (!v->vdev_wholedisk)
+       /*
+        * Skip devices which are not whole disks (partitions).
+        * Device-mapper devices are excepted since they may be whole
+        * disks despite the vdev_wholedisk flag, in which case we can
+        * and should switch the elevator. If the device-mapper device
+        * does not have an elevator (i.e. dm-raid, dm-crypt, etc.) the
+        * "Skip devices without schedulers" check below will fail.
+        */
+       if (!v->vdev_wholedisk && strncmp(device, "dm-", 3) != 0)
                return (0);
 
        /* Skip devices without schedulers (loop, ram, dm, etc) */
@@ -152,7 +159,7 @@ vdev_elevator_switch(vdev_t *v, char *elevator)
                char *envp[] = { NULL };
 
                argv[2] = kmem_asprintf(SET_SCHEDULER_CMD, device, elevator);
-               error = call_usermodehelper(argv[0], argv, envp, 1);
+               error = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
                strfree(argv[2]);
        }
 #endif /* HAVE_ELEVATOR_CHANGE */
@@ -533,7 +540,6 @@ retry:
                if (dr->dr_bio_count == i) {
                        vdev_disk_dio_free(dr);
                        bio_count *= 2;
-                       printk("WARNING: Resized bio's/dio to %d\n",bio_count);
                        goto retry;
                }
 
@@ -598,8 +604,6 @@ vdev_disk_physio(struct block_device *bdev, caddr_t kbuf,
        return __vdev_disk_physio(bdev, NULL, kbuf, size, offset, flags);
 }
 
-/* 2.6.24 API change */
-#ifdef HAVE_BIO_EMPTY_BARRIER
 BIO_END_IO_PROTO(vdev_disk_io_flush_completion, bio, size, rc)
 {
        zio_t *zio = bio->bi_private;
@@ -640,13 +644,6 @@ vdev_disk_io_flush(struct block_device *bdev, zio_t *zio)
 
        return 0;
 }
-#else
-static int
-vdev_disk_io_flush(struct block_device *bdev, zio_t *zio)
-{
-       return ENOTSUP;
-}
-#endif /* HAVE_BIO_EMPTY_BARRIER */
 
 static int
 vdev_disk_io_start(zio_t *zio)