/* If bad status or tape we want is not loaded, load it. */
if (status != 0 || loaded != slot) {
- if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
- offline_dev(dev);
- }
+ offline_or_rewind_dev(dev);
/* We are going to load a new tape, so close the device */
force_close_dev(dev);
if (loaded != 0) { /* must unload drive */
}
changer = get_pool_memory(PM_FNAME);
- if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
- offline_dev(dev);
- }
+ offline_or_rewind_dev(dev);
/* We are going to load a new tape, so close the device */
force_close_dev(dev);
str = "%";
break;
case 'a':
- str = jcr->device->dev->dev_name;
+ str = dev_name(jcr->device->dev);
break;
case 'c':
str = NPRT(jcr->device->changer_name);