Changes by: szaka
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv19112/ntfstools
Modified Files:
ntfsfix.c
Log Message:
Merge set_ntfs_volume_flags() and code from ntfsfix as a new library
function: ntfs_set_volume_flags(). Note, ntfs_set_volume_flags() is
moving to volume.[ch]
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsfix.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -U2 -r1.40 -r1.41
--- ntfsfix.c 12 Jul 2002 12:38:54 -0000 1.40
+++ ntfsfix.c 14 Jul 2002 17:16:52 -0000 1.41
@@ -254,13 +254,4 @@
mount_ok:
m = NULL;
- if (ntfs_read_file_record(vol, FILE_Volume, (MFT_RECORD**)&m, NULL)) {
- perror("Failed to read $Volume");
- goto error_exit;
- }
- if (!(((MFT_RECORD*)m)->flags & MFT_RECORD_IN_USE)) {
- fprintf(stderr, "Error: $Volume has been deleted. Cannot "
- "handle this yet. Run chkdsk to fix this.\n");
- goto error_exit;
- }
/* Check NTFS version is ok for us (in $Volume) */
@@ -271,4 +262,5 @@
goto error_exit;
}
+
printf("Setting required flags on partition... ");
/*
@@ -280,15 +272,7 @@
if (vol->major_ver >= 2)
flags |= VOLUME_MOUNTED_ON_NT4;
- if (!set_ntfs_volume_flags(vol, (MFT_RECORD*)m, flags)) {
+ if (ntfs_set_volume_flags(vol, flags)) {
puts(FAILED);
fprintf(stderr, "Error setting volume flags.\n");
- goto error_exit;
- }
- /* FIXME: The above makes me puke! We definitely need functions just
- taking the volume and flags and setting the volume flags! */
- br = ntfs_write_mft_record(vol, FILE_Volume, (MFT_RECORD*)m);
- if (br) {
- puts(FAILED);
- perror("Error writing $Volume");
goto error_exit;
}
|