From 0a9df1396b3b144f5593c39cc14534bcb7827fac Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 13 Jan 2004 14:09:41 +0000 Subject: [PATCH] Make mark run *MUCH* faster in restore tree + update copyright on changed files git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1010 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/baconfig.h | 2 +- bacula/src/bacula.h | 2 +- bacula/src/c | 2 +- bacula/src/cats/cats.h | 408 +++++++++++++++---------------- bacula/src/cats/mysql.c | 2 +- bacula/src/cats/postgresql.c | 2 +- bacula/src/cats/sql.c | 2 +- bacula/src/cats/sql_find.c | 2 +- bacula/src/cats/sql_update.c | 30 +-- bacula/src/cats/sqlite.c | 2 +- bacula/src/cl | 2 +- bacula/src/console/conio.c | 2 +- bacula/src/dird/dird.c | 2 +- bacula/src/dird/dird_conf.c | 2 +- bacula/src/dird/job.c | 2 +- bacula/src/dird/msgchan.c | 2 +- bacula/src/dird/recycle.c | 2 +- bacula/src/dird/scheduler.c | 2 +- bacula/src/dird/sql_cmds.c | 6 +- bacula/src/dird/ua_cmds.c | 2 +- bacula/src/dird/ua_purge.c | 2 +- bacula/src/dird/ua_restore.c | 10 +- bacula/src/dird/ua_tree.c | 15 +- bacula/src/filed/filed.c | 2 +- bacula/src/filed/job.c | 2 +- bacula/src/filed/win32/winres.rc | 4 +- bacula/src/findlib/attribs.c | 43 +++- bacula/src/findlib/create_file.c | 2 +- bacula/src/findlib/protos.h | 21 +- bacula/src/host.h.in | 2 +- bacula/src/jcr.h | 2 +- bacula/src/lib/bsock.h | 2 +- bacula/src/lib/btime.c | 2 +- bacula/src/lib/dlist.c | 2 +- bacula/src/lib/tree.h | 18 +- bacula/src/lib/var.c | 2 +- bacula/src/lib/watchdog.c | 2 +- bacula/src/lib/watchdog.h | 2 +- bacula/src/stored/askdir.c | 2 +- bacula/src/stored/bcopy.c | 2 +- bacula/src/stored/bextract.c | 4 +- bacula/src/stored/block.c | 2 +- bacula/src/stored/bls.c | 2 +- bacula/src/stored/bscan.c | 2 +- bacula/src/stored/btape.c | 2 +- bacula/src/stored/dev.c | 2 +- bacula/src/stored/dev.h | 218 ++++++++--------- bacula/src/stored/device.c | 2 +- bacula/src/stored/dircmd.c | 2 +- bacula/src/stored/mount.c | 2 +- bacula/src/stored/status.c | 2 +- bacula/src/stored/stored.c | 2 +- bacula/src/stored/stored_conf.c | 2 +- bacula/src/stored/stored_conf.h | 90 +++---- bacula/src/tools/bsmtp.c | 2 +- 55 files changed, 503 insertions(+), 450 deletions(-) diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index b9c6cd9719..95205cfb5c 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -5,7 +5,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/bacula.h b/bacula/src/bacula.h index 80d6eba43c..c1ab192866 100644 --- a/bacula/src/bacula.h +++ b/bacula/src/bacula.h @@ -5,7 +5,7 @@ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/c b/bacula/src/c index d57a7ad9ed..c910dbd8ec 100644 --- a/bacula/src/c +++ b/bacula/src/c @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 21a9ad199e..10fd0c5f45 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -15,7 +15,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 @@ -57,71 +57,71 @@ struct sqlite { char dummy; }; -#define IS_NUM(x) ((x) == 1) -#define IS_NOT_NULL(x) ((x) == 1) +#define IS_NUM(x) ((x) == 1) +#define IS_NOT_NULL(x) ((x) == 1) typedef struct s_sql_field { - char *name; /* name of column */ - int length; /* length */ - int max_length; /* max length */ - uint32_t type; /* type */ - uint32_t flags; /* flags */ + char *name; /* name of column */ + int length; /* length */ + int max_length; /* max length */ + uint32_t type; /* type */ + uint32_t flags; /* flags */ } SQL_FIELD; /* * This is the "real" definition that should only be * used inside sql.c and associated database interface * subroutines. - * S Q L I T E + * S Q L I T E */ typedef struct s_db { - BQUEUE bq; /* queue control */ - brwlock_t lock; /* transaction lock */ + BQUEUE bq; /* queue control */ + brwlock_t lock; /* transaction lock */ struct sqlite *db; char **result; int status; - int nrow; /* nrow returned from sqlite */ - int ncolumn; /* ncolum returned from sqlite */ - int num_rows; /* used by code */ - int row; /* seek row */ - int have_insert_id; /* do not have insert id */ - int fields_defined; /* set when fields defined */ - int field; /* seek field */ - SQL_FIELD **fields; /* defined fields */ + int nrow; /* nrow returned from sqlite */ + int ncolumn; /* ncolum returned from sqlite */ + int num_rows; /* used by code */ + int row; /* seek row */ + int have_insert_id; /* do not have insert id */ + int fields_defined; /* set when fields defined */ + int field; /* seek field */ + SQL_FIELD **fields; /* defined fields */ int ref_count; char *db_name; char *db_user; - char *db_address; /* host name address */ - char *db_socket; /* socket for local access */ + char *db_address; /* host name address */ + char *db_socket; /* socket for local access */ char *db_password; - int db_port; /* port for host name address */ + int db_port; /* port for host name address */ int connected; - char *sqlite_errmsg; /* error message returned by sqlite */ - POOLMEM *errmsg; /* nicely edited error message */ - POOLMEM *cmd; /* SQL command string */ - POOLMEM *cached_path; /* cached path name */ - int cached_path_len; /* length of cached path */ - uint32_t cached_path_id; /* cached path id */ - int transaction; /* transaction started */ - int changes; /* changes during transaction */ - POOLMEM *fname; /* Filename only */ - POOLMEM *path; /* Path only */ - POOLMEM *esc_name; /* Escaped file/path name */ - int fnl; /* file name length */ - int pnl; /* path name length */ + char *sqlite_errmsg; /* error message returned by sqlite */ + POOLMEM *errmsg; /* nicely edited error message */ + POOLMEM *cmd; /* SQL command string */ + POOLMEM *cached_path; /* cached path name */ + int cached_path_len; /* length of cached path */ + uint32_t cached_path_id; /* cached path id */ + int transaction; /* transaction started */ + int changes; /* changes during transaction */ + POOLMEM *fname; /* Filename only */ + POOLMEM *path; /* Path only */ + POOLMEM *esc_name; /* Escaped file/path name */ + int fnl; /* file name length */ + int pnl; /* path name length */ } B_DB; /* * "Generic" names for easier conversion * - * S Q L I T E + * S Q L I T E */ #define sql_store_result(x) (x)->result #define sql_free_result(x) my_sqlite_free_table(x) #define sql_fetch_row(x) my_sqlite_fetch_row(x) #define sql_query(x, y) my_sqlite_query((x), (y)) -#define sql_close(x) sqlite_close((x)->db) +#define sql_close(x) sqlite_close((x)->db) #define sql_strerror(x) (x)->sqlite_errmsg?(x)->sqlite_errmsg:"unknown" #define sql_num_rows(x) (x)->nrow #define sql_data_seek(x, i) (x)->row = (i) @@ -130,15 +130,15 @@ typedef struct s_db { #define sql_field_seek(x, y) my_sqlite_field_seek((x), (y)) #define sql_fetch_field(x) my_sqlite_fetch_field(x) #define sql_num_fields(x) ((x)->ncolumn) -#define SQL_ROW char** +#define SQL_ROW char** /* In cats/sqlite.c */ -void my_sqlite_free_table(B_DB *mdb); +void my_sqlite_free_table(B_DB *mdb); SQL_ROW my_sqlite_fetch_row(B_DB *mdb); -int my_sqlite_query(B_DB *mdb, char *cmd); -void my_sqlite_field_seek(B_DB *mdb, int field); +int my_sqlite_query(B_DB *mdb, char *cmd); +void my_sqlite_field_seek(B_DB *mdb, int field); SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb); @@ -155,11 +155,11 @@ SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb); * used inside sql.c and associated database interface * subroutines. * - * M Y S Q L + * M Y S Q L */ typedef struct s_db { - BQUEUE bq; /* queue control */ - brwlock_t lock; /* transaction lock */ + BQUEUE bq; /* queue control */ + brwlock_t lock; /* transaction lock */ MYSQL mysql; MYSQL *db; MYSQL_RES *result; @@ -169,22 +169,22 @@ typedef struct s_db { char *db_name; char *db_user; char *db_password; - char *db_address; /* host address */ - char *db_socket; /* socket for local access */ - int db_port; /* port of host address */ - int have_insert_id; /* do have insert_id() */ + char *db_address; /* host address */ + char *db_socket; /* socket for local access */ + int db_port; /* port of host address */ + int have_insert_id; /* do have insert_id() */ int connected; - POOLMEM *errmsg; /* nicely edited error message */ - POOLMEM *cmd; /* SQL command string */ + POOLMEM *errmsg; /* nicely edited error message */ + POOLMEM *cmd; /* SQL command string */ POOLMEM *cached_path; - int cached_path_len; /* length of cached path */ + int cached_path_len; /* length of cached path */ uint32_t cached_path_id; - int changes; /* changes made to db */ - POOLMEM *fname; /* Filename only */ - POOLMEM *path; /* Path only */ - POOLMEM *esc_name; /* Escaped file/path name */ - int fnl; /* file name length */ - int pnl; /* path name length */ + int changes; /* changes made to db */ + POOLMEM *fname; /* Filename only */ + POOLMEM *path; /* Path only */ + POOLMEM *esc_name; /* Escaped file/path name */ + int fnl; /* file name length */ + int pnl; /* path name length */ } B_DB; #define DB_STATUS int @@ -194,7 +194,7 @@ typedef struct s_db { #define sql_free_result(x) mysql_free_result((x)->result) #define sql_fetch_row(x) mysql_fetch_row((x)->result) #define sql_query(x, y) mysql_query((x)->db, (y)) -#define sql_close(x) mysql_close((x)->db) +#define sql_close(x) mysql_close((x)->db) #define sql_strerror(x) mysql_error((x)->db) #define sql_num_rows(x) mysql_num_rows((x)->result) #define sql_data_seek(x, i) mysql_data_seek((x)->result, (i)) @@ -203,8 +203,8 @@ typedef struct s_db { #define sql_field_seek(x, y) mysql_field_seek((x)->result, (y)) #define sql_fetch_field(x) mysql_fetch_field((x)->result) #define sql_num_fields(x) (int)mysql_num_fields((x)->result) -#define SQL_ROW MYSQL_ROW -#define SQL_FIELD MYSQL_FIELD +#define SQL_ROW MYSQL_ROW +#define SQL_FIELD MYSQL_FIELD #else @@ -215,15 +215,15 @@ typedef struct s_db { #include /* TEMP: the following is taken from select OID, typname from pg_type; */ -#define IS_NUM(x) ((x) == 20 || (x) == 21 || (x) == 23 || (x) == 700 || (x) == 701) -#define IS_NOT_NULL(x) ((x) == 1) +#define IS_NUM(x) ((x) == 20 || (x) == 21 || (x) == 23 || (x) == 700 || (x) == 701) +#define IS_NOT_NULL(x) ((x) == 1) typedef char **POSTGRESQL_ROW; typedef struct pg_field { - char *name; - int max_length; - unsigned int type; - unsigned int flags; // 1 == not null + char *name; + int max_length; + unsigned int type; + unsigned int flags; // 1 == not null } POSTGRESQL_FIELD; @@ -232,11 +232,11 @@ typedef struct pg_field { * used inside sql.c and associated database interface * subroutines. * - * P O S T G R E S Q L + * P O S T G R E S Q L */ typedef struct s_db { - BQUEUE bq; /* queue control */ - brwlock_t lock; /* transaction lock */ + BQUEUE bq; /* queue control */ + brwlock_t lock; /* transaction lock */ PGconn *db; PGresult *result; int status; @@ -244,36 +244,36 @@ typedef struct s_db { POSTGRESQL_FIELD *fields; int num_rows; int num_fields; - int row_number; /* what row number did we get via my_postgresql_data_seek? */ - int field_number; /* what field number did we get via my_postgresql_field_seek? */ + int row_number; /* what row number did we get via my_postgresql_data_seek? */ + int field_number; /* what field number did we get via my_postgresql_field_seek? */ int ref_count; char *db_name; char *db_user; char *db_password; - char *db_address; /* host address */ - char *db_socket; /* socket for local access */ - int db_port; /* port of host address */ - int have_insert_id; /* do have insert_id() */ + char *db_address; /* host address */ + char *db_socket; /* socket for local access */ + int db_port; /* port of host address */ + int have_insert_id; /* do have insert_id() */ int connected; - POOLMEM *errmsg; /* nicely edited error message */ - POOLMEM *cmd; /* SQL command string */ + POOLMEM *errmsg; /* nicely edited error message */ + POOLMEM *cmd; /* SQL command string */ POOLMEM *cached_path; - int cached_path_len; /* length of cached path */ + int cached_path_len; /* length of cached path */ uint32_t cached_path_id; - int changes; /* changes made to db */ - POOLMEM *fname; /* Filename only */ - POOLMEM *path; /* Path only */ - POOLMEM *esc_name; /* Escaped file/path name */ - int fnl; /* file name length */ - int pnl; /* path name length */ + int changes; /* changes made to db */ + POOLMEM *fname; /* Filename only */ + POOLMEM *path; /* Path only */ + POOLMEM *esc_name; /* Escaped file/path name */ + int fnl; /* file name length */ + int pnl; /* path name length */ } B_DB; -void my_postgresql_free_result(B_DB *mdb); -POSTGRESQL_ROW my_postgresql_fetch_row (B_DB *mdb); -int my_postgresql_query (B_DB *mdb, char *query); -void my_postgresql_data_seek (B_DB *mdb, int row); -int my_postgresql_currval (B_DB *mdb, char *table_name); -void my_postgresql_field_seek (B_DB *mdb, int row); +void my_postgresql_free_result(B_DB *mdb); +POSTGRESQL_ROW my_postgresql_fetch_row (B_DB *mdb); +int my_postgresql_query (B_DB *mdb, char *query); +void my_postgresql_data_seek (B_DB *mdb, int row); +int my_postgresql_currval (B_DB *mdb, char *table_name); +void my_postgresql_field_seek (B_DB *mdb, int row); POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb); @@ -282,7 +282,7 @@ POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb); #define sql_free_result(x) my_postgresql_free_result(x) #define sql_fetch_row(x) my_postgresql_fetch_row(x) #define sql_query(x, y) my_postgresql_query((x), (y)) -#define sql_close(x) PQfinish((x)->db) +#define sql_close(x) PQfinish((x)->db) #define sql_strerror(x) PQresultErrorMessage((x)->result) #define sql_num_rows(x) ((unsigned) PQntuples((x)->result)) #define sql_data_seek(x, i) my_postgresql_data_seek((x), (i)) @@ -291,8 +291,8 @@ POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb); #define sql_field_seek(x, y) my_postgresql_field_seek((x), (y)) #define sql_fetch_field(x) my_postgresql_fetch_field(x) #define sql_num_fields(x) ((x)->num_fields) -#define SQL_ROW POSTGRESQL_ROW -#define SQL_FIELD POSTGRESQL_FIELD +#define SQL_ROW POSTGRESQL_ROW +#define SQL_FIELD POSTGRESQL_FIELD #else /* USE BACULA DB routines */ @@ -301,17 +301,17 @@ POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb); /* Change this each time there is some incompatible * file format change!!!! */ -#define BDB_VERSION 12 /* file version number */ +#define BDB_VERSION 12 /* file version number */ struct s_control { - int bdb_version; /* Version number */ - uint32_t JobId; /* next Job Id */ - uint32_t PoolId; /* next Pool Id */ - uint32_t MediaId; /* next Media Id */ - uint32_t JobMediaId; /* next JobMedia Id */ - uint32_t ClientId; /* next Client Id */ - uint32_t FileSetId; /* nest FileSet Id */ - time_t time; /* time file written */ + int bdb_version; /* Version number */ + uint32_t JobId; /* next Job Id */ + uint32_t PoolId; /* next Pool Id */ + uint32_t MediaId; /* next Media Id */ + uint32_t JobMediaId; /* next JobMedia Id */ + uint32_t ClientId; /* next Client Id */ + uint32_t FileSetId; /* nest FileSet Id */ + time_t time; /* time file written */ }; @@ -319,23 +319,23 @@ struct s_control { * Bacula internal DB */ typedef struct s_db { - BQUEUE bq; /* queue control */ -/* pthread_mutex_t mutex; */ /* single thread lock */ - brwlock_t lock; /* transaction lock */ - int ref_count; /* number of times opened */ - struct s_control control; /* control file structure */ - int cfd; /* control file device */ - FILE *jobfd; /* Jobs records file descriptor */ - FILE *poolfd; /* Pool records fd */ - FILE *mediafd; /* Media records fd */ - FILE *jobmediafd; /* JobMedia records fd */ - FILE *clientfd; /* Client records fd */ - FILE *filesetfd; /* FileSet records fd */ - char *db_name; /* name of database */ - POOLMEM *errmsg; /* nicely edited error message */ - POOLMEM *cmd; /* Command string */ + BQUEUE bq; /* queue control */ +/* pthread_mutex_t mutex; */ /* single thread lock */ + brwlock_t lock; /* transaction lock */ + int ref_count; /* number of times opened */ + struct s_control control; /* control file structure */ + int cfd; /* control file device */ + FILE *jobfd; /* Jobs records file descriptor */ + FILE *poolfd; /* Pool records fd */ + FILE *mediafd; /* Media records fd */ + FILE *jobmediafd; /* JobMedia records fd */ + FILE *clientfd; /* Client records fd */ + FILE *filesetfd; /* FileSet records fd */ + char *db_name; /* name of database */ + POOLMEM *errmsg; /* nicely edited error message */ + POOLMEM *cmd; /* Command string */ POOLMEM *cached_path; - int cached_path_len; /* length of cached path */ + int cached_path_len; /* length of cached path */ uint32_t cached_path_id; } B_DB; @@ -350,12 +350,12 @@ typedef struct s_db { #define DELETE_DB(jcr, db, cmd) DeleteDB(__FILE__, __LINE__, jcr, db, cmd) -#else /* not __SQL_C */ +#else /* not __SQL_C */ /* This is a "dummy" definition for use outside of sql.c */ -typedef struct s_db { - int dummy; /* for SunOS compiler */ +typedef struct s_db { + int dummy; /* for SunOS compiler */ } B_DB; #endif /* __SQL_C */ @@ -366,7 +366,7 @@ extern uint32_t bacula_db_version; * but at the current time, this breaks MySQL. */ typedef uint32_t FileId_t; -typedef uint32_t DBId_t; /* general DB id type */ +typedef uint32_t DBId_t; /* general DB id type */ typedef uint32_t JobId_t; #define faddr_t long @@ -380,18 +380,18 @@ typedef uint32_t JobId_t; /* Job record */ struct JOB_DBR { JobId_t JobId; - char Job[MAX_NAME_LENGTH]; /* Job unique name */ - char Name[MAX_NAME_LENGTH]; /* Job base name */ - int Type; /* actually char(1) */ - int Level; /* actually char(1) */ - int JobStatus; /* actually char(1) */ - uint32_t ClientId; /* Id of client */ - uint32_t PoolId; /* Id of pool */ - uint32_t FileSetId; /* Id of FileSet */ - time_t SchedTime; /* Time job scheduled */ - time_t StartTime; /* Job start time */ - time_t EndTime; /* Job termination time */ - utime_t JobTDate; /* Backup time/date in seconds */ + char Job[MAX_NAME_LENGTH]; /* Job unique name */ + char Name[MAX_NAME_LENGTH]; /* Job base name */ + int Type; /* actually char(1) */ + int Level; /* actually char(1) */ + int JobStatus; /* actually char(1) */ + uint32_t ClientId; /* Id of client */ + uint32_t PoolId; /* Id of pool */ + uint32_t FileSetId; /* Id of FileSet */ + time_t SchedTime; /* Time job scheduled */ + time_t StartTime; /* Job start time */ + time_t EndTime; /* Job termination time */ + utime_t JobTDate; /* Backup time/date in seconds */ uint32_t VolSessionId; uint32_t VolSessionTime; uint32_t JobFiles; @@ -402,8 +402,8 @@ struct JOB_DBR { /* Note, FirstIndex, LastIndex, Start/End File and Block * are only used in the JobMedia record. */ - uint32_t FirstIndex; /* First index this Volume */ - uint32_t LastIndex; /* Last index this Volume */ + uint32_t FirstIndex; /* First index this Volume */ + uint32_t LastIndex; /* Last index this Volume */ uint32_t StartFile; uint32_t EndFile; uint32_t StartBlock; @@ -421,28 +421,28 @@ struct JOB_DBR { */ /* JobMedia record */ struct JOBMEDIA_DBR { - uint32_t JobMediaId; /* record id */ - JobId_t JobId; /* JobId */ - uint32_t MediaId; /* MediaId */ - uint32_t FirstIndex; /* First index this Volume */ - uint32_t LastIndex; /* Last index this Volume */ - uint32_t StartFile; /* File for start of data */ - uint32_t EndFile; /* End file on Volume */ - uint32_t StartBlock; /* start block on tape */ - uint32_t EndBlock; /* last block */ + uint32_t JobMediaId; /* record id */ + JobId_t JobId; /* JobId */ + uint32_t MediaId; /* MediaId */ + uint32_t FirstIndex; /* First index this Volume */ + uint32_t LastIndex; /* Last index this Volume */ + uint32_t StartFile; /* File for start of data */ + uint32_t EndFile; /* End file on Volume */ + uint32_t StartBlock; /* start block on tape */ + uint32_t EndBlock; /* last block */ }; /* Volume Parameter structure */ struct VOL_PARAMS { char VolumeName[MAX_NAME_LENGTH]; /* Volume name */ - uint32_t VolIndex; /* Volume seqence no. */ - uint32_t FirstIndex; /* First index this Volume */ - uint32_t LastIndex; /* Last index this Volume */ - uint32_t StartFile; /* File for start of data */ - uint32_t EndFile; /* End file on Volume */ - uint32_t StartBlock; /* start block on tape */ - uint32_t EndBlock; /* last block */ + uint32_t VolIndex; /* Volume seqence no. */ + uint32_t FirstIndex; /* First index this Volume */ + uint32_t LastIndex; /* Last index this Volume */ + uint32_t StartFile; /* File for start of data */ + uint32_t EndFile; /* End file on Volume */ + uint32_t StartBlock; /* start block on tape */ + uint32_t EndBlock; /* last block */ }; @@ -451,9 +451,9 @@ struct VOL_PARAMS { * records (e.g. pathname, filename, fileattributes). */ struct ATTR_DBR { - char *fname; /* full path & filename */ - char *link; /* link if any */ - char *attr; /* attributes statp */ + char *fname; /* full path & filename */ + char *link; /* link if any */ + char *attr; /* attributes statp */ uint32_t FileIndex; uint32_t Stream; JobId_t JobId; @@ -475,26 +475,26 @@ struct FILE_DBR { char LStat[256]; /* int Status; */ char SIG[50]; - int SigType; /* NO_SIG/MD5_SIG/SHA1_SIG */ + int SigType; /* NO_SIG/MD5_SIG/SHA1_SIG */ }; /* Pool record -- same format as database */ struct POOL_DBR { uint32_t PoolId; - char Name[MAX_NAME_LENGTH]; /* Pool name */ - uint32_t NumVols; /* total number of volumes */ - uint32_t MaxVols; /* max allowed volumes */ - int32_t UseOnce; /* set to use once only */ - int32_t UseCatalog; /* set to use catalog */ - int32_t AcceptAnyVolume; /* set to accept any volume sequence */ - int32_t AutoPrune; /* set to prune automatically */ - int32_t Recycle; /* default Vol recycle flag */ - utime_t VolRetention; /* retention period in seconds */ - utime_t VolUseDuration; /* time in secs volume can be used */ - uint32_t MaxVolJobs; /* Max Jobs on Volume */ - uint32_t MaxVolFiles; /* Max files on Volume */ - uint64_t MaxVolBytes; /* Max bytes on Volume */ - char PoolType[MAX_NAME_LENGTH]; + char Name[MAX_NAME_LENGTH]; /* Pool name */ + uint32_t NumVols; /* total number of volumes */ + uint32_t MaxVols; /* max allowed volumes */ + int32_t UseOnce; /* set to use once only */ + int32_t UseCatalog; /* set to use catalog */ + int32_t AcceptAnyVolume; /* set to accept any volume sequence */ + int32_t AutoPrune; /* set to prune automatically */ + int32_t Recycle; /* default Vol recycle flag */ + utime_t VolRetention; /* retention period in seconds */ + utime_t VolUseDuration; /* time in secs volume can be used */ + uint32_t MaxVolJobs; /* Max Jobs on Volume */ + uint32_t MaxVolFiles; /* Max files on Volume */ + uint64_t MaxVolBytes; /* Max bytes on Volume */ + char PoolType[MAX_NAME_LENGTH]; char LabelFormat[MAX_NAME_LENGTH]; /* Extra stuff not in DB */ faddr_t rec_addr; @@ -502,37 +502,37 @@ struct POOL_DBR { /* Media record -- same as the database */ struct MEDIA_DBR { - uint32_t MediaId; /* Unique volume id */ + uint32_t MediaId; /* Unique volume id */ char VolumeName[MAX_NAME_LENGTH]; /* Volume name */ char MediaType[MAX_NAME_LENGTH]; /* Media type */ - uint32_t PoolId; /* Pool id */ - time_t FirstWritten; /* Time Volume first written */ - time_t LastWritten; /* Time Volume last written */ - time_t LabelDate; /* Date/Time Volume labeled */ - uint32_t VolJobs; /* number of jobs on this medium */ - uint32_t VolFiles; /* Number of files */ - uint32_t VolBlocks; /* Number of blocks */ - uint32_t VolMounts; /* Number of times mounted */ - uint32_t VolErrors; /* Number of read/write errors */ - uint32_t VolWrites; /* Number of writes */ - uint32_t VolReads; /* Number of reads */ - uint64_t VolBytes; /* Number of bytes written */ - uint64_t MaxVolBytes; /* Max bytes to write to Volume */ - uint64_t VolCapacityBytes; /* capacity estimate */ - uint64_t VolReadTime; /* time spent reading volume */ - uint64_t VolWriteTime; /* time spent writing volume */ - utime_t VolRetention; /* Volume retention in seconds */ - utime_t VolUseDuration; /* time in secs volume can be used */ - uint32_t MaxVolJobs; /* Max Jobs on Volume */ - uint32_t MaxVolFiles; /* Max files on Volume */ - int32_t Recycle; /* recycle yes/no */ - int32_t Slot; /* slot in changer */ - int32_t InChanger; /* Volume currently in changer */ - char VolStatus[20]; /* Volume status */ + uint32_t PoolId; /* Pool id */ + time_t FirstWritten; /* Time Volume first written */ + time_t LastWritten; /* Time Volume last written */ + time_t LabelDate; /* Date/Time Volume labeled */ + uint32_t VolJobs; /* number of jobs on this medium */ + uint32_t VolFiles; /* Number of files */ + uint32_t VolBlocks; /* Number of blocks */ + uint32_t VolMounts; /* Number of times mounted */ + uint32_t VolErrors; /* Number of read/write errors */ + uint32_t VolWrites; /* Number of writes */ + uint32_t VolReads; /* Number of reads */ + uint64_t VolBytes; /* Number of bytes written */ + uint64_t MaxVolBytes; /* Max bytes to write to Volume */ + uint64_t VolCapacityBytes; /* capacity estimate */ + uint64_t VolReadTime; /* time spent reading volume */ + uint64_t VolWriteTime; /* time spent writing volume */ + utime_t VolRetention; /* Volume retention in seconds */ + utime_t VolUseDuration; /* time in secs volume can be used */ + uint32_t MaxVolJobs; /* Max Jobs on Volume */ + uint32_t MaxVolFiles; /* Max files on Volume */ + int32_t Recycle; /* recycle yes/no */ + int32_t Slot; /* slot in changer */ + int32_t InChanger; /* Volume currently in changer */ + char VolStatus[20]; /* Volume status */ /* Extra stuff not in DB */ - faddr_t rec_addr; /* found record address */ + faddr_t rec_addr; /* found record address */ /* Since the database returns times as strings, this is how we pass - * them back. + * them back. */ char cFirstWritten[MAX_TIME_LENGTH]; /* FirstWritten returned from DB */ char cLastWritten[MAX_TIME_LENGTH]; /* LastWritten returned from DB */ @@ -541,12 +541,12 @@ struct MEDIA_DBR { /* Client record -- same as the database */ struct CLIENT_DBR { - uint32_t ClientId; /* Unique Client id */ + uint32_t ClientId; /* Unique Client id */ int AutoPrune; utime_t FileRetention; utime_t JobRetention; - char Name[MAX_NAME_LENGTH]; /* Client name */ - char Uname[256]; /* Uname for client */ + char Name[MAX_NAME_LENGTH]; /* Client name */ + char Uname[256]; /* Uname for client */ }; /* Counter record as in database */ @@ -561,16 +561,16 @@ struct COUNTER_DBR { /* FileSet record -- same as the database */ struct FILESET_DBR { - uint32_t FileSetId; /* Unique FileSet id */ + uint32_t FileSetId; /* Unique FileSet id */ char FileSet[MAX_NAME_LENGTH]; /* FileSet name */ - char MD5[50]; /* MD5 signature of include/exclude */ - time_t CreateTime; /* date created */ + char MD5[50]; /* MD5 signature of include/exclude */ + time_t CreateTime; /* date created */ /* * This is where we return CreateTime */ char cCreateTime[MAX_TIME_LENGTH]; /* CreateTime as returned from DB */ /* Not in DB but returned by db_create_fileset() */ - bool created; /* set when record newly created */ + bool created; /* set when record newly created */ }; diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index b67cfb89ce..48843840b5 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -9,7 +9,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 64e76b168c..91b4493743 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -9,7 +9,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 8df73cc768..51b09347a4 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -10,7 +10,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/cats/sql_find.c b/bacula/src/cats/sql_find.c index 5d239532c6..c7050f8a3c 100644 --- a/bacula/src/cats/sql_find.c +++ b/bacula/src/cats/sql_find.c @@ -11,7 +11,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index d00249e0b7..3c428742e8 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -7,7 +7,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 @@ -303,26 +303,26 @@ db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr) "VolWrites=%u,MaxVolBytes=%s,LastWritten='%s',VolStatus='%s'," "Slot=%d,InChanger=%d,VolReadTime=%s,VolWriteTime=%s " " WHERE VolumeName='%s'", - mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1), - mr->VolMounts, mr->VolErrors, mr->VolWrites, - edit_uint64(mr->MaxVolBytes, ed2), dt, - mr->VolStatus, mr->Slot, mr->InChanger, - edit_uint64(mr->VolReadTime, ed3), - edit_uint64(mr->VolWriteTime, ed4), - mr->VolumeName); + mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1), + mr->VolMounts, mr->VolErrors, mr->VolWrites, + edit_uint64(mr->MaxVolBytes, ed2), dt, + mr->VolStatus, mr->Slot, mr->InChanger, + edit_uint64(mr->VolReadTime, ed3), + edit_uint64(mr->VolWriteTime, ed4), + mr->VolumeName); } else { Mmsg(&mdb->cmd, "UPDATE Media SET VolJobs=%u," "VolFiles=%u,VolBlocks=%u,VolBytes=%s,VolMounts=%u,VolErrors=%u," "VolWrites=%u,MaxVolBytes=%s,VolStatus='%s'," "Slot=%d,InChanger=%d,VolReadTime=%s,VolWriteTime=%s " " WHERE VolumeName='%s'", - mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1), - mr->VolMounts, mr->VolErrors, mr->VolWrites, - edit_uint64(mr->MaxVolBytes, ed2), - mr->VolStatus, mr->Slot, mr->InChanger, - edit_uint64(mr->VolReadTime, ed3), - edit_uint64(mr->VolWriteTime, ed4), - mr->VolumeName); + mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1), + mr->VolMounts, mr->VolErrors, mr->VolWrites, + edit_uint64(mr->MaxVolBytes, ed2), + mr->VolStatus, mr->Slot, mr->InChanger, + edit_uint64(mr->VolReadTime, ed3), + edit_uint64(mr->VolWriteTime, ed4), + mr->VolumeName); } Dmsg1(400, "%s\n", mdb->cmd); diff --git a/bacula/src/cats/sqlite.c b/bacula/src/cats/sqlite.c index c382e1c568..6d6d2330cc 100644 --- a/bacula/src/cats/sqlite.c +++ b/bacula/src/cats/sqlite.c @@ -7,7 +7,7 @@ */ /* - Copyright (C) 2002-2003 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 diff --git a/bacula/src/cl b/bacula/src/cl index 7e525864ce..54da62d29d 100644 --- a/bacula/src/cl +++ b/bacula/src/cl @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 Kern Sibbald and John Walker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/bacula/src/console/conio.c b/bacula/src/console/conio.c index d40aef88bb..c2f7003e45 100755 --- a/bacula/src/console/conio.c +++ b/bacula/src/console/conio.c @@ -9,7 +9,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 1981-2004 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 diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index 8afc685041..8842bc6267 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -7,7 +7,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 740f3b2757..3f4303b8a5 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -22,7 +22,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 80d2ba0dab..71d15ff44a 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -7,7 +7,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index 94b8c664f8..0b5e476e4e 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -16,7 +16,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/dird/recycle.c b/bacula/src/dird/recycle.c index f04fc057fa..c12969c97f 100644 --- a/bacula/src/dird/recycle.c +++ b/bacula/src/dird/recycle.c @@ -9,7 +9,7 @@ */ /* - Copyright (C) 2002 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 diff --git a/bacula/src/dird/scheduler.c b/bacula/src/dird/scheduler.c index 1d2821c63e..9747835567 100644 --- a/bacula/src/dird/scheduler.c +++ b/bacula/src/dird/scheduler.c @@ -10,7 +10,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/dird/sql_cmds.c b/bacula/src/dird/sql_cmds.c index c915801488..e5f8983ace 100644 --- a/bacula/src/dird/sql_cmds.c +++ b/bacula/src/dird/sql_cmds.c @@ -8,7 +8,7 @@ */ /* - Copyright (C) 2002-2003 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 @@ -177,9 +177,9 @@ char *uar_file = char *uar_sel_files = - "SELECT Path.Path,Filename.Name,FileIndex,JobId " + "SELECT Path.Path,Filename.Name,FileIndex,JobId,LStat " "FROM File,Filename,Path " - "WHERE File.JobId=%d AND Filename.FilenameId=File.FilenameId " + "WHERE File.JobId=%u AND Filename.FilenameId=File.FilenameId " "AND Path.PathId=File.PathId"; char *uar_del_temp = "DROP TABLE temp"; diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 6b4455c5ef..c71a1341b4 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -8,7 +8,7 @@ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 19c7ed4cf1..569a5f7b76 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -12,7 +12,7 @@ */ /* - Copyright (C) 2002 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 754d53216a..9b4d29a262 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -14,7 +14,7 @@ */ /* - Copyright (C) 2002-2003 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 @@ -42,10 +42,10 @@ extern int run_cmd(UAContext *ua, char *cmd); extern void print_bsr(UAContext *ua, RBSR *bsr); /* Imported variables */ -extern char *uar_list_jobs, *uar_file, *uar_sel_files; -extern char *uar_del_temp, *uar_del_temp1, *uar_create_temp; -extern char *uar_create_temp1, *uar_last_full, *uar_full; -extern char *uar_inc_dec, *uar_list_temp, *uar_sel_jobid_temp; +extern char *uar_list_jobs, *uar_file, *uar_sel_files; +extern char *uar_del_temp, *uar_del_temp1, *uar_create_temp; +extern char *uar_create_temp1, *uar_last_full, *uar_full; +extern char *uar_inc_dec, *uar_list_temp, *uar_sel_jobid_temp; extern char *uar_sel_all_temp1, *uar_sel_fileset, *uar_mediatype; extern char *uar_jobid_fileindex; diff --git a/bacula/src/dird/ua_tree.c b/bacula/src/dird/ua_tree.c index 0a87e265ec..93a8f8a218 100644 --- a/bacula/src/dird/ua_tree.c +++ b/bacula/src/dird/ua_tree.c @@ -10,7 +10,7 @@ */ /* - Copyright (C) 2002-2003 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 @@ -132,6 +132,10 @@ void user_select_files_from_tree(TREE_CTX *tree) * this routine is called once for each file. We do not allow * duplicate filenames, but instead keep the info from the most * recent file entered (i.e. the JobIds are assumed to be sorted) + * + * See uar_sel_files in sql_cmds.c for query that calls us. + * row[0]=Path, row[1]=Filename, row[2]=FileIndex + * row[3]=JobId row[4]=LStat */ int insert_tree_handler(void *ctx, int num_fields, char **row) { @@ -166,9 +170,11 @@ int insert_tree_handler(void *ctx, int num_fields, char **row) tree->avail_node = NULL; } new_node->FileIndex = atoi(row[2]); - new_node->JobId = atoi(row[3]); + new_node->JobId = (JobId_t)str_to_int64(row[3]); new_node->type = type; new_node->extract = true; /* extract all by default */ + new_node->extract_dir = true; /* if dir, extract it */ + new_node->have_link = (decode_LinkFI(row[4]) != 0); tree->cnt++; return 0; } @@ -197,14 +203,15 @@ static int set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, bool extr } } else if (extract) { char cwd[2000]; - /* Ordinary file, we get the full path, look up the + /* + * Ordinary file, we get the full path, look up the * attributes, decode them, and if we are hard linked to * a file that was saved, we must load that file too. */ tree_getpath(node, cwd, sizeof(cwd)); fdbr.FileId = 0; fdbr.JobId = node->JobId; - if (db_get_file_attributes_record(ua->jcr, ua->db, cwd, NULL, &fdbr)) { + if (node->have_link && db_get_file_attributes_record(ua->jcr, ua->db, cwd, NULL, &fdbr)) { int32_t LinkFI; decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */ /* diff --git a/bacula/src/filed/filed.c b/bacula/src/filed/filed.c index 02165f8a25..10c98fed25 100644 --- a/bacula/src/filed/filed.c +++ b/bacula/src/filed/filed.c @@ -7,7 +7,7 @@ * */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 23796405bd..b5f05c13b1 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -7,7 +7,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/filed/win32/winres.rc b/bacula/src/filed/win32/winres.rc index 8ddb8e1a8b..df3c35874e 100644 --- a/bacula/src/filed/win32/winres.rc +++ b/bacula/src/filed/win32/winres.rc @@ -64,7 +64,7 @@ BEGIN VALUE "FileDescription", "Bacula File daemon for Win32\0" VALUE "FileVersion", VERSION "\0" VALUE "InternalName", "Bacula\0" - VALUE "LegalCopyright", "Copyright Kern Sibbald, 1999-2003\0" + VALUE "LegalCopyright", "Copyright Kern Sibbald, 1999-2004\0" VALUE "LegalTrademarks", "Licensed under GNU GPL 2.0\0" VALUE "OriginalFilename", "filed.exe\0" VALUE "PrivateBuild", "\0" @@ -139,7 +139,7 @@ BEGIN IDC_WWW,90,60,239,10 LTEXT " ", IDC_WWW,90,70,239,10 - LTEXT "Copyright (C) 1999-2003, Kern Sibbald", + LTEXT "Copyright (C) 1999-2004, Kern Sibbald", IDC_COPYRIGHT,7,120,175,10 LTEXT "Licensed under GNU GPL 2.0.", IDC_TRADEMARK,7,130,175,10 diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index f0d65be64c..d16c3ec964 100755 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -9,7 +9,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 @@ -220,6 +220,47 @@ int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI) return (int)val; } +/* Decode a LinkFI field of encoded stat packet */ +int32_t decode_LinkFI(char *buf) +{ + char *p = buf; + int64_t val; + + skip_nonspaces(&p); /* st_dev */ + p++; /* skip space */ + skip_nonspaces(&p); /* st_ino */ + p++; + skip_nonspaces(&p); /* st_mode */ + p++; + skip_nonspaces(&p); /* st_nlink */ + p++; + skip_nonspaces(&p); /* st_uid */ + p++; + skip_nonspaces(&p); /* st_gid */ + p++; + skip_nonspaces(&p); /* st_rdev */ + p++; + skip_nonspaces(&p); /* st_size */ + p++; + skip_nonspaces(&p); /* st_blksize */ + p++; + skip_nonspaces(&p); /* st_blocks */ + p++; + skip_nonspaces(&p); /* st_atime */ + p++; + skip_nonspaces(&p); /* st_mtime */ + p++; + skip_nonspaces(&p); /* st_ctime */ + + /* Optional FileIndex of hard linked file data */ + if (*p == ' ' || (*p != 0 && *(p+1) == ' ')) { + p++; + p += from_base64(&val, p); + return (int32_t)val; + } + return 0; +} + /* * Set file modes, permissions and times * diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 766120df91..edc38ccf1a 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -7,7 +7,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/findlib/protos.h b/bacula/src/findlib/protos.h index 0ea272357e..618b0f0d64 100644 --- a/bacula/src/findlib/protos.h +++ b/bacula/src/findlib/protos.h @@ -24,14 +24,15 @@ */ /* from attribs.c */ -void encode_stat (char *buf, FF_PKT *ff_pkt, int data_stream); -int decode_stat (char *buf, struct stat *statp, int32_t *LinkFI); -int encode_attribsEx (JCR *jcr, char *attribsEx, FF_PKT *ff_pkt); -int set_attributes (JCR *jcr, ATTR *attr, BFILE *ofd); -int select_data_stream(FF_PKT *ff_pkt); +void encode_stat (char *buf, FF_PKT *ff_pkt, int data_stream); +int decode_stat (char *buf, struct stat *statp, int32_t *LinkFI); +int32_t decode_LinkFI (char *buf); +int encode_attribsEx (JCR *jcr, char *attribsEx, FF_PKT *ff_pkt); +int set_attributes (JCR *jcr, ATTR *attr, BFILE *ofd); +int select_data_stream(FF_PKT *ff_pkt); /* from create_file.c */ -int create_file (JCR *jcr, ATTR *attr, BFILE *ofd, int replace); +int create_file (JCR *jcr, ATTR *attr, BFILE *ofd, int replace); /* From find.c */ FF_PKT *init_find_files(); @@ -47,11 +48,11 @@ void add_fname_to_exclude_list(FF_PKT *ff, char *fname); int file_is_excluded(FF_PKT *ff, char *file); int file_is_included(FF_PKT *ff, char *file); struct s_included_file *get_next_included_file(FF_PKT *ff, - struct s_included_file *inc); + struct s_included_file *inc); /* From find_one.c */ int find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), - void *pkt, char *p, dev_t parent_device, int top_level); + void *pkt, char *p, dev_t parent_device, int top_level); int term_find_one(FF_PKT *ff); @@ -61,7 +62,7 @@ int enable_backup_privileges(JCR *jcr, int ignore_errors); /* from makepath.c */ int make_path(JCR *jcr, const char *argpath, int mode, - int parent_mode, uid_t owner, gid_t group, - int preserve_existing, char *verbose_fmt_string); + int parent_mode, uid_t owner, gid_t group, + int preserve_existing, char *verbose_fmt_string); /* from bfile.c -- see bfile.h */ diff --git a/bacula/src/host.h.in b/bacula/src/host.h.in index e9c2cd00f4..dfe93bf042 100644 --- a/bacula/src/host.h.in +++ b/bacula/src/host.h.in @@ -5,7 +5,7 @@ * */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 6f8994fe51..3cd1702fe5 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -10,7 +10,7 @@ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/lib/bsock.h b/bacula/src/lib/bsock.h index 4d4b49dd84..14a813a0f2 100644 --- a/bacula/src/lib/bsock.h +++ b/bacula/src/lib/bsock.h @@ -12,7 +12,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 Kern Sibbald and John Walker This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/bacula/src/lib/btime.c b/bacula/src/lib/btime.c index 4972a9c9a4..f5e3a99b2c 100644 --- a/bacula/src/lib/btime.c +++ b/bacula/src/lib/btime.c @@ -4,7 +4,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/lib/dlist.c b/bacula/src/lib/dlist.c index ffc35c52cb..bf860c2fc9 100644 --- a/bacula/src/lib/dlist.c +++ b/bacula/src/lib/dlist.c @@ -10,7 +10,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/lib/tree.h b/bacula/src/lib/tree.h index e92c567216..838f920966 100644 --- a/bacula/src/lib/tree.h +++ b/bacula/src/lib/tree.h @@ -5,7 +5,7 @@ * */ /* - Copyright (C) 2002,2003 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 @@ -39,9 +39,11 @@ struct s_tree_node { char *fname; /* file name */ int32_t FileIndex; /* file index */ uint32_t JobId; /* JobId */ - uint16_t fname_len; /* length of string */ - uint8_t type; /* node type */ - bool extract; /* set if extracting */ + uint16_t fname_len; /* filename length */ + unsigned int type: 8; /* node type */ + unsigned int extract: 1; /* extract item */ + unsigned int extract_dir: 1; /* extract dir entry only */ + unsigned int have_link: 1; /* set if have hard link */ struct s_tree_node *parent; struct s_tree_node *sibling; struct s_tree_node *child; @@ -53,9 +55,11 @@ struct s_tree_root { char *fname; /* file name */ int32_t FileIndex; /* file index */ uint32_t JobId; /* JobId */ - uint16_t fname_len; /* length of string */ - uint8_t type; /* node type */ - bool extract; /* set if extracting */ + uint16_t fname_len; /* filename length */ + unsigned int type: 8; /* node type */ + unsigned int extract: 1; /* extract item */ + unsigned int extract_dir: 1; /* extract dir entry only */ + unsigned int have_link: 1; /* set if have hard link */ struct s_tree_node *parent; struct s_tree_node *sibling; struct s_tree_node *child; diff --git a/bacula/src/lib/var.c b/bacula/src/lib/var.c index ffdbc5c832..52d147c787 100644 --- a/bacula/src/lib/var.c +++ b/bacula/src/lib/var.c @@ -18,7 +18,7 @@ * Adapted by Kern Sibbald to Bacula June 2003 */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/lib/watchdog.c b/bacula/src/lib/watchdog.c index 8ab21c438d..3c216f1410 100755 --- a/bacula/src/lib/watchdog.c +++ b/bacula/src/lib/watchdog.c @@ -8,7 +8,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/lib/watchdog.h b/bacula/src/lib/watchdog.h index 724bfe9239..c7ac6889e1 100644 --- a/bacula/src/lib/watchdog.h +++ b/bacula/src/lib/watchdog.h @@ -5,7 +5,7 @@ * */ /* - Copyright (C) 2002 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 81138f0465..5ab474a756 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -7,7 +7,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/bcopy.c b/bacula/src/stored/bcopy.c index 6255e65247..0de1527978 100644 --- a/bacula/src/stored/bcopy.c +++ b/bacula/src/stored/bcopy.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2002-2004 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 diff --git a/bacula/src/stored/bextract.c b/bacula/src/stored/bextract.c index 950ff5bbb2..d594de8cdf 100644 --- a/bacula/src/stored/bextract.c +++ b/bacula/src/stored/bextract.c @@ -2,13 +2,13 @@ * * Dumb program to extract files from a Bacula backup. * - * Kern E. Sibbald + * Kern E. Sibbald, 2000 * * Version $Id$ * */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 585f89ca34..5a3028403e 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -9,7 +9,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/bls.c b/bacula/src/stored/bls.c index 0525a4af79..69c75b58ff 100644 --- a/bacula/src/stored/bls.c +++ b/bacula/src/stored/bls.c @@ -5,7 +5,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index 4eaf150c39..193a03452b 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -10,7 +10,7 @@ * Version $Id$ */ /* - Copyright (C) 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2001-2004 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 diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index 4c586c694a..1a812d5efa 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -14,7 +14,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 0140d4211c..57a612dab3 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -29,7 +29,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index 78d9d7b514..c1ffd58668 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -6,7 +6,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 @@ -31,9 +31,9 @@ /* #define NEW_LOCK 1 */ -#define new_lock_device(dev) _new_lock_device(__FILE__, __LINE__, (dev)) +#define new_lock_device(dev) _new_lock_device(__FILE__, __LINE__, (dev)) #define new_lock_device_state(dev,state) _new_lock_device(__FILE__, __LINE__, (dev), (state)) -#define new_unlock_device(dev) _new_unlock_device(__FILE__, __LINE__, (dev)) +#define new_unlock_device(dev) _new_unlock_device(__FILE__, __LINE__, (dev)) #define lock_device(d) _lock_device(__FILE__, __LINE__, (d)) #define unlock_device(d) _unlock_device(__FILE__, __LINE__, (d)) @@ -43,155 +43,155 @@ #define give_back_device_lock(d, p) _give_back_device_lock(__FILE__, __LINE__, (d), (p)) /* Arguments to open_dev() */ -#define READ_WRITE 0 -#define READ_ONLY 1 +#define READ_WRITE 0 +#define READ_ONLY 1 #define OPEN_READ_WRITE 0 -#define OPEN_READ_ONLY 1 +#define OPEN_READ_ONLY 1 #define OPEN_WRITE_ONLY 2 /* Generic status bits returned from status_dev() */ -#define BMT_TAPE (1<<0) /* is tape device */ -#define BMT_EOF (1<<1) /* just read EOF */ -#define BMT_BOT (1<<2) /* at beginning of tape */ -#define BMT_EOT (1<<3) /* end of tape reached */ -#define BMT_SM (1<<4) /* DDS setmark */ -#define BMT_EOD (1<<5) /* DDS at end of data */ -#define BMT_WR_PROT (1<<6) /* tape write protected */ -#define BMT_ONLINE (1<<7) /* tape online */ -#define BMT_DR_OPEN (1<<8) /* tape door open */ -#define BMT_IM_REP_EN (1<<9) /* immediate report enabled */ +#define BMT_TAPE (1<<0) /* is tape device */ +#define BMT_EOF (1<<1) /* just read EOF */ +#define BMT_BOT (1<<2) /* at beginning of tape */ +#define BMT_EOT (1<<3) /* end of tape reached */ +#define BMT_SM (1<<4) /* DDS setmark */ +#define BMT_EOD (1<<5) /* DDS at end of data */ +#define BMT_WR_PROT (1<<6) /* tape write protected */ +#define BMT_ONLINE (1<<7) /* tape online */ +#define BMT_DR_OPEN (1<<8) /* tape door open */ +#define BMT_IM_REP_EN (1<<9) /* immediate report enabled */ /* Test capabilities */ #define dev_cap(dev, cap) ((dev)->capabilities & (cap)) /* Bits for device capabilities */ -#define CAP_EOF (1<<0) /* has MTWEOF */ -#define CAP_BSR (1<<1) /* has MTBSR */ -#define CAP_BSF (1<<2) /* has MTBSF */ -#define CAP_FSR (1<<3) /* has MTFSR */ -#define CAP_FSF (1<<4) /* has MTFSF */ -#define CAP_EOM (1<<5) /* has MTEOM */ -#define CAP_REM (1<<6) /* is removable media */ -#define CAP_RACCESS (1<<7) /* is random access device */ -#define CAP_AUTOMOUNT (1<<8) /* Read device at start to see what is there */ -#define CAP_LABEL (1<<9) /* Label blank tapes */ -#define CAP_ANONVOLS (1<<10) /* Mount without knowing volume name */ -#define CAP_ALWAYSOPEN (1<<11) /* always keep device open */ +#define CAP_EOF (1<<0) /* has MTWEOF */ +#define CAP_BSR (1<<1) /* has MTBSR */ +#define CAP_BSF (1<<2) /* has MTBSF */ +#define CAP_FSR (1<<3) /* has MTFSR */ +#define CAP_FSF (1<<4) /* has MTFSF */ +#define CAP_EOM (1<<5) /* has MTEOM */ +#define CAP_REM (1<<6) /* is removable media */ +#define CAP_RACCESS (1<<7) /* is random access device */ +#define CAP_AUTOMOUNT (1<<8) /* Read device at start to see what is there */ +#define CAP_LABEL (1<<9) /* Label blank tapes */ +#define CAP_ANONVOLS (1<<10) /* Mount without knowing volume name */ +#define CAP_ALWAYSOPEN (1<<11) /* always keep device open */ #define CAP_AUTOCHANGER (1<<12) /* AutoChanger */ #define CAP_OFFLINEUNMOUNT (1<<13) /* Offline before unmount */ -#define CAP_STREAM (1<<14) /* Stream device */ -#define CAP_BSFATEOM (1<<15) /* Backspace file at EOM */ -#define CAP_FASTFSF (1<<16) /* Fast forward space file */ -#define CAP_TWOEOF (1<<17) /* Write two eofs for EOM */ +#define CAP_STREAM (1<<14) /* Stream device */ +#define CAP_BSFATEOM (1<<15) /* Backspace file at EOM */ +#define CAP_FASTFSF (1<<16) /* Fast forward space file */ +#define CAP_TWOEOF (1<<17) /* Write two eofs for EOM */ /* Test state */ #define dev_state(dev, st_state) ((dev)->state & (st_state)) /* Device state bits */ -#define ST_OPENED (1<<0) /* set when device opened */ -#define ST_TAPE (1<<1) /* is a tape device */ -#define ST_FILE (1<<2) /* is a file device */ -#define ST_FIFO (1<<3) /* is a fifo device */ -#define ST_PROG (1<<4) /* is a program device */ -#define ST_LABEL (1<<5) /* label found */ +#define ST_OPENED (1<<0) /* set when device opened */ +#define ST_TAPE (1<<1) /* is a tape device */ +#define ST_FILE (1<<2) /* is a file device */ +#define ST_FIFO (1<<3) /* is a fifo device */ +#define ST_PROG (1<<4) /* is a program device */ +#define ST_LABEL (1<<5) /* label found */ #define ST_MALLOC (1<<6) /* dev packet malloc'ed in init_dev() */ -#define ST_APPEND (1<<7) /* ready for Bacula append */ -#define ST_READ (1<<8) /* ready for Bacula read */ -#define ST_EOT (1<<9) /* at end of tape */ -#define ST_WEOT (1<<10) /* Got EOT on write */ -#define ST_EOF (1<<11) /* Read EOF i.e. zero bytes */ -#define ST_NEXTVOL (1<<12) /* Start writing on next volume */ -#define ST_SHORT (1<<13) /* Short block read */ +#define ST_APPEND (1<<7) /* ready for Bacula append */ +#define ST_READ (1<<8) /* ready for Bacula read */ +#define ST_EOT (1<<9) /* at end of tape */ +#define ST_WEOT (1<<10) /* Got EOT on write */ +#define ST_EOF (1<<11) /* Read EOF i.e. zero bytes */ +#define ST_NEXTVOL (1<<12) /* Start writing on next volume */ +#define ST_SHORT (1<<13) /* Short block read */ /* dev_blocked states (mutually exclusive) */ #define BST_NOT_BLOCKED 0 /* not blocked */ -#define BST_UNMOUNTED 1 /* User unmounted device */ +#define BST_UNMOUNTED 1 /* User unmounted device */ #define BST_WAITING_FOR_SYSOP 2 /* Waiting for operator to mount tape */ #define BST_DOING_ACQUIRE 3 /* Opening/validating/moving tape */ #define BST_WRITING_LABEL 4 /* Labeling a tape */ #define BST_UNMOUNTED_WAITING_FOR_SYSOP 5 /* Closed by user during mount request */ -#define BST_MOUNT 6 /* Mount request */ +#define BST_MOUNT 6 /* Mount request */ /* Volume Catalog Information structure definition */ struct VOLUME_CAT_INFO { /* Media info for the current Volume */ - uint32_t VolCatJobs; /* number of jobs on this Volume */ - uint32_t VolCatFiles; /* Number of files */ - uint32_t VolCatBlocks; /* Number of blocks */ - uint64_t VolCatBytes; /* Number of bytes written */ - uint32_t VolCatMounts; /* Number of mounts this volume */ - uint32_t VolCatErrors; /* Number of errors this volume */ - uint32_t VolCatWrites; /* Number of writes this volume */ - uint32_t VolCatReads; /* Number of reads this volume */ - uint64_t VolCatRBytes; /* Number of bytes read */ - uint32_t VolCatRecycles; /* Number of recycles this volume */ - int32_t Slot; /* Slot in changer */ - bool InChanger; /* Set if vol in current magazine */ - uint32_t VolCatMaxJobs; /* Maximum Jobs to write to volume */ - uint32_t VolCatMaxFiles; /* Maximum files to write to volume */ - uint64_t VolCatMaxBytes; /* Max bytes to write to volume */ + uint32_t VolCatJobs; /* number of jobs on this Volume */ + uint32_t VolCatFiles; /* Number of files */ + uint32_t VolCatBlocks; /* Number of blocks */ + uint64_t VolCatBytes; /* Number of bytes written */ + uint32_t VolCatMounts; /* Number of mounts this volume */ + uint32_t VolCatErrors; /* Number of errors this volume */ + uint32_t VolCatWrites; /* Number of writes this volume */ + uint32_t VolCatReads; /* Number of reads this volume */ + uint64_t VolCatRBytes; /* Number of bytes read */ + uint32_t VolCatRecycles; /* Number of recycles this volume */ + int32_t Slot; /* Slot in changer */ + bool InChanger; /* Set if vol in current magazine */ + uint32_t VolCatMaxJobs; /* Maximum Jobs to write to volume */ + uint32_t VolCatMaxFiles; /* Maximum files to write to volume */ + uint64_t VolCatMaxBytes; /* Max bytes to write to volume */ uint64_t VolCatCapacityBytes; /* capacity estimate */ - uint64_t VolReadTime; /* time spent reading */ - uint64_t VolWriteTime; /* time spent writing this Volume */ - char VolCatStatus[20]; /* Volume status */ + uint64_t VolReadTime; /* time spent reading */ + uint64_t VolWriteTime; /* time spent writing this Volume */ + char VolCatStatus[20]; /* Volume status */ char VolCatName[MAX_NAME_LENGTH]; /* Desired volume to mount */ -}; +}; typedef struct s_steal_lock { - pthread_t no_wait_id; /* id of no wait thread */ - int dev_blocked; /* state */ - int dev_prev_blocked; /* previous blocked state */ + pthread_t no_wait_id; /* id of no wait thread */ + int dev_blocked; /* state */ + int dev_prev_blocked; /* previous blocked state */ } bsteal_lock_t; -struct DEVRES; /* Device resource defined in stored_conf.h */ +struct DEVRES; /* Device resource defined in stored_conf.h */ /* Device structure definition */ struct DEVICE { public: - DEVICE *next; /* pointer to next open device */ - DEVICE *prev; /* pointer to prev open device */ - JCR *attached_jcrs; /* attached JCR list */ - pthread_mutex_t mutex; /* access control */ - pthread_cond_t wait; /* thread wait variable */ + DEVICE *next; /* pointer to next open device */ + DEVICE *prev; /* pointer to prev open device */ + JCR *attached_jcrs; /* attached JCR list */ + pthread_mutex_t mutex; /* access control */ + pthread_cond_t wait; /* thread wait variable */ pthread_cond_t wait_next_vol; /* wait for tape to be mounted */ - pthread_t no_wait_id; /* this thread must not wait */ - int dev_blocked; /* set if we must wait (i.e. change tape) */ - int dev_prev_blocked; /* previous blocked state */ - int num_waiting; /* number of threads waiting */ - int num_writers; /* number of writing threads */ - int use_count; /* usage count on this device */ - int fd; /* file descriptor */ - int capabilities; /* capabilities mask */ - int state; /* state mask */ - int dev_errno; /* Our own errno */ - int mode; /* read/write modes */ - char *dev_name; /* device name */ - char *errmsg; /* nicely edited error message */ - uint32_t block_num; /* current block number base 0 */ - uint32_t file; /* current file number base 0 */ - uint64_t file_addr; /* Current file read/write address */ - uint32_t EndBlock; /* last block written */ - uint32_t EndFile; /* last file written */ - uint32_t min_block_size; /* min block size */ - uint32_t max_block_size; /* max block size */ - uint64_t max_volume_size; /* max bytes to put on one volume */ - uint64_t max_file_size; /* max file size to put in one file on volume */ - uint64_t volume_capacity; /* advisory capacity */ - uint32_t max_rewind_wait; /* max secs to allow for rewind */ - uint32_t max_open_wait; /* max secs to allow for open */ - uint32_t max_open_vols; /* max simultaneous open volumes */ - utime_t vol_poll_interval; /* interval between polling Vol mount */ - DEVRES *device; /* pointer to Device Resource */ - btimer_id tid; /* timer id */ - - VOLUME_CAT_INFO VolCatInfo; /* Volume Catalog Information */ - VOLUME_LABEL VolHdr; /* Actual volume label */ + pthread_t no_wait_id; /* this thread must not wait */ + int dev_blocked; /* set if we must wait (i.e. change tape) */ + int dev_prev_blocked; /* previous blocked state */ + int num_waiting; /* number of threads waiting */ + int num_writers; /* number of writing threads */ + int use_count; /* usage count on this device */ + int fd; /* file descriptor */ + int capabilities; /* capabilities mask */ + int state; /* state mask */ + int dev_errno; /* Our own errno */ + int mode; /* read/write modes */ + char *dev_name; /* device name */ + char *errmsg; /* nicely edited error message */ + uint32_t block_num; /* current block number base 0 */ + uint32_t file; /* current file number base 0 */ + uint64_t file_addr; /* Current file read/write address */ + uint32_t EndBlock; /* last block written */ + uint32_t EndFile; /* last file written */ + uint32_t min_block_size; /* min block size */ + uint32_t max_block_size; /* max block size */ + uint64_t max_volume_size; /* max bytes to put on one volume */ + uint64_t max_file_size; /* max file size to put in one file on volume */ + uint64_t volume_capacity; /* advisory capacity */ + uint32_t max_rewind_wait; /* max secs to allow for rewind */ + uint32_t max_open_wait; /* max secs to allow for open */ + uint32_t max_open_vols; /* max simultaneous open volumes */ + utime_t vol_poll_interval; /* interval between polling Vol mount */ + DEVRES *device; /* pointer to Device Resource */ + btimer_id tid; /* timer id */ + + VOLUME_CAT_INFO VolCatInfo; /* Volume Catalog Information */ + VOLUME_LABEL VolHdr; /* Actual volume label */ /* Device wait times ***FIXME*** look at durations */ char BadVolName[MAX_NAME_LENGTH]; /* Last wrong Volume mounted */ - bool poll; /* set to poll Volume */ + bool poll; /* set to poll Volume */ int min_wait; int max_wait; int max_num_wait; @@ -206,7 +206,7 @@ public: * dependent. Arrgggg! */ #ifndef MTEOM -#ifdef MTSEOD +#ifdef MTSEOD #define MTEOM MTSEOD #endif #ifdef MTEOD diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index 46ffd38ace..115a9d5ae2 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -29,7 +29,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index efc3343bcf..b3ddd63418 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -19,7 +19,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 0ba90a615f..ba1063bc04 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/status.c b/bacula/src/stored/status.c index a50611ddc6..c2682b2786 100644 --- a/bacula/src/stored/status.c +++ b/bacula/src/stored/status.c @@ -7,7 +7,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index 0c81761050..568f4529f0 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -10,7 +10,7 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index f2006f339d..14541d328b 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -7,7 +7,7 @@ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index 7540e06215..65438b93bd 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -4,7 +4,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 @@ -23,72 +23,72 @@ */ -#define R_FIRST 3001 +#define R_FIRST 3001 -#define R_DIRECTOR 3001 -#define R_STORAGE 3002 -#define R_DEVICE 3003 -#define R_MSGS 3004 +#define R_DIRECTOR 3001 +#define R_STORAGE 3002 +#define R_DEVICE 3003 +#define R_MSGS 3004 -#define R_LAST R_MSGS +#define R_LAST R_MSGS -#define R_NAME 3020 -#define R_ADDRESS 3021 -#define R_PASSWORD 3022 -#define R_TYPE 3023 -#define R_BACKUP 3024 +#define R_NAME 3020 +#define R_ADDRESS 3021 +#define R_PASSWORD 3022 +#define R_TYPE 3023 +#define R_BACKUP 3024 /* Definition of the contents of each Resource */ struct DIRRES { - RES hdr; + RES hdr; - char *password; /* Director password */ - char *address; /* Director IP address or zero */ - int enable_ssl; /* Use SSL with this Director */ + char *password; /* Director password */ + char *address; /* Director IP address or zero */ + int enable_ssl; /* Use SSL with this Director */ }; /* Storage daemon "global" definitions */ struct s_res_store { - RES hdr; + RES hdr; - char *address; /* deprecated */ - char *SDaddr; /* bind address */ - int SDport; /* Where we listen for Directors */ + char *address; /* deprecated */ + char *SDaddr; /* bind address */ + int SDport; /* Where we listen for Directors */ int SDDport; /* "Data" port where we listen for File daemons */ - char *working_directory; /* working directory for checkpoints */ + char *working_directory; /* working directory for checkpoints */ char *pid_directory; char *subsys_directory; - int require_ssl; /* Require SSL on all connections */ + int require_ssl; /* Require SSL on all connections */ uint32_t max_concurrent_jobs; /* maximum concurrent jobs to run */ - MSGS *messages; /* Daemon message handler */ - utime_t heartbeat_interval; /* Interval to send hb to FD */ + MSGS *messages; /* Daemon message handler */ + utime_t heartbeat_interval; /* Interval to send hb to FD */ }; typedef struct s_res_store STORES; /* Device specific definitions */ struct DEVRES { - RES hdr; - - char *media_type; /* User assigned media type */ - char *device_name; /* Archive device name */ - char *changer_name; /* Changer device name */ - char *changer_command; /* Changer command -- external program */ - uint32_t cap_bits; /* Capabilities of this device */ - uint32_t max_changer_wait; /* Changer timeout */ - uint32_t max_rewind_wait; /* maximum secs to wait for rewind */ - uint32_t max_open_wait; /* maximum secs to wait for open */ - uint32_t max_open_vols; /* maximum simultaneous open volumes */ - uint32_t min_block_size; /* min block size */ - uint32_t max_block_size; /* max block size */ - uint32_t max_volume_jobs; /* max jobs to put on one volume */ - utime_t vol_poll_interval; /* interval between polling volume during mount */ - int64_t max_volume_files; /* max files to put on one volume */ - int64_t max_volume_size; /* max bytes to put on one volume */ - int64_t max_file_size; /* max file size in bytes */ - int64_t volume_capacity; /* advisory capacity */ - DEVICE *dev; /* Pointer to phyical dev -- set at runtime */ + RES hdr; + + char *media_type; /* User assigned media type */ + char *device_name; /* Archive device name */ + char *changer_name; /* Changer device name */ + char *changer_command; /* Changer command -- external program */ + uint32_t cap_bits; /* Capabilities of this device */ + uint32_t max_changer_wait; /* Changer timeout */ + uint32_t max_rewind_wait; /* maximum secs to wait for rewind */ + uint32_t max_open_wait; /* maximum secs to wait for open */ + uint32_t max_open_vols; /* maximum simultaneous open volumes */ + uint32_t min_block_size; /* min block size */ + uint32_t max_block_size; /* max block size */ + uint32_t max_volume_jobs; /* max jobs to put on one volume */ + utime_t vol_poll_interval; /* interval between polling volume during mount */ + int64_t max_volume_files; /* max files to put on one volume */ + int64_t max_volume_size; /* max bytes to put on one volume */ + int64_t max_file_size; /* max file size in bytes */ + int64_t volume_capacity; /* advisory capacity */ + DEVICE *dev; /* Pointer to phyical dev -- set at runtime */ }; union URES { @@ -96,5 +96,5 @@ union URES { STORES res_store; DEVRES res_dev; MSGS res_msgs; - RES hdr; + RES hdr; }; diff --git a/bacula/src/tools/bsmtp.c b/bacula/src/tools/bsmtp.c index 3c5eba25a1..22d868247d 100644 --- a/bacula/src/tools/bsmtp.c +++ b/bacula/src/tools/bsmtp.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2000-2004 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 -- 2.39.2