Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv7786
Modified Files:
mkntfs.c
Log Message:
Some output cleanup.
Index: mkntfs.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/mkntfs.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -U2 -r1.34 -r1.35
--- mkntfs.c 2001/06/13 12:21:51 1.34
+++ mkntfs.c 2001/06/13 18:07:00 1.35
@@ -2780,10 +2780,10 @@
err_exit("Failed to allocate internal buffer: %s",
strerror(errno));
- /* $Bitmap could overlap the end of the volume.
- * Any bits in this region must be set.
- * This region also encompassed the backup boot sector. */
- for (i = opt.nr_clusters; i < lcn_bitmap_byte_size<<3; i++)
- ntfs_set_bit(lcn_bitmap, (__u64) i, 1);
-
+ /*
+ * $Bitmap can overlap the end of the volume. Any bits in this region
+ * must be set. This region also encompasses the backup boot sector.
+ */
+ for (i = opt.nr_clusters; i < lcn_bitmap_byte_size << 3; i++)
+ ntfs_set_bit(lcn_bitmap, (__u64)i, 1);
/* Determine MFT zone size. */
opt.mft_zone_end = opt.nr_clusters;
@@ -2930,6 +2930,8 @@
// TODO: Mark bad blocks as such.
- /* If not quick format, fill the device with 0s.
- * FIXME: Except bad blocks! (AIA) */
+ /*
+ * If not quick format, fill the device with 0s.
+ * FIXME: Except bad blocks! (AIA)
+ */
if (!opt.quick_format) {
unsigned long position;
@@ -2993,5 +2995,5 @@
Qprintf(" - Done.\n");
}
- Dprintf("Creating $MFT.\n");
+ Qprintf("Creating NTFS volume structures.\n");
/* Setup an empty mft record. */
format_mft_record((MFT_RECORD*)buf);
@@ -3028,5 +3030,5 @@
/* The root directory mft reference. */
root_ref = MAKE_MFT_REF(FILE_$root, FILE_$root);
- Dprintf("Creating root directory (mft record 5)\n");
+ Vprintf("Creating root directory (mft record 5)\n");
m = (MFT_RECORD*)(buf + 5 * opt.mft_record_size);
m->flags |= MFT_RECORD_IS_DIRECTORY;
@@ -3065,5 +3067,5 @@
// dump_mft_record(m);
/* Add all other attributes, on a per-file basis for clarity. */
- Dprintf("Creating $MFT (mft record 0)\n");
+ Vprintf("Creating $MFT (mft record 0)\n");
m = (MFT_RECORD*)buf;
err = add_attr_data_positioned(m, NULL, 0, 0, NULL, 0, 0, rl_mft, buf,
@@ -3086,5 +3088,5 @@
err_exit("Couldn't create $MFT: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $MFTMirr (mft record 1)\n");
+ Vprintf("Creating $MFTMirr (mft record 1)\n");
m = (MFT_RECORD*)(buf + 1 * opt.mft_record_size);
err = add_attr_data_positioned(m, NULL, 0, 0, NULL, 0, 0, rl_mftmirr,
@@ -3104,5 +3106,5 @@
err_exit("Couldn't create $MFTMirr: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $LogFile (mft record 2)\n");
+ Vprintf("Creating $LogFile (mft record 2)\n");
m = (MFT_RECORD*)(buf + 2 * opt.mft_record_size);
buf2 = malloc(opt.logfile_size);
@@ -3128,5 +3130,5 @@
err_exit("Couldn't create $LogFile: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $Volume (mft record 3)\n");
+ Vprintf("Creating $Volume (mft record 3)\n");
m = (MFT_RECORD*)(buf + 3 * opt.mft_record_size);
err = create_hardlink(index_block, root_ref, m,
@@ -3143,11 +3145,14 @@
err = add_attr_vol_name(m, opt.volume_label, opt.volume_label ?
strlen(opt.volume_label) : 0);
- if (!err)
+ if (!err) {
+ Qprintf("Setting the volume dirty so check disk runs on next "
+ "reboot into Windows.\n");
err = add_attr_vol_info(m, VOLUME_IS_DIRTY, opt.ntfs_major_ver,
opt.ntfs_minor_ver);
+ }
if (err < 0)
err_exit("Couldn't create $Volume: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $AttrDef (mft record 4)\n");
+ Vprintf("Creating $AttrDef (mft record 4)\n");
m = (MFT_RECORD*)(buf + 4 * opt.mft_record_size);
if (opt.ntfs_major_ver < 3)
@@ -3178,5 +3183,5 @@
err_exit("Couldn't create $AttrDef: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $Bitmap (mft record 6)\n");
+ Vprintf("Creating $Bitmap (mft record 6)\n");
m = (MFT_RECORD*)(buf + 6 * opt.mft_record_size);
err = add_attr_data(m, NULL, 0, 0, NULL, 0, 0, lcn_bitmap,
@@ -3196,5 +3201,5 @@
err_exit("Couldn't create $Bitmap: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $Boot (mft record 7)\n");
+ Vprintf("Creating $Boot (mft record 7)\n");
m = (MFT_RECORD*)(buf + 7 * opt.mft_record_size);
buf2 = calloc(1, 8192);
@@ -3274,5 +3279,5 @@
if (err < 0)
err_exit("Couldn't create $Boot: %s\n", strerror(-err));
- Dprintf("Creating backup boot sector.\n");
+ Vprintf("Creating backup boot sector.\n");
/*
* Write the first max(512, opt.sector_size) bytes from buf2 to the
@@ -3302,5 +3307,5 @@
}
//dump_mft_record(m);
- Dprintf("Creating $BadClus (mft record 8)\n");
+ Vprintf("Creating $BadClus (mft record 8)\n");
m = (MFT_RECORD*)(buf + 8 * opt.mft_record_size);
/* Create a sparse named stream of size equal to the volume size. */
@@ -3324,5 +3329,5 @@
err_exit("Couldn't create $BadClus: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $Quota (mft record 9)\n");
+ Vprintf("Creating $Quota (mft record 9)\n");
m = (MFT_RECORD*)(buf + 9 * opt.mft_record_size);
err = add_attr_data(m, NULL, 0, 0, NULL, 0, 0, NULL, 0);
@@ -3339,5 +3344,5 @@
err_exit("Couldn't create $Quota: %s\n", strerror(-err));
//dump_mft_record(m);
- Dprintf("Creating $UpCase (mft record 0xa)\n");
+ Vprintf("Creating $UpCase (mft record 0xa)\n");
m = (MFT_RECORD*)(buf + 0xa * opt.mft_record_size);
err = add_attr_data(m, NULL, 0, 0, NULL, 0, 0, (char*)opt.upcase,
@@ -3359,5 +3364,5 @@
/* NTFS 1.2 reserved system files (mft records 0xb-0xf) */
for (i = 0xb; i < 0x10; i++) {
- Dprintf("Creating system file (mft record 0x%x)\n", i, i);
+ Vprintf("Creating system file (mft record 0x%x)\n", i, i);
m = (MFT_RECORD*)(buf + i * opt.mft_record_size);
err = add_attr_data(m, NULL, 0, 0, NULL, 0, 0, NULL, 0);
@@ -3382,5 +3387,5 @@
// applicable). Possibly should move this as far to the top as possible and
// update during each subsequent c&w of each system file.
- Dprintf("Syncing root directory index record.\n");
+ Vprintf("Syncing root directory index record.\n");
m = (MFT_RECORD*)(buf + 5 * opt.mft_record_size);
i = 5 * sizeof(uchar_t);
@@ -3412,5 +3417,5 @@
/* No more changes to @index_block below here so no need for fixup: */
// __post_read_mst_fixup((NTFS_RECORD*)index_block, i);
- Dprintf("Syncing $Bitmap.\n");
+ Vprintf("Syncing $Bitmap.\n");
m = (MFT_RECORD*)(buf + 6 * opt.mft_record_size);
memset(&ctx, 0, sizeof(ctx));
@@ -3435,5 +3440,5 @@
* its creation.
*/
- Dprintf("Syncing $MFT.\n");
+ Vprintf("Syncing $MFT.\n");
pos = opt.mft_lcn * opt.cluster_size;
lw = opt.mft_record_size;
@@ -3447,5 +3452,5 @@
pos += opt.mft_record_size;
}
- Dprintf("Updating $MFTMirr.\n");
+ Vprintf("Updating $MFTMirr.\n");
pos = opt.mftmirr_lcn * opt.cluster_size;
lw = opt.mft_record_size;
@@ -3472,8 +3477,8 @@
pos += opt.mft_record_size;
}
- Dprintf("Syncing device.\n");
+ Vprintf("Syncing device.\n");
if (fdatasync(f) == -1)
err_exit("Syncing device. FAILED: %s", strerror(errno));
- Dprintf("mkntfs completed successfully. Have a nice day.\n");
+ Qprintf("mkntfs completed successfully. Have a nice day.\n");
/*
* Device is unlocked and closed by the registered exit function
|