44
44
*
45
45
* - Is able to do incremental mirroring/backups via hardlinks from
46
46
* the 'previous' version (supplied with -H path).
47
- *
48
- * $DragonFly: src/bin/cpdup/cpdup.c,v 1.32 2008/11/11 04:36:00 dillon Exp $
49
47
*/
50
48
51
49
/*-
@@ -149,7 +147,6 @@ int NotForRealOpt;
149
147
int QuietOpt ;
150
148
int NoRemoveOpt ;
151
149
int UseMD5Opt ;
152
- int UseFSMIDOpt ;
153
150
int SummaryOpt ;
154
151
int CompressOpt ;
155
152
int SlaveOpt ;
@@ -161,7 +158,6 @@ int DstRootPrivs;
161
158
162
159
const char * UseCpFile ;
163
160
const char * MD5CacheFile ;
164
- const char * FSMIDCacheFile ;
165
161
const char * UseHLPath ;
166
162
167
163
static int DstBaseLen ;
@@ -196,7 +192,7 @@ main(int ac, char **av)
196
192
197
193
gettimeofday (& start , NULL );
198
194
opterr = 0 ;
199
- while ((opt = getopt (ac , av , ":CdF:fH:hIi:j:K:klM :mnoqRSs:uVvX:x" )) != -1 ) {
195
+ while ((opt = getopt (ac , av , ":CdF:fH:hIi:j:lM :mnoqRSs:uVvX:x" )) != -1 ) {
200
196
switch (opt ) {
201
197
case 'C' :
202
198
CompressOpt = 1 ;
@@ -228,14 +224,6 @@ main(int ac, char **av)
228
224
case 'j' :
229
225
DeviceOpt = getbool (optarg );
230
226
break ;
231
- case 'K' :
232
- UseFSMIDOpt = 1 ;
233
- FSMIDCacheFile = optarg ;
234
- break ;
235
- case 'k' :
236
- UseFSMIDOpt = 1 ;
237
- FSMIDCacheFile = ".FSMID.CHECK" ;
238
- break ;
239
227
case 'l' :
240
228
setlinebuf (stdout );
241
229
setlinebuf (stderr );
@@ -333,8 +321,6 @@ main(int ac, char **av)
333
321
if (dst && (ptr = SplitRemote (& dst )) != NULL ) {
334
322
DstHost .host = dst ;
335
323
dst = ptr ;
336
- if (UseFSMIDOpt )
337
- fatal ("The FSMID options are not currently supported for remote targets" );
338
324
if (hc_connect (& DstHost , 0 ) < 0 )
339
325
exit (1 );
340
326
} else {
@@ -381,7 +367,6 @@ main(int ac, char **av)
381
367
#ifndef NOMD5
382
368
md5_flush ();
383
369
#endif
384
- fsmid_flush ();
385
370
386
371
if (SummaryOpt && i == 0 ) {
387
372
double duration ;
@@ -815,8 +800,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
815
800
816
801
/*
817
802
* Do we need to copy the file/dir/link/whatever? Early termination
818
- * if we do not. Always redo links. Directories are always traversed
819
- * except when the FSMID options are used.
803
+ * if we do not. Always traverse directories. Always redo links.
820
804
*
821
805
* NOTE: st2Valid is true only if dpath != NULL *and* dpath stats good.
822
806
*/
@@ -827,24 +811,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
827
811
&& FlagsMatch (stat1 , & st2 )
828
812
) {
829
813
if (S_ISLNK (stat1 -> st_mode ) || S_ISDIR (stat1 -> st_mode )) {
830
- /*
831
- * If FSMID tracking is turned on we can avoid recursing through
832
- * an entire directory subtree if the FSMID matches.
833
- */
834
- #ifdef _ST_FSMID_PRESENT_
835
- if (ForceOpt == 0 &&
836
- (UseFSMIDOpt && (fres = fsmid_check (stat1 -> st_fsmid , dpath )) == 0 )
837
- ) {
838
- if (VerboseOpt >= 3 ) {
839
- if (UseFSMIDOpt ) /* always true!?! */
840
- logstd ("%-32s fsmid-nochange\n" , (dpath ? dpath : spath ));
841
- else
842
- logstd ("%-32s nochange\n" , (dpath ? dpath : spath ));
843
- }
844
- r = 0 ;
845
- goto done ;
846
- }
847
- #endif
814
+ ;
848
815
} else {
849
816
if (ForceOpt == 0 &&
850
817
stat1 -> st_size == st2 .st_size &&
@@ -853,10 +820,6 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
853
820
#ifndef NOMD5
854
821
&& (UseMD5Opt == 0 || !S_ISREG (stat1 -> st_mode ) ||
855
822
(mres = md5_check (spath , dpath )) == 0 )
856
- #endif
857
- #ifdef _ST_FSMID_PRESENT_
858
- && (UseFSMIDOpt == 0 ||
859
- (fres = fsmid_check (stat1 -> st_fsmid , dpath )) == 0 )
860
823
#endif
861
824
&& (ValidateOpt == 0 || !S_ISREG (stat1 -> st_mode ) ||
862
825
validate_check (spath , dpath ) == 0 )
@@ -888,10 +851,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
888
851
(dpath ? dpath : spath ));
889
852
} else
890
853
#endif
891
- if (UseFSMIDOpt ) {
892
- logstd ("%-32s fsmid-nochange" ,
893
- (dpath ? dpath : spath ));
894
- } else if (ValidateOpt ) {
854
+ if (ValidateOpt ) {
895
855
logstd ("%-32s nochange (contents validated)" ,
896
856
(dpath ? dpath : spath ));
897
857
} else {
@@ -935,9 +895,6 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
935
895
if (S_ISDIR (stat1 -> st_mode )) {
936
896
int skipdir = 0 ;
937
897
938
- if (fres < 0 )
939
- logerr ("%-32s/ fsmid-CHECK-FAILED\n" , (dpath ) ? dpath : spath );
940
-
941
898
if (dpath ) {
942
899
if (!st2Valid || S_ISDIR (st2 .st_mode ) == 0 ) {
943
900
if (st2Valid )
@@ -1128,10 +1085,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
1128
1085
#ifndef NOMD5
1129
1086
if (mres < 0 )
1130
1087
logerr ("%-32s md5-CHECK-FAILED\n" , (dpath ) ? dpath : spath );
1131
- else
1132
1088
#endif
1133
- if (fres < 0 )
1134
- logerr ("%-32s fsmid-CHECK-FAILED\n" , (dpath ) ? dpath : spath );
1135
1089
1136
1090
/*
1137
1091
* Not quite ready to do the copy yet. If UseHLPath is defined,
@@ -1477,14 +1431,9 @@ ScanDir(List *list, struct HostConf *host, const char *path,
1477
1431
/*
1478
1432
* Automatically exclude MD5CacheFile that we create on the
1479
1433
* source from the copy to the destination.
1480
- *
1481
- * Automatically exclude a FSMIDCacheFile on the source that
1482
- * would otherwise overwrite the one we maintain on the target.
1483
1434
*/
1484
1435
if (UseMD5Opt )
1485
1436
AddList (list , MD5CacheFile , 1 , NULL );
1486
- if (UseFSMIDOpt )
1487
- AddList (list , FSMIDCacheFile , 1 , NULL );
1488
1437
}
1489
1438
1490
1439
if ((dir = hc_opendir (host , path )) == NULL )
0 commit comments