Changes by: szaka
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3838/ntfsprogs
Modified Files:
ntfsclone.c
Log Message:
--metadata sets timestamps to the Epoch time as mkntfs does with -T. This
increases the compressed image sizes by only 0.3-0.8% but ntfsclone creates
now the exact same metadata images as mkntfs, which fact can be used for QA.
Index: ntfsclone.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsclone.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -p -r1.72 -r1.73
--- ntfsclone.c 5 Feb 2006 22:10:01 -0000 1.72
+++ ntfsclone.c 6 Feb 2006 20:51:17 -0000 1.73
@@ -68,6 +68,7 @@
#include "inode.h"
#include "dir.h"
#include "runlist.h"
+#include "ntfstime.h"
#include "utils.h"
#include "version.h"
@@ -710,7 +711,7 @@ static void restore_image(void)
}
}
-static void wipe_index_root_timestamps(ATTR_RECORD *attr)
+static void wipe_index_root_timestamps(ATTR_RECORD *attr, s64 timestamp)
{
INDEX_ENTRY *entry;
INDEX_ROOT *iroot;
@@ -723,10 +724,10 @@ static void wipe_index_root_timestamps(A
if (iroot->type == AT_FILE_NAME) {
- entry->key.file_name.creation_time = 0;
- entry->key.file_name.last_access_time = 0;
- entry->key.file_name.last_data_change_time = 0;
- entry->key.file_name.last_mft_change_time = 0;
+ entry->key.file_name.creation_time = timestamp;
+ entry->key.file_name.last_access_time = timestamp;
+ entry->key.file_name.last_data_change_time = timestamp;
+ entry->key.file_name.last_mft_change_time = timestamp;
} else if (ntfs_names_are_equal(NTFS_INDEX_Q,
sizeof(NTFS_INDEX_Q) / 2 - 1,
@@ -743,22 +744,22 @@ static void wipe_index_root_timestamps(A
* till we only check for quota version 2 ...
*/
if (le32_to_cpu(quota_q->version) == 2)
- quota_q->change_time = 0;
+ quota_q->change_time = timestamp;
}
entry = (INDEX_ENTRY*)((u8*)entry + le16_to_cpu(entry->length));
}
}
-#define WIPE_TIMESTAMPS(atype, attr) \
+#define WIPE_TIMESTAMPS(atype, attr, timestamp) \
do { \
atype *ats; \
ats = (atype *)((char *)(attr) + (attr)->value_offset); \
\
- ats->creation_time = 0; \
- ats->last_data_change_time = 0; \
- ats->last_mft_change_time= 0; \
- ats->last_access_time = 0; \
+ ats->creation_time = (timestamp); \
+ ats->last_data_change_time = (timestamp); \
+ ats->last_mft_change_time= (timestamp); \
+ ats->last_access_time = (timestamp); \
\
wiped_timestamp_data += 32; \
\
@@ -767,15 +768,16 @@ do { \
static void wipe_timestamps(ntfs_walk_clusters_ctx *image)
{
ATTR_RECORD *a = image->ctx->attr;
+ s64 timestamp = utc2ntfs(0);
if (a->type == AT_FILE_NAME)
- WIPE_TIMESTAMPS(FILE_NAME_ATTR, a);
+ WIPE_TIMESTAMPS(FILE_NAME_ATTR, a, timestamp);
else if (a->type == AT_STANDARD_INFORMATION)
- WIPE_TIMESTAMPS(STANDARD_INFORMATION, a);
+ WIPE_TIMESTAMPS(STANDARD_INFORMATION, a, timestamp);
else if (a->type == AT_INDEX_ROOT)
- wipe_index_root_timestamps(a);
+ wipe_index_root_timestamps(a, timestamp);
}
static void wipe_resident_data(ntfs_walk_clusters_ctx *image)
|