From: Eric Bollengier Date: Tue, 12 May 2020 17:10:46 +0000 (+0200) Subject: BEE Backport bacula/src/stored/protos.h X-Git-Tag: Release-11.3.2~1634 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1997b50a19333c6f3fb74ddefd9491ff5dd7db89;p=thirdparty%2Fbacula.git BEE Backport bacula/src/stored/protos.h This commit is the result of the squash of the following main commits: Author: Eric Bollengier Date: Fri Mar 6 18:47:34 2020 +0100 Move SIR code to bee files Author: Eric Bollengier Date: Tue Mar 3 13:16:14 2020 +0100 Move essential piece of FileMedia into bee_libsd_filemedia.c Author: Eric Bollengier Date: Mon Feb 17 14:54:36 2020 +0100 Remove BEEF for filemedia Author: Eric Bollengier Date: Mon Feb 17 14:59:09 2020 +0100 Move reset_bsr to bee_libsd_match_bsr.c Author: Eric Bollengier Date: Tue Dec 3 11:10:47 2019 +0100 Move new_match_all() to BEE module Author: Norbert Bizet Date: Mon Oct 14 05:35:57 2019 -0400 cloud: handle restore params in Cloud res Author: Alain Spineux Date: Tue Sep 24 10:17:51 2019 +0200 dedup: move all dedup code into the plugin - remove global variables: dedupengine and bucker_manager - update protocol SD<->DIR - extend dedup_dev and BufferedMsgSD to suuport all function - create "dummy" functions in dev.h Warning : - include a dedupengine use counter - .status storage=XXX dedupengine display all the dedupengine on the SD instead of the one(s) related to the "device" Author: Alain Spineux Date: Fri Apr 12 04:55:10 2019 +0200 PSK: encrypt copy jobs (SD-SD ) Author: Alain Spineux Date: Mon Apr 8 14:56:45 2019 +0200 PSK: Modify authentication in each daemon to support PSK - use AuthenticateBase class Author: Eric Bollengier Date: Mon Jun 11 09:00:30 2018 +0200 aligned: Add support for indexed streams to Aligned Volumes Author: Eric Bollengier Date: Tue Feb 13 14:27:12 2018 +0100 Add Quota feature with the Pool:MaximumPoolBytes directive The MaximumPoolBytes and the current PoolBytes values are checked when creating a new volume or moving a volume from the Scratch Pool. The parameter is also sent to the Storage daemon and the Job will control before each write that the Quota is not yet reached. If the value is reached, the storage daemon will contact the director to know the last known value. If the value is reached, then the current volume is marked as Used, and the Storage daemon will ask for a new volume. Purged and Recycled volumes are counted in the MaximumPoolBytes count. To not count these volumes, users can use the RecyclePool option to move the Purged/Recycled volumes back to the Scratch pool for example. The "llist pool" command lists the maxpoolbytes value and the current poolbytes value. The current quota can be extended or reduced wiht the reload/update pool commands. Author: Norbert Bizet Date: Mon May 22 16:36:40 2017 +0200 cloud: Add "Manual" cloud upload option and add truncate option to the upload command. --- diff --git a/bacula/src/stored/protos.h b/bacula/src/stored/protos.h index 5b47533d4f..0382de29e1 100644 --- a/bacula/src/stored/protos.h +++ b/bacula/src/stored/protos.h @@ -54,6 +54,10 @@ void create_jobmedia_queue(JCR *jcr); bool flush_jobmedia_queue(JCR *jcr); bool dir_update_device(JCR *jcr, DEVICE *dev); bool dir_update_changer(JCR *jcr, AUTOCHANGER *changer); +bool dir_create_filemedia_record(DCR *dcr); +bool dir_get_pool_info(DCR *dcr, VOLUME_CAT_INFO *volcatinfo); + +bool flush_filemedia_queue(JCR*); /* class AskDirHandler allows btool's utilities to overwrite the functions above * and even to overwrite the functions in their own sub-class like in btape @@ -67,6 +71,7 @@ public: virtual bool dir_find_next_appendable_volume(DCR *dcr) { return 1;} virtual bool dir_update_volume_info(DCR *dcr, bool relabel, bool update_LastWritten, bool use_dcr) { return 1; } virtual bool dir_create_jobmedia_record(DCR *dcr, bool zero) { return 1; } + virtual bool dir_create_filemedia_record(DCR *dcr) { return 1; } virtual bool flush_jobmedia_queue(JCR *jcr) { return true; } virtual bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; } virtual bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;} @@ -86,10 +91,20 @@ public: /* activate the functions provided by the btool's handler */ AskDirHandler *init_askdir_handler(AskDirHandler *new_askdir_handler); +/* Get the current handler defined */ +AskDirHandler *get_askdir_handler(); + /* authenticate.c */ -bool authenticate_director(JCR *jcr); +class SDAuthenticateDIR: public AuthenticateBase +{ +public: + SDAuthenticateDIR(JCR *jcr); + virtual ~SDAuthenticateDIR() {}; + bool authenticate_director(); +}; int authenticate_filed(JCR *jcr, BSOCK *fd, int FDVersion); -bool authenticate_storagedaemon(JCR *jcr); +bool send_hello_and_authenticate_sd(JCR *jcr, char *Job); + /* From autochanger.c */ bool init_autochangers(); @@ -118,6 +133,7 @@ bool check_for_newvol_or_newfile(DCR *dcr); bool do_new_file_bookkeeping(DCR *dcr); void reread_last_block(DCR *dcr); +bool is_pool_size_reached(DCR *dcr, bool quiet); /* From butil.c -- utilities for SD tool programs */ void setup_me(); @@ -165,7 +181,7 @@ void stored_free_jcr(JCR *jcr); bool validate_dir_hello(JCR* jcr); bool send_hello_ok(BSOCK *bs); bool send_sorry(BSOCK *bs); -bool send_hello_sd(JCR *jcr, char *Job); +bool send_hello_sd(JCR *jcr, char *Job, int tlspsk); bool send_hello_client(JCR *jcr, char *Job); bool read_client_hello(JCR *jcr); bool is_client_connection(BSOCK *bs); @@ -213,6 +229,7 @@ void free_restore_volume_list(JCR *jcr); void create_restore_volume_list(JCR *jcr, bool add_to_read_list); /* From record.c */ +void create_filemedia(DCR *dcr, DEV_BLOCK *block, DEV_RECORD *rec); const char *FI_to_ascii(char *buf, int fi); const char *stream_to_ascii(char *buf, int stream, int fi); const char *stream_to_ascii_ex(char *buf, int stream, int fi); @@ -230,6 +247,12 @@ bool flush_adata_to_device(DCR *dcr); void dump_record(DEV_RECORD *rec); /* From read_record.c */ +bool mount_next_vol(JCR *jcr, DCR *dcr, BSR *bsr, + SESSION_LABEL *sessrec, bool *should_stop, + bool record_cb(DCR *dcr, DEV_RECORD *rec), + bool mount_cb(DCR *dcr)); + +BSR *position_to_first_file(JCR *jcr, DCR *dcr, BSR *bsr); bool read_records(DCR *dcr, bool record_cb(DCR *dcr, DEV_RECORD *rec), bool mount_cb(DCR *dcr)); @@ -292,13 +315,35 @@ bool wait_for_device(DCR *dcr, int &retries); void store_protocol(LEX *lc, RES_ITEM *item, int index, int pass); void store_uri_style(LEX *lc, RES_ITEM *item, int index, int pass); void store_truncate(LEX *lc, RES_ITEM *item, int index, int pass); +bool find_truncate_option(const char* truncate, uint32_t& truncate_option); void store_upload(LEX *lc, RES_ITEM *item, int index, int pass); void store_devtype(LEX *lc, RES_ITEM *item, int index, int pass); void store_cloud_driver(LEX *lc, RES_ITEM *item, int index, int pass); void store_maxblocksize(LEX *lc, RES_ITEM *item, int index, int pass); +void store_transfer_priority(LEX *lc, RES_ITEM *item, int index, int pass); /* from sdcollect.c */ bool update_permanent_stats(void *data); void initialize_statcollector(); void start_collector_threads(); void terminate_collector_threads(); + +#define SIR_OK 0 +#define SIR_BREAK 1 +#define SIR_CONTINUE 2 + +int sir_init_loop(DCR *dcr, + DEVICE **dev, DEV_BLOCK **block, + bool record_cb(DCR *dcr, DEV_RECORD *rec), + bool mount_cb(DCR *dcr)); + +void sir_init(DCR *dcr); + +/* from BEE */ +#if BEEF +void store_dedup_driver(LEX *lc, RES_ITEM *item, int index, int pass); +void bee_setdebug_cmd_parse_options(JCR *, char *); +void reset_bsr(BSR *root); +#else +#define bee_setdebug_cmd_parse_options(a, b) +#endif