]> git.wh0rd.org - dump.git/commitdiff
Largefile version of seek in rmt.
authorStelian Pop <stelian@popies.net>
Fri, 10 Jan 2003 14:42:47 +0000 (14:42 +0000)
committerStelian Pop <stelian@popies.net>
Fri, 10 Jan 2003 14:42:47 +0000 (14:42 +0000)
CHANGES
common/dumprmt.c
compat/include/compatlfs.h
dump/dump.h
restore/dirs.c
restore/extern.h
restore/tape.c
rmt/rmt.c

diff --git a/CHANGES b/CHANGES
index 0a2e60335c750fc062965528ef27de94674415ae..0e16055e73b259a946a35b55869013715efc1b00 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.205 2003/01/10 10:52:48 stelian Exp $
+$Id: CHANGES,v 1.206 2003/01/10 14:42:47 stelian Exp $
 
 Changes between versions 0.4b32 and 0.4b33 (released ?????????????????)
 =======================================================================
@@ -34,6 +34,8 @@ Changes between versions 0.4b32 and 0.4b33 (released ?????????????????)
        a dump. Thanks to Michal Szymanski <msz@astrouw.edu.pl> for
        the suggestions.
 
+7.     Made rmt understand long (largefiles) seeks.
+
 Changes between versions 0.4b31 and 0.4b32 (released November 15, 2002)
 =======================================================================
 
index f89a13de1fb60a1c5cf5fdc14b0b3bdd12a85dee..1d49a240d5e8883aeb9c650c997d59f0e1c12195 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dumprmt.c,v 1.23 2002/07/29 12:00:33 stelian Exp $";
+       "$Id: dumprmt.c,v 1.24 2003/01/10 14:42:50 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -331,12 +331,12 @@ rmtwrite(const char *buf, size_t count)
        return (rmtreply("write"));
 }
 
-int
-rmtseek(int offset, int pos)
+OFF_T
+rmtseek(OFF_T offset, int pos)
 {
        char line[80];
 
-       (void)snprintf(line, sizeof (line), "L%d\n%d\n", offset, pos);
+       (void)snprintf(line, sizeof (line), "L%lld\n%d\n", (long long)offset, pos);
        return (rmtcall("seek", line));
 }
 
index 8cd0f964a1a8509bcc17905ed6ea1ec4bf27bef0..85c987fb932de2d8bb3f1049ffefe415f1d581e8 100644 (file)
@@ -3,7 +3,7 @@
  *     dump and restore backup suit
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
- *     $Id: compatlfs.h,v 1.2 2002/01/16 09:32:14 stelian Exp $
+ *     $Id: compatlfs.h,v 1.3 2003/01/10 14:42:50 stelian Exp $
  */
 
 /*-
@@ -52,6 +52,7 @@
 #define STAT stat64
 #define LSTAT lstat64
 #define FTRUNCATE ftruncate64
+#define OFF_T __off64_t
 
 #else
 
@@ -60,6 +61,7 @@
 #define STAT stat
 #define LSTAT lstat
 #define FTRUNCATE ftruncate
+#define OFF_T off_t
 
 #endif /* USE_LFS */
 
index c4d8dca10020176d8889366dabfa480513b152b1..31210746faa87efe2cdc4979fdf580bb6d168321 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
- *     $Id: dump.h,v 1.41 2002/12/12 11:49:35 stelian Exp $
+ *     $Id: dump.h,v 1.42 2003/01/10 14:42:50 stelian Exp $
  */
 
 /*-
@@ -43,6 +43,7 @@
 
 #include <config.h>
 #include <protocols/dumprestore.h>
+#include <compatlfs.h>
 
 #define MAXINOPB       (MAXBSIZE / sizeof(struct dinode))
 #define MAXNINDIR      (MAXBSIZE / sizeof(daddr_t))
@@ -190,7 +191,7 @@ int rmtopen __P((const char *tape, const int mode));
 void   rmtclose __P((void));
 int    rmtread __P((char *buf, size_t count));
 int    rmtwrite __P((const char *buf, size_t count));
-int    rmtseek __P((int offset, int pos));
+OFF_T  rmtseek __P((OFF_T offset, int pos));
 struct mtget * rmtstatus __P((void));
 int    rmtioctl __P((int cmd, int count));
 #endif /* RDUMP */
index 228877733a4388fd90cb82c91315142ffd91790b..2be4e528f9e0a25ba56c15f3f5d8355235ebdeda 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dirs.c,v 1.21 2002/07/19 14:57:39 stelian Exp $";
+       "$Id: dirs.c,v 1.22 2003/01/10 14:42:51 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -587,7 +587,7 @@ static long
 rst_telldir(RST_DIR *dirp)
 {
        return ((long)lseek(dirp->dd_fd,
-           (off_t)0, SEEK_CUR) - dirp->dd_size + dirp->dd_loc);
+           (OFF_T)0, SEEK_CUR) - dirp->dd_size + dirp->dd_loc);
 }
 
 /*
index 6ea57e383065036f182d3b3146192af426126a96..ce2a0410554721345d48a5701b3969e81c3ce317 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
- *     $Id: extern.h,v 1.20 2002/11/15 09:25:41 stelian Exp $
+ *     $Id: extern.h,v 1.21 2003/01/10 14:42:51 stelian Exp $
  */
 
 /*-
@@ -42,6 +42,7 @@
  */
 
 #include <config.h>
+#include <compatlfs.h>
 
 struct entry   *addentry __P((char *, dump_ino_t, int));
 long            addfile __P((char *, dump_ino_t, int));
@@ -121,7 +122,7 @@ int         rmthost __P((const char *));
 int            rmtioctl __P((int, int));
 int            rmtopen __P((const char *, const int));
 int            rmtread __P((const char *, int));
-int            rmtseek __P((int, int));
+OFF_T          rmtseek __P((OFF_T, int));
 
 /* From e2fsprogs */
 int fsetflags __P((const char *, unsigned long));
index 5543cfb098d690df7fcb70dabbf8a5ef9896e7ca..2bb447239bed286d20afbe0de2cb57f2afdf7215 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.66 2002/11/28 08:54:00 stelian Exp $";
+       "$Id: tape.c,v 1.67 2003/01/10 14:42:51 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -1019,7 +1019,7 @@ static void
 xtrskip(UNUSED(char *buf), size_t size)
 {
 
-       if (LSEEK(ofile, (off_t)size, SEEK_CUR) == -1)
+       if (LSEEK(ofile, (OFF_T)size, SEEK_CUR) == -1)
                err(1, "seek error extracting inode %lu, name %s\nlseek",
                        (unsigned long)curfile.ino, curfile.name);
 }
@@ -1547,7 +1547,7 @@ getmore:
                        seek_failed = (rmtseek(i, 1) < 0);
                else
 #endif
-                       seek_failed = (LSEEK(mt, i, SEEK_CUR) == (off_t)-1);
+                       seek_failed = (LSEEK(mt, i, SEEK_CUR) == (OFF_T)-1);
 
                if (seek_failed) {
                        warn("continuation failed");
@@ -2589,7 +2589,7 @@ GotoTapePos(long long pos)
 
 #ifdef RDUMP
        if (host)
-               err = (rmtseek((long)pos, SEEK_SET) < 0);
+               err = (rmtseek(pos, SEEK_SET) < 0);
        else
 #endif
        {
index fc6eb827f4788c0c60b878f918c1eb0fc0e394b8..3167e1dd76e1f4015ccf83af6d26a763a28b7e0f 100644 (file)
--- a/rmt/rmt.c
+++ b/rmt/rmt.c
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: rmt.c,v 1.21 2002/07/29 12:00:34 stelian Exp $";
+       "$Id: rmt.c,v 1.22 2003/01/10 14:42:51 stelian Exp $";
 #endif /* not linux */
 
 /*
@@ -183,7 +183,7 @@ top:
                getstring(count);
                getstring(pos);
                DEBUG2("rmtd: L %s %s\n", count, pos);
-               rval = LSEEK(tape, (off_t)atol(count), atoi(pos));
+               rval = LSEEK(tape, (OFF_T)atoll(count), atoi(pos));
                if (rval < 0)
                        goto ioerror;
                goto respond;