Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv8151/ntfstools
Modified Files:
mkntfs.8.in mkntfs.c ntfsfix.c
Log Message:
Change version numbers of mkntfs and ntfsfix to match linux-ntfs release and add options to mkntfs to disable content indexing on the volume and to enable compression on the volume.
Index: mkntfs.8.in
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/mkntfs.8.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -U2 -r1.6 -r1.7
--- mkntfs.8.in 9 Nov 2001 21:30:52 -0000 1.6
+++ mkntfs.8.in 12 Mar 2002 21:48:27 -0000 1.7
@@ -1,10 +1,10 @@
.\" -*- nroff -*-
-.\" Copyright (c) 2001 Anton Altaparmakov. All Rights Reserved.
+.\" Copyright (c) 2001,2002 Anton Altaparmakov. All Rights Reserved.
.\" This file may be copied under the terms of the GNU Public License.
.\" Adapted from e2fsprogs-1.19/misc/mke2fs.8.in by Theodore Ts'o.
.\"
-.TH MKNTFS 8 "November 2001" "Linux-NTFS version @VERSION@"
+.TH MKNTFS 8 "March 2002" "Linux-NTFS version @VERSION@"
.SH NAME
-mkntfs \- create a NTFS 1.2 (Windows NT 4.0) file system
+mkntfs \- create a NTFS 1.2 (Windows NT/2000/XP) file system
.SH SYNOPSIS
.B mkntfs
@@ -43,7 +43,13 @@
]
[
+.B \-C
+]
+[
.B \-F
]
[
+.B \-I
+]
+[
.B \-V
]
@@ -153,4 +159,7 @@
.B mkntfs.
.TP
+.B \-C
+Enable compression on the volume.
+.TP
.B \-F
Force
@@ -160,4 +169,9 @@
is not a block special device, or appears to be mounted.
.TP
+.B \-I
+Disable content indexing on the volume. (This is only meaningful on
+Windows 2000 and later. Windows NT 4.0 and earlier ignore this as they do
+not implement content indexing at all.)
+.TP
.B \-V
Print the version number of
@@ -174,5 +188,5 @@
.I device
being formatted. However, current versions of the Linux kernel (all versions
-up to and including todays 2.4.14) either only report an even number of sectors
+up to and including todays 2.4.18) either only report an even number of sectors
when the sector size is below 1024 bytes, which is the case for most hard
drives today (512 bytes sector size) or they return the correct number but
@@ -196,5 +210,5 @@
is part of the Linux-NTFS project and is available for download from
http://sf.net/project/showfiles.php?group_id=13956 in source (tar ball and
-rpm) and pre-compiled binary (i386 rpm) form.
+rpm) and pre-compiled binary (i386 rpm and deb) form.
.SH SEE ALSO
.BR badblocks (8)
Index: mkntfs.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/mkntfs.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -U2 -r1.57 -r1.58
--- mkntfs.c 12 Mar 2002 00:34:35 -0000 1.57
+++ mkntfs.c 12 Mar 2002 21:48:27 -0000 1.58
@@ -128,5 +128,4 @@
char *buf2 = NULL;
int buf2_size = 0;
-char *EXEC_REVISION, *EXEC_VERSION;
int mft_bitmap_size, mft_bitmap_byte_size;
unsigned char *mft_bitmap = NULL;
@@ -191,4 +190,8 @@
char quick_format; /* -f or -Q, fast format, don't zero
the volume first. */
+ char enable_compression; /* -C, enables compression of all files
+ on the volume by default. */
+ char disable_indexing; /* -I, disables indexing of file
+ contents on the volume by default. */
/* -V, print version and exit. */
} opt;
@@ -2501,5 +2504,5 @@
void usage(void)
{
- fprintf(stderr, "Copyright (c) 2001 Anton Altaparmakov.\n"
+ fprintf(stderr, "Copyright (c) 2001,2002 Anton Altaparmakov.\n"
"Create an NTFS volume on a user specified (block) device.\n"
"%s is free software, released under the GNU General Public "
@@ -2510,5 +2513,5 @@
"directory.\nUsage: %s [-s sector-size] [-c cluster-size] "
"[-L volume-label]\n\t[-z mft-zone-multiplier] "
- "[-fnqvvFQV] device [number-of-sectors]\n",
+ "[-fnqvvCFIQV] device [number-of-sectors]\n",
EXEC_NAME, EXEC_NAME, EXEC_NAME);
exit(1);
@@ -2526,5 +2529,5 @@
if (argc && *argv)
EXEC_NAME = *argv;
- fprintf(stderr, "%s v%s\n", EXEC_NAME, EXEC_VERSION);
+ fprintf(stderr, "%s v%s\n", EXEC_NAME, VERSION);
while ((c = getopt(argc, argv, "c:fnqs:vz:FL:QV")) != EOF)
switch (c) {
@@ -2560,14 +2563,18 @@
opt.mft_zone_multiplier = l;
break;
+ case 'C':
+ opt.compress = 1;
+ break;
case 'F':
opt.force = 1;
break;
+ case 'I':
+ opt.disable_indexing = 1;
+ break;
case 'L':
opt.volume_label = optarg;
break;
case 'V':
- /* Print version number and exit. */
- printf("\tUsing Linux-NTFS Library version %s\n",
- VERSION);
+ /* Version number already printed, so just exit. */
exit(0);
default:
@@ -2626,5 +2633,4 @@
if (opt.upcase)
free(opt.upcase);
- free(EXEC_REVISION);
flk.l_type = F_UNLCK;
err = fcntl(f, F_SETLK, &flk);
@@ -2697,5 +2703,5 @@
int main(int argc, char **argv)
{
- const char *OK="OK";
+ const char *OK = "OK";
const char *FAILED = "FAILED";
int i, j, err;
@@ -2710,7 +2716,4 @@
NTFS_BOOT_SECTOR *bs;
- EXEC_REVISION = strdup("$Revision$");
- EXEC_VERSION = EXEC_REVISION + 11;
- EXEC_VERSION[strlen(EXEC_VERSION) - 2] = '\0';
/* Initialize the random number generator with the current time. */
srandom(time(NULL));
@@ -2864,5 +2867,15 @@
"larger cluster sizes yet.)\n");
Dprintf("cluster size = %i bytes\n", opt.cluster_size);
- if (opt.cluster_size > 4096)
+ if (opt.cluster_size > 4096) {
+ if (opt.enable_compression) {
+ if (!opt.force)
+ err_exit("Error: cluster_size is above 4096 "
+ "bytes and compression is "
+ "requested. This is not "
+ "possible due to limitations "
+ "in the compression algorithm "
+ "used by Windows.\n");
+ opt.enable_compression = 0;
+ }
Qprintf("Warning: compression will be disabled on this volume "
"because it is not\nsupported when the cluster "
@@ -2870,4 +2883,5 @@
"limitations in the compression algorithm used "
"by Windows.\n");
+ }
/* If user didn't specify the number of clusters, determine it now. */
if (!opt.nr_clusters)
@@ -3199,8 +3213,17 @@
*/
for (i = 0; i < 16; i++) {
+ u32 file_attrs;
+
m = (MFT_RECORD*)(buf + i * opt.mft_record_size);
m->flags |= MFT_RECORD_IN_USE;
ntfs_set_bit(mft_bitmap, 0LL + i, 1);
- add_attr_std_info(m, FILE_ATTR_HIDDEN | FILE_ATTR_SYSTEM);
+ file_attrs = FILE_ATTR_HIDDEN | FILE_ATTR_SYSTEM;
+ if (i == FILE_$root) {
+ if (opt.disable_indexing)
+ file_attrs |= FILE_ATTR_NOT_CONTENT_INDEXED;
+ if (opt.enable_compression)
+ file_attrs |= FILE_ATTR_COMPRESSED;
+ }
+ add_attr_std_info(m, file_attrs);
// dump_mft_record(m);
}
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsfix.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -U2 -r1.19 -r1.20
--- ntfsfix.c 26 Jan 2002 02:22:05 -0000 1.19
+++ ntfsfix.c 12 Mar 2002 21:48:27 -0000 1.20
@@ -4,5 +4,5 @@
* NtfsFix - Part of the Linux-NTFS project.
*
- * Copyright (c) 2000,2001 Anton Altaparmakov.
+ * Copyright (c) 2000-2002 Anton Altaparmakov.
*
* This utility will attempt to fix a partition that has been damaged by the
@@ -63,8 +63,6 @@
int main(int argc, char **argv)
{
- const char *EXEC_NAME = "NtfsFix";
const char *OK = "OK";
const char *FAILED = "FAILED";
- char *EXEC_REVISION, *EXEC_VERSION;
unsigned char *b1 = NULL;
unsigned char *b2 = NULL;
@@ -79,7 +77,4 @@
MFT_REF mref;
- EXEC_REVISION = strdup("$Revision$");
- EXEC_VERSION = EXEC_REVISION + 11;
- EXEC_VERSION[strlen(EXEC_VERSION) - 2] = '\0';
printf("\n");
if (argc != 2) {
@@ -105,7 +100,6 @@
"Syntax: ntfsfix partition_or_file_name\n"
" e.g. ntfsfix /dev/hda6\n\n", EXEC_NAME,
- EXEC_VERSION, EXEC_NAME, EXEC_NAME);
+ VERSION, EXEC_NAME, EXEC_NAME);
fprintf(stderr, "Error: incorrect syntax\n");
- free(EXEC_REVISION);
exit(1);
}
@@ -113,5 +107,4 @@
if (!vol) {
perror("ntfs_mount() failed");
- free(EXEC_REVISION);
exit(1);
}
@@ -434,5 +427,4 @@
if (vol)
ntfs_umount(vol, 0);
- free(EXEC_REVISION);
return i;
error_exit:
|