Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv16914/ntfstools
Modified Files:
ntfsfix.c
Log Message:
Fix ntfsfix as well. This completes all changes and everything should be just as functional as before.
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsfix.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -U2 -r1.23 -r1.24
--- ntfsfix.c 14 Apr 2002 14:15:47 -0000 1.23
+++ ntfsfix.c 15 Apr 2002 19:17:24 -0000 1.24
@@ -129,6 +129,6 @@
/* Read $MFT and $MFTmirr. */
printf("Going to read $Mft... ");
- *(__u64*)&mref = FILE_$MFT;
- br = get_mft_records(vol, (MFT_RECORD*)b1, &mref, 4);
+ mref = (MFT_REF)FILE_$MFT;
+ br = read_mft_records(vol, mref, 4, (MFT_RECORD*)b1);
if (br != 4) {
puts(FAILED);
@@ -136,9 +136,9 @@
}
puts(OK);
- /* Use mst_pread as we don't want to rely on information in $Mft for
- * locating $MftMirr as that would defeat the point of $MftMirr. */
+ /* Use ntfs_mst_pread as we don't want to rely on information in $Mft
+ * for locating $MftMirr as that would defeat the point of $MftMirr. */
printf("Going to read $MftMirr... ");
- br = mst_pread(vol->fd, b2, mrs, 4, vol->mftmirr_lcn <<
- vol->cluster_size_bits);
+ br = ntfs_mst_pread(vol->fd, vol->mftmirr_lcn << vol->cluster_size_bits,
+ 4, mrs, b2);
if (br != 4) {
puts(FAILED);
@@ -245,11 +245,12 @@
memcpy(b2 + mrs * i, b1 + mrs * i, mrs);
/* Do the writes now. */
- *(__u64*)&mref = i;
- br = put_mft_record(vol, b1 + mrs * i, &mref);
+ mref = (MFT_REF)i;
+ br = write_mft_record(vol, mref,
+ (MFT_RECORD*)(b1 + mrs * i));
if (br != 1)
goto mirr_sync_failed;
- br = mst_pwrite(vol->fd, b2 + mrs * i, mrs,
- (vol->mftmirr_lcn * vol->cluster_size) +
- (i * mrs));
+ br = ntfs_mst_pwrite(vol->fd, (vol->mftmirr_lcn <<
+ vol->cluster_size_bits) + i * mrs, 1,
+ mrs, b2 + mrs * i);
/* If we succeeded then do the next record. */
if (br == mrs)
@@ -310,6 +311,6 @@
/* Write $Volume to $Mft. */
printf("Writing $Volume to $Mft... ");
- *(__u64*)&mref = FILE_$Volume;
- br = put_mft_record(vol, b1 + (3 * mrs), &mref);
+ mref = (MFT_REF)FILE_$Volume;
+ br = write_mft_record(vol, mref, (MFT_RECORD*)(b1 + 3 * mrs));
if (br != 1) {
puts(FAILED);
@@ -325,7 +326,7 @@
/* Write $Volume to $MftMirr. */
printf("Writing $Volume to $MftMirr... ");
- br = mst_pwrite(vol->fd, b2 + (3 * mrs), mrs,
- (vol->mftmirr_lcn << vol->cluster_size_bits) +
- (3 * mrs));
+ br = ntfs_mst_pwrite(vol->fd, (vol->mftmirr_lcn <<
+ vol->cluster_size_bits) + 3 * mrs, 1, mrs,
+ b2 + 3 * mrs);
if (br != mrs) {
puts(FAILED);
|