Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15310/ntfsprogs
Modified Files:
ntfscp.c ntfsinfo.c
Log Message:
ntfscp.c: fix bug intoduced by Anton in changeset 1.21
ntfsinfo: more info on index dumping
dir.c, layout.h: minor fixes
Index: ntfscp.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscp.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- ntfscp.c 6 Jul 2005 22:47:19 -0000 1.24
+++ ntfscp.c 25 Jul 2005 22:05:27 -0000 1.25
@@ -262,7 +262,7 @@ int main (int argc, char *argv[])
u64 offset;
char *buf;
s64 br, bw;
- ntfschar *attr_name = AT_UNNAMED;
+ ntfschar *attr_name;
int attr_name_len = 0;
if (!parse_options(argc, argv))
@@ -363,12 +363,14 @@ int main (int argc, char *argv[])
}
if (opts.attr_name) {
+ attr_name = NULL;
attr_name_len = ntfs_mbstoucs(opts.attr_name, &attr_name, 0);
if (attr_name_len == -1) {
perror("ERROR: Failed to parse attribute name");
goto close_dst;
}
- }
+ } else
+ attr_name = AT_UNNAMED;
na = ntfs_attr_open(out, opts.attribute, attr_name, attr_name_len);
if (!na) {
if (errno != ENOENT) {
@@ -383,6 +385,8 @@ int main (int argc, char *argv[])
goto close_dst;
}
}
+ if (attr_name != AT_UNNAMED)
+ free(attr_name);
Vprintf("Old file size: %lld\n", na->data_size);
if (na->data_size != new_size) {
Index: ntfsinfo.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsinfo.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -p -r1.71 -r1.72
--- ntfsinfo.c 20 Jul 2005 19:06:49 -0000 1.71
+++ ntfsinfo.c 25 Jul 2005 22:05:27 -0000 1.72
@@ -1086,7 +1086,6 @@ static int ntfs_dump_index_entries(INDEX
int numb_entries = 1;
char *name = NULL;
- Vprintf("\tDumping index entries:");
while(1) {
if (!opts.verbose) {
if (entry->flags & INDEX_ENTRY_END)
@@ -1103,6 +1102,10 @@ static int ntfs_dump_index_entries(INDEX
le16_to_cpu(entry->key_length));
Vprintf("\t\tFlags:\t\t\t 0x%02x\n", le16_to_cpu(entry->flags));
+ if (entry->flags & INDEX_ENTRY_NODE)
+ Vprintf("\t\tSubnode VCN:\t\t %lld\n", le64_to_cpu(
+ *((u8*)entry + le16_to_cpu(
+ entry->length) - sizeof(VCN))));
if (entry->flags & INDEX_ENTRY_END)
break;
@@ -1224,6 +1227,7 @@ static void ntfs_dump_attr_index_root(AT
entry = (INDEX_ENTRY *)((u8 *)index_root +
le32_to_cpu(index_root->index.entries_offset) + 0x10);
+ Vprintf("\tDumping index block:");
printf("\tIndex entries total:\t %d\n",
ntfs_dump_index_entries(entry, index_root->type));
}
@@ -1344,6 +1348,12 @@ static void ntfs_dump_index_allocation(A
}
entry = (INDEX_ENTRY *)((u8 *)tmp_alloc + le32_to_cpu(
tmp_alloc->index.entries_offset) + 0x18);
+ Vprintf("\tDumping index block "
+ "(VCN %lld, used %u/%u):", le64_to_cpu(
+ tmp_alloc->index_block_vcn),
+ le32_to_cpu(tmp_alloc->index.
+ index_length), le32_to_cpu(tmp_alloc->
+ index.allocated_size));
total_entries += ntfs_dump_index_entries(entry, type);
total_indx_blocks++;
}
|