]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/spool.c
Move reservations message lock to lock jcr only this
[bacula/bacula] / bacula / src / stored / spool.c
index ee26ee7a869af19b7f2bd84bd8d68823f279cc47..62426a0c34c13947a23327364ba5607e808869a4 100644 (file)
@@ -7,8 +7,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -81,6 +81,8 @@ void list_spool_stats(void sendit(const char *msg, int len, void *sarg), void *a
    POOL_MEM msg(PM_MESSAGE);
    int len;
 
+   len = Mmsg(msg, _("Spooling statistics:\n"));
+
    if (spool_stats.data_jobs || spool_stats.max_data_size) {
       len = Mmsg(msg, _("Data spooling: %u active jobs, %s bytes; %u total jobs, %s max bytes/job.\n"),
          spool_stats.data_jobs, edit_uint64_with_commas(spool_stats.data_size, ed1),
@@ -97,6 +99,8 @@ void list_spool_stats(void sendit(const char *msg, int len, void *sarg), void *a
    
       sendit(msg.c_str(), len, arg);
    }
+   len = Mmsg(msg, "====\n");
+   sendit(msg.c_str(), len, arg);
 }
 
 bool begin_data_spool(DCR *dcr)
@@ -253,9 +257,8 @@ static bool despool_data(DCR *dcr, bool commit)
    rdev->max_block_size = dcr->dev->max_block_size;
    rdev->min_block_size = dcr->dev->min_block_size;
    rdev->device = dcr->dev->device;
-   rdcr = new_dcr(jcr, rdev);
+   rdcr = new_dcr(jcr, NULL, rdev);
    rdcr->spool_fd = dcr->spool_fd;
-   rdcr->jcr = jcr;                   /* set a valid jcr */
    block = dcr->block;                /* save block */
    dcr->block = rdcr->block;          /* make read and write block the same */
 
@@ -674,6 +677,6 @@ bool close_attr_spool_file(JCR *jcr, BSOCK *bs)
    unlink(name);
    free_pool_memory(name);
    bs->m_spool_fd = NULL;
-   bs->m_spool = false;
+   bs->clear_spooling();
    return true;
 }