]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Use btime_t instead of uint64_t in media patch.
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 13 Feb 2007 19:58:16 +0000 (19:58 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 13 Feb 2007 19:58:16 +0000 (19:58 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4177 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/sql_create.c
bacula/src/cats/sql_find.c
bacula/src/cats/sql_update.c
bacula/src/dird/catreq.c
bacula/src/stored/askdir.c
bacula/src/stored/dev.c
bacula/src/stored/dev.h
bacula/technotes-2.1

index cac0e2f4faeaa9f682418278667181a763461606..e938c8988ec8e3ffb96545389fe653fdb2c69aa4 100644 (file)
@@ -424,8 +424,8 @@ db_create_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
           mr->Slot,
           edit_uint64(mr->VolBytes, ed5),
           mr->InChanger,
-          edit_uint64(mr->VolReadTime, ed6),
-          edit_uint64(mr->VolWriteTime, ed7),
+          edit_int64(mr->VolReadTime, ed6),
+          edit_int64(mr->VolWriteTime, ed7),
           mr->VolParts,
           mr->LabelType,
           edit_int64(mr->StorageId, ed8), 
index a9438ca6cb1abc06992b43e3167b1a92817e9583..762a7bec2b2386654ff277e217ea3ba37a479ca0 100644 (file)
@@ -371,8 +371,8 @@ db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR *mr
    mr->InChanger = str_to_int64(row[20]);
    mr->VolParts = str_to_int64(row[21]);
    mr->LabelType = str_to_int64(row[22]);
-   mr->VolReadTime = str_to_uint64(row[23]);
-   mr->VolWriteTime = str_to_uint64(row[24]);
+   mr->VolReadTime = str_to_int64(row[23]);
+   mr->VolWriteTime = str_to_int64(row[24]);
    mr->Enabled = 1;   /* ensured via query */
    sql_free_result(mdb);
 
index cd176c324c0352eba7c2cc0d2f3ad46ade0ed94f..918e571a9927b2ec19d81c4c0432c02220212047 100644 (file)
@@ -363,8 +363,8 @@ db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
         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),
+        edit_int64(mr->VolReadTime, ed3),
+        edit_int64(mr->VolWriteTime, ed4),
         mr->VolParts,
         mr->LabelType,
         edit_int64(mr->StorageId, ed5),
index 87e4293277a7dc7b028db1a34dfac77f94422b49..e884062e6fd52c723fec754d2243f9d6933961c3 100644 (file)
@@ -90,8 +90,8 @@ static int send_volume_info_to_storage_daemon(JCR *jcr, BSOCK *sd, MEDIA_DBR *mr
       edit_uint64(mr->VolCapacityBytes, ed3),
       mr->VolStatus, mr->Slot, mr->MaxVolJobs, mr->MaxVolFiles,
       mr->InChanger,
-      edit_uint64(mr->VolReadTime, ed4),
-      edit_uint64(mr->VolWriteTime, ed5),
+      edit_int64(mr->VolReadTime, ed4),
+      edit_int64(mr->VolWriteTime, ed5),
       mr->EndFile, mr->EndBlock,
       mr->VolParts,
       mr->LabelType,
index 25a0e55c06ddb74851569154a73395039c2db61a..e28c7b3bfaecd3958aaea7f3a749864d18d80e7c 100644 (file)
@@ -339,8 +339,8 @@ bool dir_update_volume_info(DCR *dcr, bool label)
       vol->VolCatWrites, edit_uint64(vol->VolCatMaxBytes, ed2),
       LastWritten, vol->VolCatStatus, vol->Slot, label,
       InChanger,                      /* bool in structure */
-      edit_uint64(vol->VolReadTime, ed3),
-      edit_uint64(vol->VolWriteTime, ed4),
+      edit_int64(vol->VolReadTime, ed3),
+      edit_int64(vol->VolWriteTime, ed4),
       edit_uint64(vol->VolFirstWritten, ed5),
       vol->VolCatParts);
     Dmsg1(100, ">dird: %s", dir->msg);
index a070c01bff1e15690d9e7691ef320bfd346be43e..6a68935c7a06e345f7f07b7692dfbf89f7821cfa 100644 (file)
@@ -2193,13 +2193,10 @@ void DEVICE::edit_mount_codes(POOL_MEM &omsg, const char *imsg)
 }
 
 /* return the last timer interval (ms) */
-int DEVICE::get_timer_count()
+btime_t DEVICE::get_timer_count()
 {
    btime_t old = last_timer;
-   struct timeval tv;
-   gettimeofday(&tv, NULL);
-   last_timer = tv.tv_usec + tv.tv_sec * 1000000;
-
+   last_timer = get_current_btime();
    return last_timer - old;
 }
 
index e6a5d1c16f6eb3b5017b6b1b1a54415e0f49a4f5..688eee3c1433967394fd15ee7f7d96bc3b89faec 100644 (file)
@@ -177,9 +177,9 @@ struct VOLUME_CAT_INFO {
    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 */
-   int64_t VolMediaId;                /* MediaId */
+   btime_t  VolReadTime;              /* time spent reading */
+   btime_t  VolWriteTime;             /* time spent writing this Volume */
+   int64_t  VolMediaId;               /* MediaId */
    utime_t  VolFirstWritten;          /* Time of first write */
    bool     InChanger;                /* Set if vol in current magazine */
    char VolCatStatus[20];             /* Volume status */
@@ -283,13 +283,13 @@ public:
    btime_t last_timer;        /* used by read/write/seek to get stats (usec) */
    btime_t last_tick;         /* contains last read/write time (usec) */
 
-   uint64_t DevReadTime;
-   uint64_t DevWriteTime;
+   btime_t  DevReadTime;
+   btime_t  DevWriteTime;
    uint64_t DevWriteBytes;
    uint64_t DevReadBytes;
 
    /* Methods */
-   int get_timer_count();            /* return the last timer interval (ms) */
+   btime_t get_timer_count();        /* return the last timer interval (ms) */
 
    int has_cap(int cap) const { return capabilities & cap; }
    void clear_cap(int cap) { capabilities &= ~cap; }
index 77dbf0297e251745e4891982c15577df21984727..e28200ceff1e75e6d049b6dc9817bc8d4463be56 100644 (file)
@@ -1,6 +1,8 @@
               Technical notes on version 2.1
 
 General:
+13Feb07
+ebl  Use btime_t instead of uint64_t in media patch.
 11Feb07
 kes  Optimize the use of the database a bit in the Status dir command.
      Only open it when needed, ensure that if any previous database
@@ -18,7 +20,7 @@ kes  Apply Eric's scratch patch that moves a purged Volume to
 kes  Apply Eric's media patch that collects read/write media
      times as well as byte counts.  This patch requires a
      simultaneous upgrade of the DIR and SD.  Note, there
-     should be some way to turn of timing. I'm not sure
+     should be some way to turn off timing. I'm not sure
      times are in Bacula units.
 kes  Apply Eric's batch-insert patch.
 09Feb07