]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dev.h
Massive SD calling sequence reorganization
[bacula/bacula] / bacula / src / stored / dev.h
index 580c3f6aa02d188ffdb8b13b026a1d716a4169c2..4516c626c90e3252583b050ec604b650d8b49f15 100644 (file)
@@ -2,6 +2,8 @@
  * Definitions for using the Device functions in Bacula
  *  Tape and File storage access
  *
+ * Kern Sibbald, MM
+ *
  *   Version $Id$
  *
  */
@@ -29,6 +31,8 @@
 #ifndef __DEV_H
 #define __DEV_H 1
 
+#undef DCR                            /* used by Bacula */
+
 /* #define NEW_LOCK 1 */
 
 #define new_lock_device(dev)             _new_lock_device(__FILE__, __LINE__, (dev)) 
@@ -85,6 +89,7 @@ enum {
 #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 */
+#define CAP_POSITIONBLOCKS (1<<19)    /* Use block positioning */
 
 /* Test state */
 #define dev_state(dev, st_state) ((dev)->state & (st_state))
@@ -170,6 +175,10 @@ public:
    int dev_prev_blocked;              /* previous blocked state */
    int num_waiting;                   /* number of threads waiting */
    int num_writers;                   /* number of writing threads */
+
+   /* New access control in process of being implemented */
+   brwlock_t lock;                    /* New mutual exclusion lock */
+
    int use_count;                     /* usage count on this device */
    int fd;                            /* file descriptor */
    int capabilities;                  /* capabilities mask */
@@ -219,16 +228,17 @@ public:
  *  the device. Items in this record are "local" to the Job and
  *  do not affect other Jobs.
  */
-struct DCR {
+class DCR {
+public:
    dlink dev_link;                    /* link to attach to dev */
    JCR *jcr;                          /* pointer to JCR */
    DEVICE *dev;                       /* pointer to device */
    DEV_BLOCK *block;                  /* pointer to block */
-   DEV_RECORD *record;                /* pointer to record */
+   DEV_RECORD *rec;                   /* pointer to record */
+   int spool_fd;                      /* fd if spooling */
    bool spool_data;                   /* set to spool data */
    bool spooling;                     /* set when actually spooling */
    bool dev_locked;                   /* set if dev already locked */
-   int spool_fd;                      /* fd if spooling */
    bool NewVol;                       /* set if new Volume mounted */
    bool WroteVol;                     /* set if Volume written */
    bool NewFile;                      /* set when EOF written */
@@ -239,9 +249,13 @@ struct DCR {
    uint32_t StartFile;                /* Start write file */
    uint32_t StartBlock;               /* Start write block */
    uint32_t EndBlock;                 /* Ending block written */
-   uint64_t spool_size;               /* Current spool size */
-   uint64_t max_spool_size;           /* Max job spool size */
+   int64_t spool_size;                /* Current spool size */
+   int64_t max_spool_size;            /* Max job spool size */
    char VolumeName[MAX_NAME_LENGTH];  /* Volume name */
+   char pool_name[MAX_NAME_LENGTH];   /* pool name */
+   char pool_type[MAX_NAME_LENGTH];   /* pool type */
+   char media_type[MAX_NAME_LENGTH];  /* media type */
+   char dev_name[MAX_NAME_LENGTH];    /* dev name */
    VOLUME_CAT_INFO VolCatInfo;        /* Catalog info for desired volume */
 };