X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Fstored.h;h=abb2f8db1f9f2ea0c8a0e14d2a51415288ae65a0;hb=10cfd798ced2d27f61ead2de6fe9b1bcc8e3468d;hp=7744daff6abcb911423d2b5428e3fdad5c232376;hpb=b5752d5d38754259dc2bb30e1461ae0431c2333d;p=bacula%2Fbacula diff --git a/bacula/src/stored/stored.h b/bacula/src/stored/stored.h index 7744daff6a..abb2f8db1f 100644 --- a/bacula/src/stored/stored.h +++ b/bacula/src/stored/stored.h @@ -1,52 +1,105 @@ +/* + Bacula(R) - The Network Backup Solution + + Copyright (C) 2000-2017 Kern Sibbald + + The original author of Bacula is Kern Sibbald, with contributions + from many others, a complete list can be found in the file AUTHORS. + + You may use this file and others of this release according to the + license defined in the LICENSE file, which includes the Affero General + Public License, v3.0 ("AGPLv3") and some additional permissions and + terms pursuant to its AGPLv3 Section 7. + + This notice must be preserved when any source code is + conveyed and/or propagated. + + Bacula(R) is a registered trademark of Kern Sibbald. +*/ /* * Storage daemon specific defines and includes * - * Version $Id$ */ -/* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. +#ifndef __STORED_H_ +#define __STORED_H_ - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. +#define STORAGE_DAEMON 1 - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. +/* Set to debug Lock() and Unlock() only */ +#define DEV_DEBUG_LOCK +/* + * Set to define all SD locks except Lock() + * currently this does not work. More locks + * must be converted. */ +#define SD_DEBUG_LOCK +#ifdef SD_DEBUG_LOCK +const int sd_dbglvl = 300; +#else +const int sd_dbglvl = 300; +#endif -#ifndef __STORED_H_ -#define __STORED_H_ +#undef SD_DEDUP_SUPPORT -#include +#ifdef HAVE_MTIO_H +#include +#else +# ifdef HAVE_SYS_MTIO_H +# include +# else +# ifdef HAVE_SYS_TAPE_H +# include +# else + /* Needed for Mac 10.6 (Snow Leopard) */ +# include "lib/bmtio.h" +# endif +# endif +#endif +#include "lock.h" #include "block.h" #include "record.h" #include "dev.h" #include "stored_conf.h" +#include "bsr.h" #include "jcr.h" +#include "vol_mgr.h" +#include "reserve.h" #include "protos.h" +#ifdef HAVE_LIBZ +#include /* compression headers */ +#else +#define uLongf uint32_t +#endif +#ifdef HAVE_FNMATCH +#include +#else +#include "lib/fnmatch.h" +#endif +#ifdef HAVE_DIRENT_H +#include +#define NAMELEN(dirent) (strlen((dirent)->d_name)) +#endif +#ifndef HAVE_READDIR_R +int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); +#endif -/* **** FIXME make this dynamic ****/ -#define MAX_DEVICES 20 - -/* - * Old shared memory buffer. Shared memory no longer used, - * so this just acts as a global. - */ -struct s_shm { - long VolSessionId; - long VolSessionTime; - DEVICE dev[MAX_DEVICES]; -}; +#include "file_dev.h" +#include "tape_dev.h" +#include "fifo_dev.h" +#include "null_dev.h" +#include "vtape_dev.h" +#include "cloud_dev.h" +#include "aligned_dev.h" +#include "win_file_dev.h" +#include "win_tape_dev.h" +#include "sd_plugins.h" -extern char errmsg[]; /* general error message */ +/* Daemon globals from stored.c */ +extern STORES *me; /* "Global" daemon resource */ +extern bool forge_on; /* proceed inspite of I/O errors */ +extern pthread_mutex_t device_release_mutex; +extern pthread_cond_t wait_device_release; /* wait for any device to be released */ #endif /* __STORED_H_ */