1 /* 2 BAREOS® - Backup Archiving REcovery Open Sourced 3 4 Copyright (C) 2000-2012 Free Software Foundation Europe e.V. 5 Copyright (C) 2011-2012 Planets Communications B.V. 6 Copyright (C) 2013-2019 Bareos GmbH & Co. KG 7 8 This program is Free Software; you can redistribute it and/or 9 modify it under the terms of version three of the GNU Affero General Public 10 License as published by the Free Software Foundation and included 11 in the file LICENSE. 12 13 This program is distributed in the hope that it will be useful, but 14 WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 Affero General Public License for more details. 17 18 You should have received a copy of the GNU Affero General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 02110-1301, USA. 22 */ 23 24 #ifndef BAREOS_SRC_STORED_JCR_PRIVATE_H_ 25 #define BAREOS_SRC_STORED_JCR_PRIVATE_H_ 26 27 #include "stored/read_ctx.h" 28 29 #define SD_APPEND 1 30 #define SD_READ 0 31 32 namespace storagedaemon { 33 34 struct VolumeList; 35 class DeviceControlRecord; 36 class DirectorResource; 37 struct BootStrapRecord; 38 39 struct ReadSession { 40 READ_CTX* rctx{}; 41 BootStrapRecord* bsr{}; 42 bool mount_next_volume{}; 43 uint32_t read_VolSessionId{}; 44 uint32_t read_VolSessionTime{}; 45 uint32_t read_StartFile{}; 46 uint32_t read_EndFile{}; 47 uint32_t read_StartBlock{}; 48 uint32_t read_EndBlock{}; 49 }; 50 51 struct DeviceWaitTimes { 52 int32_t min_wait{}; 53 int32_t max_wait{}; 54 int32_t max_num_wait{}; 55 int32_t wait_sec{}; 56 int32_t rem_wait_sec{}; 57 int32_t num_wait{}; 58 }; 59 60 } // namespace storagedaemon 61 62 63 /* clang-format off */ 64 struct JobControlRecordPrivate { 65 JobControlRecord* next_dev{}; /**< Next JobControlRecord attached to device */ 66 JobControlRecord* prev_dev{}; /**< Previous JobControlRecord attached to device */ 67 pthread_cond_t job_start_wait = PTHREAD_COND_INITIALIZER; /**< Wait for FD to start Job */ 68 pthread_cond_t job_end_wait = PTHREAD_COND_INITIALIZER; /**< Wait for Job to end */ 69 storagedaemon::DeviceControlRecord* read_dcr{}; /**< Device context for reading */ 70 storagedaemon::DeviceControlRecord* dcr{}; /**< Device context record */ 71 POOLMEM* job_name{}; /**< Base Job name (not unique) */ 72 POOLMEM* fileset_name{}; /**< FileSet */ 73 POOLMEM* fileset_md5{}; /**< MD5 for FileSet */ 74 POOLMEM* backup_format{}; /**< Backup format used when doing a NDMP backup */ 75 storagedaemon::VolumeList* VolList{}; /**< List to read */ 76 int32_t NumWriteVolumes{}; /**< Number of volumes written */ 77 int32_t NumReadVolumes{}; /**< Total number of volumes to read */ 78 int32_t CurReadVolume{}; /**< Current read volume number */ 79 int32_t label_errors{}; /**< Count of label errors */ 80 bool session_opened{}; 81 bool remote_replicate{}; /**< Replicate data to remote SD */ 82 int32_t Ticket{}; /**< Ticket for this job */ 83 bool ignore_label_errors{}; /**< Ignore Volume label errors */ 84 bool spool_attributes{}; /**< Set if spooling attributes */ 85 bool no_attributes{}; /**< Set if no attributes wanted */ 86 int64_t spool_size{}; /**< Spool size for this job */ 87 bool spool_data{}; /**< Set to spool data */ 88 storagedaemon::DirectorResource* director{}; /**< Director resource */ 89 alist* plugin_options{}; /**< Specific Plugin Options sent by DIR */ 90 alist* write_store{}; /**< List of write storage devices sent by DIR */ 91 alist* read_store{}; /**< List of read devices sent by DIR */ 92 alist* reserve_msgs{}; /**< Reserve fail messages */ 93 bool acquired_storage{}; /**< Did we acquire our reserved storage already or not */ 94 bool PreferMountedVols{}; /**< Prefer mounted vols rather than new */ 95 bool insert_jobmedia_records{}; /**< Need to insert job media records */ 96 uint64_t RemainingQuota{}; /**< Available bytes to use as quota */ 97 98 storagedaemon::ReadSession read_session; 99 storagedaemon::DeviceWaitTimes device_wait_times; 100 }; 101 /* clang-format on */ 102 103 #endif // BAREOS_SRC_STORED_JCR_PRIVATE_H_ 104