]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dev.h
Add additional search directories for PostgreSQL
[bacula/bacula] / bacula / src / stored / dev.h
index 797fa441b68dae7c631d65aa4c5c18cb0c70e753..69ad8e948273fc4090b928acfa039da93ca1fdd2 100644 (file)
@@ -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
@@ -82,6 +82,9 @@
 #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_CLOSEONPOLL    (1<<18)    /* Close device on polling */
 
 /* Test state */
 #define dev_state(dev, st_state) ((dev)->state & (st_state))
@@ -125,10 +128,13 @@ struct VOLUME_CAT_INFO {
    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 */
    char VolCatName[MAX_NAME_LENGTH];  /* Desired volume to mount */
 };                
@@ -137,6 +143,7 @@ struct VOLUME_CAT_INFO {
 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 */
 } bsteal_lock_t;
 
 struct DEVRES;                        /* Device resource defined in stored_conf.h */
@@ -152,6 +159,7 @@ public:
    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 */
@@ -175,12 +183,22 @@ public:
    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 */
+   btimer_t *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 */
+   int min_wait;
+   int max_wait;
+   int max_num_wait;
+   int wait_sec;
+   int rem_wait_sec;
+   int num_wait;
 };