X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Fdircmd.c;h=61e51fae2a43536f35de9e7d95e410b173eb951d;hb=5f999d41de529913e0c978b2dcac765e2928aeac;hp=c9b74b000f875c6395e7039af29430aa7510b098;hpb=e139afbb38f6ae625b475b9a705102054c4c3707;p=bacula%2Fbacula diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index c9b74b000f..61e51fae2a 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -880,24 +880,26 @@ static bool unmount_cmd(JCR *jcr) * after purging a volume so that disk space will not be wasted. Only useful * for File Storage, of course. * + * + * It is currently disabled */ static bool action_on_purge_cmd(JCR *jcr) { - char devname[MAX_NAME_LENGTH]; - char volumename[MAX_NAME_LENGTH]; BSOCK *dir = jcr->dir_bsock; - DEVICE *dev; - DCR *dcr; - int action; /* Currently disabled */ dir->fsend(_("3916 Feature action_on_purge currently disabled\n")); + goto done; #if 0 + char devname[MAX_NAME_LENGTH]; + char volumename[MAX_NAME_LENGTH]; + int action; + /* TODO: Need to find a free device and ask for slot to the director */ if (sscanf(dir->msg, "action_on_purge %127s vol=%127s action=%d", - devname.c_str(), volumename.c_str(), &action)!= 5) + devname, volumename, &action)!= 5) { dir->fsend(_("3916 Error scanning action_on_purge command\n")); goto done; @@ -906,39 +908,10 @@ static bool action_on_purge_cmd(JCR *jcr) unbash_spaces(devname); /* Check if action is correct */ - switch (action) { - case AOP_TRUNCTATE: - break; - default: - dir->fsend(_("3919 Bad ActionOnPurge\n")); - goto done; - } - - /* TODO: Ask for Volume information - * - check recycle - * - find slot - */ - - /* FIXME: autochanger, drive = 0? how can we avoid that? we only work on - * files - */ - if ((dcr = find_device(jcr, devname, 0)) == NULL) { - dir->fsend(_("3999 Device \"%s\" not found or could not be opened.\n"), devname.c_str()); - goto done; - } - - dev = dcr->dev; + if (action & AOP_TRUNCTATE) { - /* Store the VolumeName for opening and re-labeling the volume */ - bstrncpy(dcr->VolumeName, volumename.c_str(), sizeof(dcr->VolumeName)); - bstrncpy(dev->VolHdr.VolumeName, volumename.c_str(), sizeof(dev->VolHdr.VolumeName)); - - /* Re-write the label with the recycle flag */ - if (rewrite_volume_label(dcr, true)) { - dir->fsend(_("3917 Volume recycled\n")); - } else { - dir->fsend(_("3918 Recycle failed\n")); - } + } + /* ... */ #endif done: