Changes by: flatcap
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv17019/ntfstools
Modified Files:
dumplog.c mkntfs.c ntfsdump_logfile.c ntfsfix.c ntfsinfo.c
ntfslabel.c ntfsresize.c sd.c
Log Message:
whitespace and include guards
Index: dumplog.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/dumplog.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -U2 -r1.9 -r1.10
--- dumplog.c 3 Jul 2002 21:56:01 -0000 1.9
+++ dumplog.c 11 Jul 2002 16:20:34 -0000 1.10
@@ -114,5 +114,5 @@
if (!is_rstr_recordp(lfd)) {
s64 _l;
-
+
for (_l = 0LL; _l < l; _l++)
if (lfd[_l] != (unsigned char)-1)
@@ -140,5 +140,5 @@
goto skip_rstr_pass;
}
- if (le16_to_cpu(rph->major_ver != 1) ||
+ if (le16_to_cpu(rph->major_ver != 1) ||
le16_to_cpu(rph->minor_ver != 1)) {
fprintf(stderr, "$LogFile version %i.%i! Error: Unknown "
@@ -170,5 +170,5 @@
printf("SeqNumberBits = %u (0x%x)\n", le32_to_cpu(rr->seq_number_bits),
le32_to_cpu(rr->seq_number_bits));
- printf("RestartAreaLength = 0x%x\n",
+ printf("RestartAreaLength = 0x%x\n",
le16_to_cpu(rr->restart_area_length));
printf("ClientArrayOffset = 0x%x\n",
@@ -179,10 +179,10 @@
le32_to_cpu(rr->last_lsn_data_length));
printf("RecordLength = 0x%x\n", le16_to_cpu(rr->record_length));
- printf("LogPageDataOffset = 0x%x\n",
+ printf("LogPageDataOffset = 0x%x\n",
le16_to_cpu(rr->log_page_data_offset));
for (client = 0; client < le16_to_cpu(rr->log_clients); client++) {
printf("\nRestart client record number %i:\n", client);
printf("OldestLsn = 0x%Lx\n", sle64_to_cpu(cr->oldest_lsn));
- printf("ClientRestartLsn = 0x%Lx\n",
+ printf("ClientRestartLsn = 0x%Lx\n",
sle64_to_cpu(cr->client_restart_lsn));
printf("PrevClient = %i\n", sle16_to_cpu(cr->prev_client));
Index: mkntfs.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/mkntfs.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -U2 -r1.79 -r1.80
--- mkntfs.c 9 Jul 2002 19:17:49 -0000 1.79
+++ mkntfs.c 11 Jul 2002 16:20:34 -0000 1.80
@@ -33,10 +33,10 @@
/*
- * WARNING: This program might not work on architectures which do not allow
- * unaligned access. For those, the program would need to start using
+ * WARNING: This program might not work on architectures which do not allow
+ * unaligned access. For those, the program would need to start using
* get/put_unaligned macros (#include <asm/unaligned.h>), but not doing it yet,
* since NTFS really mostly applies to ia32 only, which does allow unaligned
- * accesses. We might not actually have a problem though, since the structs are
- * defined as being packed so that might be enough for gcc to insert the
+ * accesses. We might not actually have a problem though, since the structs are
+ * defined as being packed so that might be enough for gcc to insert the
* correct code.
*
@@ -247,5 +247,5 @@
{
long long *new_buf;
-
+
if (!(opt.nr_bad_blocks & 15)) {
new_buf = realloc(opt.bad_blocks, (opt.nr_bad_blocks + 16) *
@@ -265,5 +265,5 @@
long long bytes_written, total;
int retry;
-
+
if (opt.no_action)
return count;
@@ -383,5 +383,5 @@
{
int i;
-
+
for (i = 0; i < maxlen; i++)
if (!s[i])
@@ -404,5 +404,5 @@
uchar_t u;
int i;
-
+
/* Need one byte for null terminator. */
maxlen--;
@@ -432,5 +432,5 @@
char c;
int i;
-
+
/* Need two bytes for null terminator. */
maxlen -= 2;
@@ -453,5 +453,5 @@
char *buf;
int i, j;
-
+
switch (type) {
case AT_STANDARD_INFORMATION:
@@ -592,5 +592,5 @@
{
int i;
-
+
i = le32_to_cpu(a->value_length);
printf("Attribute value length = %u (0x%x)\n", i, i);
@@ -619,5 +619,5 @@
s64 l;
int i;
-
+
l = sle64_to_cpu(a->lowest_vcn);
printf("Lowest VCN = %Li (0x%Lx)\n", l, l);
@@ -742,5 +742,5 @@
unsigned int u;
MFT_REF r;
-
+
printf("-- Beginning dump of mft record. --\n");
u = le32_to_cpu(m->magic);
@@ -787,5 +787,5 @@
{
ATTR_RECORD *a;
-
+
memset(m, 0, vol->mft_record_size);
m->magic = magic_FILE;
@@ -837,5 +837,5 @@
*
* @pos points to the attribute in front of which we want to make space.
- *
+ *
* Return 0 on success or -errno on error. Possible error codes are:
*
@@ -849,5 +849,5 @@
{
u32 biu;
-
+
if (!size)
return 0;
@@ -916,5 +916,5 @@
LCN j;
int i;
-
+
if (!rl)
return;
@@ -932,5 +932,5 @@
/*
* Allocate @clusters and create a run list of the allocated clusters.
- *
+ *
* Return the allocated run list. Caller has to free the run list when finished
* with it.
@@ -1178,5 +1178,5 @@
Eprintf("Error writing non-resident attribute value."
"\n");
- err = ntfs_build_mapping_pairs(vol, (s8*)a + hdr_size +
+ err = ntfs_build_mapping_pairs(vol, (s8*)a + hdr_size +
((name_len + 7) & ~7), mpa_size, rl);
}
@@ -1364,5 +1364,5 @@
Eprintf("Error writing non-resident attribute value."
"\n");
- err = ntfs_build_mapping_pairs(vol, (s8*)a + hdr_size +
+ err = ntfs_build_mapping_pairs(vol, (s8*)a + hdr_size +
((name_len + 7) & ~7), mpa_size, rl);
}
@@ -1606,5 +1606,5 @@
* Create the security descriptor attribute adding the security descriptor @sd
* of length @sd_len to the mft record @m.
- *
+ *
* Return 0 on success or -errno on error.
*/
@@ -1682,5 +1682,5 @@
}
-/*
+/*
* Create volume name attribute specifying the volume name @vol_name as a null
* terminated char string of length @vol_name_len (number of characters not
@@ -1688,5 +1688,5 @@
* endian uchar_t string. The name is at least 1 character long and at most
* 0xff characters long (not counting the terminating null).
- *
+ *
* Return 0 on success or -errno on error.
*/
@@ -1696,5 +1696,5 @@
uchar_t *uname;
int i, len;
-
+
if (vol_name_len) {
len = (vol_name_len + 1) * sizeof(uchar_t);
@@ -1879,5 +1879,5 @@
* attribute accordingly and move all of the index entries from the index root
* into the index allocation.
- *
+ *
* Return 0 on success or -errno on error.
*/
@@ -1895,5 +1895,5 @@
char *re_start, *re_end;
int i, err, index_block_size;
-
+
if (name_len) {
i = (name_len + 1) * sizeof(uchar_t);
@@ -1999,5 +1999,5 @@
r->index.allocated_size = r->index.index_length;
/* Resize index root attribute. */
- err = resize_resident_attribute_value(m, a, sizeof(INDEX_ROOT) -
+ err = resize_resident_attribute_value(m, a, sizeof(INDEX_ROOT) -
sizeof(INDEX_HEADER) +
le32_to_cpu(r->index.allocated_size));
@@ -2037,5 +2037,5 @@
/*
* Create space of @size bytes at position @pos inside the index block @index.
- *
+ *
* Return 0 on success or -errno on error.
*/
@@ -2044,5 +2044,5 @@
{
u32 biu;
-
+
if (!size)
return 0;
@@ -2089,5 +2089,5 @@
* the file with mft reference @file_ref into the index (allocation) block
* @index (which belongs to @file_ref's parent directory).
- *
+ *
* Return 0 on success or -errno on error.
*/
@@ -2098,5 +2098,5 @@
INDEX_ENTRY *ie;
char *index_end;
-
+
/*
* Lookup dir entry @file_name in dir @index to determine correct
@@ -2215,10 +2215,10 @@
* Create a file_name_attribute in the mft record @m_file which points to the
* parent directory with mft reference @ref_parent.
- *
+ *
* Then, insert an index entry with this file_name_attribute in the index
* block @index of the index allocation attribute of the parent directory.
*
* @ref_file is the mft reference of @m_file.
- *
+ *
* Return 0 on success or -errno on error.
*/
@@ -2611,5 +2611,5 @@
/* Acquire exlusive (mandatory) write lock on the whole device. */
memset(&flk, 0, sizeof(flk));
- if (opt.no_action)
+ if (opt.no_action)
flk.l_type = F_RDLCK;
else
Index: ntfsdump_logfile.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsdump_logfile.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -U2 -r1.26 -r1.27
--- ntfsdump_logfile.c 8 Jul 2002 23:27:17 -0000 1.26
+++ ntfsdump_logfile.c 11 Jul 2002 16:20:34 -0000 1.27
@@ -31,10 +31,10 @@
/*
- * WARNING: This program might not work on architectures which do not allow
- * unaligned access. For those, the program would need to start using
+ * WARNING: This program might not work on architectures which do not allow
+ * unaligned access. For those, the program would need to start using
* get/put_unaligned macros (#include <asm/unaligned.h>), but not doing it yet,
* since NTFS really mostly applies to ia32 only, which does allow unaligned
- * accesses. We might not actually have a problem though, since the structs are
- * defined as being packed so that might be enough for gcc to insert the
+ * accesses. We might not actually have a problem though, since the structs are
+ * defined as being packed so that might be enough for gcc to insert the
* correct code.
*
@@ -116,5 +116,5 @@
/* Fall through on error. */
default:
-version_error:
+version_error:
fprintf(stderr, "Error: Unknown NTFS version.\n");
goto error_exit;
@@ -164,5 +164,5 @@
if (!is_rstr_recordp(lfd)) {
s64 _l;
-
+
for (_l = 0LL; _l < l; _l++)
if (lfd[_l] != (unsigned char)-1)
@@ -190,5 +190,5 @@
goto skip_rstr_pass;
}
- if (le16_to_cpu(rph->major_ver != 1) ||
+ if (le16_to_cpu(rph->major_ver != 1) ||
le16_to_cpu(rph->minor_ver != 1)) {
fprintf(stderr, "$LogFile version %i.%i! Error: Unknown "
@@ -220,5 +220,5 @@
printf("SeqNumberBits = %u (0x%x)\n", le32_to_cpu(rr->seq_number_bits),
le32_to_cpu(rr->seq_number_bits));
- printf("RestartAreaLength = 0x%x\n",
+ printf("RestartAreaLength = 0x%x\n",
le16_to_cpu(rr->restart_area_length));
printf("ClientArrayOffset = 0x%x\n",
@@ -232,10 +232,10 @@
le32_to_cpu(rr->last_lsn_data_length));
printf("RecordLength = 0x%x\n", le16_to_cpu(rr->record_length));
- printf("LogPageDataOffset = 0x%x\n",
+ printf("LogPageDataOffset = 0x%x\n",
le16_to_cpu(rr->log_page_data_offset));
for (client = 0; client < le16_to_cpu(rr->log_clients); client++) {
printf("\nRestart client record number %i:\n", client);
printf("OldestLsn = 0x%Lx\n", sle64_to_cpu(cr->oldest_lsn));
- printf("ClientRestartLsn = 0x%Lx\n",
+ printf("ClientRestartLsn = 0x%Lx\n",
sle64_to_cpu(cr->client_restart_lsn));
printf("PrevClient = %i\n", sle16_to_cpu(cr->prev_client));
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsfix.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -U2 -r1.37 -r1.38
--- ntfsfix.c 8 Jul 2002 23:27:17 -0000 1.37
+++ ntfsfix.c 11 Jul 2002 16:20:34 -0000 1.38
@@ -32,10 +32,10 @@
/*
- * WARNING: This program might not work on architectures which do not allow
- * unaligned access. For those, the program would need to start using
+ * WARNING: This program might not work on architectures which do not allow
+ * unaligned access. For those, the program would need to start using
* get/put_unaligned macros (#include <asm/unaligned.h>), but not doing it yet,
* since NTFS really mostly applies to ia32 only, which does allow unaligned
- * accesses. We might not actually have a problem though, since the structs are
- * defined as being packed so that might be enough for gcc to insert the
+ * accesses. We might not actually have a problem though, since the structs are
+ * defined as being packed so that might be enough for gcc to insert the
* correct code.
*
@@ -134,5 +134,5 @@
goto error_exit;
}
-
+
puts("Processing $MFT and $MFTMirr.");
@@ -283,5 +283,5 @@
/* Fall through on error. */
default:
-version_error:
+version_error:
fprintf(stderr, "Error: Unknown NTFS version.\n");
goto error_exit;
@@ -383,5 +383,5 @@
* - return a copy of the attribute so the MFT_RECORD can be
* adjusted accordingly with changes in the length of the resident
- * part of the attribute by the caller.
+ * part of the attribute by the caller.
* For now, just assume that attribute length remains constant, since
* this is the case for the $LogFile zeroing out. */
@@ -410,9 +410,9 @@
using it for. */
}
-
+
/* FIXME: Should we be marking the quota out of date, too? */
/* That's all for now! */
- printf("NTFS partition %s was processed successfully.\n",
+ printf("NTFS partition %s was processed successfully.\n",
vol->dev_name);
/* Set return code to 0. */
Index: ntfsinfo.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsinfo.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -U2 -r1.12 -r1.13
--- ntfsinfo.c 8 Jul 2002 23:27:17 -0000 1.12
+++ ntfsinfo.c 11 Jul 2002 16:20:34 -0000 1.13
@@ -3,5 +3,5 @@
*
* ntfsinfo - Part of the Linux-NTFS project.
- *
+ *
* Copyright (c) 2002 Matthew J. Fanto
* Copyright (c) 2002 Anton Altaparmakov
@@ -100,29 +100,29 @@
ctx = ntfs_get_attr_search_ctx(inode, mrec);
-
+
// print_file_name_attr(ctx);
// ctx = ntfs_get_attr_search_ctx(inode, mrec); //need to fix this
-
+
print_standard_information_attr(ctx);
}
-
+
s64 ntfs2time(s64 time)
{
s64 t;
- printf("Original Time: %Li\n",time);
+ printf("Original Time: %Li\n",time);
t = time - NTFS_TIME_OFFSET;
t = t / 10000000;
return t;
-
+
}
-
+
void print_standard_information_attr(ntfs_attr_search_ctx *ctx)
{
ATTR_RECORD *attr = NULL;
STANDARD_INFORMATION *standard_information_attr = NULL;
-
+
if (ntfs_lookup_attr
(AT_STANDARD_INFORMATION, AT_NONAME, 0, 0, 0, NULL, 0, ctx)) {
@@ -136,5 +136,5 @@
(STANDARD_INFORMATION *) ((char *) attr +
le16_to_cpu(attr->value_offset));
-
+
printf("Creation time: %Li\n",
ntfs2time(standard_information_attr->creation_time));
@@ -173,5 +173,5 @@
attr = ctx->attr;
ctx = c;
-
+
file_name_attr =
(FILE_NAME_ATTR *) ((char *) attr +
Index: ntfslabel.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfslabel.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -U2 -r1.16 -r1.17
--- ntfslabel.c 8 Jul 2002 23:27:17 -0000 1.16
+++ ntfslabel.c 11 Jul 2002 16:20:34 -0000 1.17
@@ -3,5 +3,5 @@
*
* ntfslabel - Part of the Linux-NTFS project.
- *
+ *
* Copyright (c) 2002 Matthew J. Fanto
* Copyright (c) 2002 Anton Altaparmakov
Index: ntfsresize.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsresize.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -U2 -r1.8 -r1.9
--- ntfsresize.c 11 Jul 2002 12:49:48 -0000 1.8
+++ ntfsresize.c 11 Jul 2002 16:20:34 -0000 1.9
@@ -173,5 +173,5 @@
/* Needs to be multiple of 8 bytes */
bm_bsize = (bm_bsize + 7) & ~7;
- printf("Bitmap byte size : %lld (%lld clusters)\n",
+ printf("Bitmap byte size : %lld (%lld clusters)\n",
bm_bsize, rounded_up_division(bm_bsize, vol->cluster_size));
@@ -208,5 +208,5 @@
{
ntfs_attr_search_ctx *ctx;
-
+
if (!(ctx = ntfs_get_attr_search_ctx(NULL, mr)))
perr_exit("ntfs_get_attr_search_ctx");
@@ -238,8 +238,8 @@
/* FIXME: get_attribute_value_length() can't handle extents */
bm->size = get_attribute_value_length(ctx->attr);
-
+
if (!(bm->bm = (u8 *)malloc(bm->size)))
perr_exit("get_bitmap_data");
-
+
if (get_attribute_value(vol, ni->mrec, ctx->attr, bm->bm) != bm->size)
perr_exit("Couldn't get $Bitmap $DATA\n");
@@ -305,5 +305,5 @@
mref = (MFT_REF)inode;
if (ntfs_read_file_record(vol, mref, &mrec, NULL)) {
- /* FIXME: continue only if it make sense, e.g.
+ /* FIXME: continue only if it make sense, e.g.
MFT record not in use based on $MFT bitmap */
if (errno == EIO)
@@ -324,8 +324,8 @@
{
u64 i;
-
+
printf(NERR_PREFIX "Fragmented volume not yet supported. "
"Defragment it before resize.\n");
-
+
for (i = vol->nr_clusters - 1; i > 0; i--)
if (ntfs_get_bit(lcn_bitmap.bm, i))
@@ -350,5 +350,5 @@
if (rl[i].lcn != LCN_HOLE)
err_exit("Volume has bad sectors, not supported\n");
-
+
free(rl);
}
@@ -374,7 +374,7 @@
-/*
+/*
* FIXME: this function should go away and instead using a generalized
- * "truncate_bitmap_unnamed_attr()"
+ * "truncate_bitmap_unnamed_attr()"
*/
void truncate_badclust_bad_attr(ATTR_RECORD *a, s64 nr_clusters)
@@ -383,5 +383,5 @@
int mp_size;
char *mp;
-
+
if (!a->non_resident)
/* FIXME: handle resident attribute value */
@@ -390,5 +390,5 @@
if (!(rl_bad = (run_list *)malloc(2 * sizeof(run_list))))
perr_exit("Couldn't get memory");
-
+
rl_set(rl_bad, 0LL, (LCN)LCN_HOLE, nr_clusters);
rl_set(rl_bad + 1, nr_clusters, -1LL, 0LL);
@@ -410,5 +410,5 @@
free(mp);
}
-
+
void truncate_bitmap_unnamed_attr(ATTR_RECORD *a, s64 nr_clusters)
@@ -420,5 +420,5 @@
int trunc_at = -1; /* FIXME: -1 means unset */
char *mp;
-
+
if (!a->non_resident)
@@ -454,5 +454,5 @@
if (trunc_at != -1) {
- /* NOTE: 'i' always > 0 */
+ /* NOTE: 'i' always > 0 */
i = nr_bm_clusters - rl[trunc_at].vcn;
rl[trunc_at].length = i;
@@ -462,5 +462,5 @@
"new cluster length %d\n", trunc_at, i);
}
-
+
if (!opt.ro_flag) {
size = ntfs_rl_pwrite(vol, rl, 0, bm_bsize, lcn_bitmap.bm);
@@ -507,5 +507,5 @@
if (!(*ctx = ntfs_get_attr_search_ctx(ni, NULL)))
perr_exit("ntfs_get_attr_search_ctx");
-
+
if (aname && ((len = ntfs_mbstoucs(aname, &ustr, 0)) == -1))
perr_exit("Unable to convert string to Unicode");
@@ -536,5 +536,5 @@
{
ntfs_attr_search_ctx *ctx = NULL;
-
+
printf("Updating $BadClust file ...\n");
@@ -544,8 +544,8 @@
/* FIXME: should use an "extended" truncate_bitmap_unnamed_attr() */
truncate_badclust_bad_attr(ctx->attr, nr_clusters);
-
+
if (write_mft_record(ctx))
perr_exit("Couldn't update $BadClust");
-
+
/* FIXME: clean up API => ntfs_put_attr_search_ctx() also closes ni */
ntfs_put_attr_search_ctx(ctx);
@@ -556,5 +556,5 @@
{
ntfs_attr_search_ctx *ctx = NULL;
-
+
printf("Updating $Bitmap file ...\n");
@@ -565,5 +565,5 @@
if (write_mft_record(ctx))
perr_exit("Couldn't update $Bitmap");
-
+
ntfs_put_attr_search_ctx(ctx);
}
@@ -574,5 +574,5 @@
/* Determine lcn bitmap byte size and allocate it. */
lcn_bitmap.size = nr_clusters_to_bitmap_byte_size(vol->nr_clusters);
-
+
if (!(lcn_bitmap.bm = (unsigned char *)calloc(1, lcn_bitmap.size)))
perr_exit("Failed to allocate internal buffer");
@@ -586,5 +586,5 @@
{
NTFS_BOOT_SECTOR bs;
-
+
printf("Updating Boot record ...\n");
@@ -616,5 +616,5 @@
if (!(vol = ntfs_mount(opt.volume, opt.ro_flag)))
perr_exit("ntfs_mount failed");
-
+
if (vol->flags & VOLUME_IS_DIRTY)
if (!opt.force--)
@@ -626,5 +626,5 @@
setup_lcn_bitmap();
-
+
walk_inodes();
Index: sd.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/sd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -U2 -r1.5 -r1.6
--- sd.c 11 Jul 2002 13:18:12 -0000 1.5
+++ sd.c 11 Jul 2002 16:20:34 -0000 1.6
@@ -5,5 +5,5 @@
* NTFS 1.2 - System files security decriptors
* ===========================================
- *
+ *
* Create the security descriptor for system file number @sys_file_no and
* return a pointer to the descriptor.
@@ -56,5 +56,5 @@
sd->sacl = cpu_to_le32(0);
sd->dacl = cpu_to_le32(0x14);
- /*
+ /*
* Now at offset 0x14, as specified in the security descriptor, we have
* the DACL.
|