4444 *
4545 * - Is able to do incremental mirroring/backups via hardlinks from
4646 * 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 $
4947 */
5048
5149/*-
@@ -149,7 +147,6 @@ int NotForRealOpt;
149147int QuietOpt ;
150148int NoRemoveOpt ;
151149int UseMD5Opt ;
152- int UseFSMIDOpt ;
153150int SummaryOpt ;
154151int CompressOpt ;
155152int SlaveOpt ;
@@ -161,7 +158,6 @@ int DstRootPrivs;
161158
162159const char * UseCpFile ;
163160const char * MD5CacheFile ;
164- const char * FSMIDCacheFile ;
165161const char * UseHLPath ;
166162
167163static int DstBaseLen ;
@@ -196,7 +192,7 @@ main(int ac, char **av)
196192
197193 gettimeofday (& start , NULL );
198194 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 ) {
200196 switch (opt ) {
201197 case 'C' :
202198 CompressOpt = 1 ;
@@ -228,14 +224,6 @@ main(int ac, char **av)
228224 case 'j' :
229225 DeviceOpt = getbool (optarg );
230226 break ;
231- case 'K' :
232- UseFSMIDOpt = 1 ;
233- FSMIDCacheFile = optarg ;
234- break ;
235- case 'k' :
236- UseFSMIDOpt = 1 ;
237- FSMIDCacheFile = ".FSMID.CHECK" ;
238- break ;
239227 case 'l' :
240228 setlinebuf (stdout );
241229 setlinebuf (stderr );
@@ -333,8 +321,6 @@ main(int ac, char **av)
333321 if (dst && (ptr = SplitRemote (& dst )) != NULL ) {
334322 DstHost .host = dst ;
335323 dst = ptr ;
336- if (UseFSMIDOpt )
337- fatal ("The FSMID options are not currently supported for remote targets" );
338324 if (hc_connect (& DstHost , 0 ) < 0 )
339325 exit (1 );
340326 } else {
@@ -381,7 +367,6 @@ main(int ac, char **av)
381367#ifndef NOMD5
382368 md5_flush ();
383369#endif
384- fsmid_flush ();
385370
386371 if (SummaryOpt && i == 0 ) {
387372 double duration ;
@@ -815,8 +800,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
815800
816801 /*
817802 * 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.
820804 *
821805 * NOTE: st2Valid is true only if dpath != NULL *and* dpath stats good.
822806 */
@@ -827,24 +811,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
827811 && FlagsMatch (stat1 , & st2 )
828812 ) {
829813 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+ ;
848815 } else {
849816 if (ForceOpt == 0 &&
850817 stat1 -> st_size == st2 .st_size &&
@@ -853,10 +820,6 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
853820#ifndef NOMD5
854821 && (UseMD5Opt == 0 || !S_ISREG (stat1 -> st_mode ) ||
855822 (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 )
860823#endif
861824 && (ValidateOpt == 0 || !S_ISREG (stat1 -> st_mode ) ||
862825 validate_check (spath , dpath ) == 0 )
@@ -888,10 +851,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
888851 (dpath ? dpath : spath ));
889852 } else
890853#endif
891- if (UseFSMIDOpt ) {
892- logstd ("%-32s fsmid-nochange" ,
893- (dpath ? dpath : spath ));
894- } else if (ValidateOpt ) {
854+ if (ValidateOpt ) {
895855 logstd ("%-32s nochange (contents validated)" ,
896856 (dpath ? dpath : spath ));
897857 } else {
@@ -935,9 +895,6 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
935895 if (S_ISDIR (stat1 -> st_mode )) {
936896 int skipdir = 0 ;
937897
938- if (fres < 0 )
939- logerr ("%-32s/ fsmid-CHECK-FAILED\n" , (dpath ) ? dpath : spath );
940-
941898 if (dpath ) {
942899 if (!st2Valid || S_ISDIR (st2 .st_mode ) == 0 ) {
943900 if (st2Valid )
@@ -1128,10 +1085,7 @@ DoCopy(copy_info_t info, struct stat *stat1, int depth)
11281085#ifndef NOMD5
11291086 if (mres < 0 )
11301087 logerr ("%-32s md5-CHECK-FAILED\n" , (dpath ) ? dpath : spath );
1131- else
11321088#endif
1133- if (fres < 0 )
1134- logerr ("%-32s fsmid-CHECK-FAILED\n" , (dpath ) ? dpath : spath );
11351089
11361090 /*
11371091 * 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,
14771431 /*
14781432 * Automatically exclude MD5CacheFile that we create on the
14791433 * 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.
14831434 */
14841435 if (UseMD5Opt )
14851436 AddList (list , MD5CacheFile , 1 , NULL );
1486- if (UseFSMIDOpt )
1487- AddList (list , FSMIDCacheFile , 1 , NULL );
14881437 }
14891438
14901439 if ((dir = hc_opendir (host , path )) == NULL )
0 commit comments