Those two are instead of previously existing ProtectVolumes.
dev->getVolCatName());
}
- if (dev->device->protect_vols) {
+ if (dev->device->set_vol_immutable) {
/* Set volume as immutable */
if (!dev->set_immutable(dev->getVolCatName())) {
/* We may proceed with that but warn the user */
Dmsg2(100, "Truncate adata=%d fd=%d\n", dev->adata, dev->m_fd);
/* Need to clear the APPEND flag before truncating */
- if (!clear_append_only(dcr->VolumeName)) {
- Mmsg2(errmsg, _("Unable to clear append_only flag for volume %s on device %s.\n"),
- dcr->VolumeName, print_name());
- return false;
+ if (dev->device->set_vol_append_only) {
+ if (!clear_append_only(dcr->VolumeName)) {
+ Mmsg2(errmsg, _("Unable to clear append_only flag for volume %s on device %s.\n"),
+ dcr->VolumeName, print_name());
+ return false;
+ }
}
if (ftruncate(dev->m_fd, 0) != 0) {
*/
bool file_dev::check_volume_protection_time(const char *vol_name)
{
- if (!device->protect_vols) {
+ if (!device->set_vol_immutable) {
Dmsg1(DT_VOLUME|50, "ProtectVolumes turned off for volume: %s\n", vol_name);
return true;
}
}
/* Set the append flag on the volume */
- if (!dev->set_append_only(getVolCatName())) {
- Jmsg(jcr, M_WARNING, 0, _("Unable to set the APPEND flag on the volume: %s, err: %s\n"),
- getVolCatName(), dev->bstrerror());
- goto mount_next_vol;
+ if (dev->device->set_vol_append_only) {
+ if (!dev->set_append_only(getVolCatName())) {
+ Jmsg(jcr, M_WARNING, 0, _("Unable to set the APPEND flag on the volume: %s, err: %s\n"),
+ getVolCatName(), dev->bstrerror());
+ goto mount_next_vol;
+ }
}
} else {
/*
{"Enabled", store_bool, ITEM(res_dev.enabled), 0, ITEM_DEFAULT, 1},
{"AutoSelect", store_bool, ITEM(res_dev.autoselect), 0, ITEM_DEFAULT, 1},
{"ReadOnly", store_bool, ITEM(res_dev.read_only), 0, ITEM_DEFAULT, 0},
- {"ProtectVolumes", store_bool, ITEM(res_dev.protect_vols), 0, ITEM_DEFAULT, 0},
+ {"SetVolumeAppendOnly", store_bool, ITEM(res_dev.set_vol_append_only), 0, ITEM_DEFAULT, 0},
+ {"SetVolumeImmutable", store_bool, ITEM(res_dev.set_vol_immutable), 0, ITEM_DEFAULT, 0},
{"MinimumVolumeProtectionTime", store_time, ITEM(res_dev.min_volume_protection_time), 0, ITEM_DEFAULT, 30*24*60*60},
{"ChangerDevice", store_strname,ITEM(res_dev.changer_name), 0, 0, 0},
{"ControlDevice", store_strname,ITEM(res_dev.control_name), 0, 0, 0},
bool enabled; /* Set when enabled (default) */
bool autoselect; /* Automatically select from AutoChanger */
bool read_only; /* Drive is read only */
- bool protect_vols; /* Protect Volumes */
+ bool set_vol_append_only; /* Set 'Append Only' filesystem flag for volumes */
+ bool set_vol_immutable; /* Set 'Immutable' filesystem flag for volumes */
utime_t min_volume_protection_time; /* Minimum Volume Protection Time */
uint32_t drive_index; /* Autochanger drive index */
uint32_t cap_bits; /* Capabilities of this device */