* Definitions for using the Device functions in Bacula
* Tape and File storage access
*
+ * Kern Sibbald, MM
+ *
* Version $Id$
*
*/
#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))
#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))
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 */
* 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 */
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 */
};