Changes by: szaka
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29649/libntfs
Modified Files:
attrib.c bitmap.c inode.c lcnalloc.c
Log Message:
Add some important debugging, tracing info
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -p -r1.202 -r1.203
--- attrib.c 18 Dec 2005 16:27:20 -0000 1.202
+++ attrib.c 9 Feb 2006 21:40:00 -0000 1.203
@@ -629,6 +629,9 @@ LCN ntfs_attr_vcn_to_lcn(ntfs_attr *na,
if (!na || !NAttrNonResident(na) || vcn < 0)
return (LCN)LCN_EINVAL;
+
+ ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
+ long)na->ni->mft_no, na->type);
retry:
/* Convert vcn to lcn. If that fails map the runlist and retry once. */
lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn);
@@ -678,6 +681,10 @@ runlist_element *ntfs_attr_find_vcn(ntfs
errno = EINVAL;
return NULL;
}
+
+ ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn %llx\n",
+ (unsigned long long)na->ni->mft_no, na->type,
+ (long long)vcn);
retry:
rl = na->rl;
if (!rl)
@@ -1573,6 +1580,8 @@ static int ntfs_attr_find(const ATTR_TYP
ntfs_volume *vol;
ntfschar *upcase;
u32 upcase_len;
+
+ ntfs_log_trace("Entering.\n");
if (ctx->ntfs_ino) {
vol = ctx->ntfs_ino->vol;
@@ -3250,6 +3259,8 @@ int ntfs_attr_record_resize(MFT_RECORD *
int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a,
const u32 new_size)
{
+ ntfs_log_trace("Entering for new size %u.\n", (unsigned)new_size);
+
/*
* Check that the attribute name hasn't been placed after the
* attribute value. Chkdsk treat this as corruption.
@@ -3498,6 +3509,9 @@ static int ntfs_attr_make_non_resident(n
runlist *rl;
int mp_size, mp_ofs, name_ofs, arec_size, err;
+ ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
+ long)na->ni->mft_no, na->type);
+
/* Some preliminary sanity checking. */
if (NAttrNonResident(na)) {
ntfs_log_trace("Eeek! Trying to make non-resident attribute "
@@ -3679,6 +3693,7 @@ static int ntfs_resident_attr_resize(ntf
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
long)na->ni->mft_no, na->type);
+
/* Get the attribute record that needs modification. */
ctx = ntfs_attr_get_search_ctx(na->ni, NULL);
if (!ctx)
@@ -3894,6 +3909,9 @@ static int ntfs_attr_make_resident(ntfs_
ATTR_REC *a = ctx->attr;
int name_ofs, val_ofs, err = EIO;
s64 arec_size, bytes_read;
+
+ ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
+ long)na->ni->mft_no, na->type);
/* Should be called for the first extent of the attribute. */
if (sle64_to_cpu(a->lowest_vcn)) {
@@ -4898,6 +4916,9 @@ int ntfs_attr_truncate(ntfs_attr *na, co
errno = EINVAL;
return -1;
}
+
+ ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
+ long)na->ni->mft_no, na->type);
if (na->data_size == newsize)
return 0;
Index: bitmap.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/bitmap.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -p -r1.20 -r1.21
--- bitmap.c 2 Feb 2006 14:40:53 -0000 1.20
+++ bitmap.c 9 Feb 2006 21:40:00 -0000 1.21
@@ -224,6 +224,9 @@ int ntfs_bitmap_set_run(ntfs_attr *na, s
*/
int ntfs_bitmap_clear_run(ntfs_attr *na, s64 start_bit, s64 count)
{
+ ntfs_log_trace("Dealloc from bit 0x%llx, count 0x%llx.\n",
+ (long long)start_bit, (long long)count);
+
return ntfs_bitmap_set_bits_in_run(na, start_bit, count, 0);
}
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/inode.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -p -r1.80 -r1.81
--- inode.c 18 Nov 2005 16:18:18 -0000 1.80
+++ inode.c 9 Feb 2006 21:40:00 -0000 1.81
@@ -252,6 +252,8 @@ int ntfs_inode_close(ntfs_inode *ni)
if (!ni)
return 0;
+ ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no);
+
/* If we have dirty metadata, write it out. */
if (NInoDirty(ni) || NInoAttrListDirty(ni)) {
if (ntfs_inode_sync(ni)) {
@@ -473,6 +475,8 @@ static int ntfs_inode_sync_standard_info
STANDARD_INFORMATION *std_info;
int err;
+ ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no);
+
ctx = ntfs_attr_get_search_ctx(ni, NULL);
if (!ctx)
return -1;
@@ -513,6 +517,8 @@ static int ntfs_inode_sync_file_name(ntf
FILE_NAME_ATTR *fn;
int err = 0;
+ ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no);
+
ctx = ntfs_attr_get_search_ctx(ni, NULL);
if (!ctx) {
err = errno;
Index: lcnalloc.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/lcnalloc.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -p -r1.33 -r1.34
--- lcnalloc.c 21 Oct 2005 18:05:13 -0000 1.33
+++ lcnalloc.c 9 Feb 2006 21:40:00 -0000 1.34
@@ -715,7 +715,13 @@ err_ret:
*/
int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl)
{
+ ntfs_log_trace("Entering.\n");
+
for (; rl->length; rl++) {
+
+ ntfs_log_trace("Dealloc lcn 0x%llx, len 0x%llx.\n",
+ (long long)rl->lcn, (long long)rl->length);
+
if (rl->lcn >= 0 && ntfs_bitmap_clear_run(vol->lcnbmp_na,
rl->lcn, rl->length)) {
int eo = errno;
@@ -754,7 +760,10 @@ int ntfs_cluster_free(ntfs_volume *vol,
errno = EINVAL;
return -1;
}
-
+ ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, count 0x%llx, "
+ "vcn 0x%llx.\n", (unsigned long long)na->ni->mft_no,
+ na->type, (long long)count, (long long)start_vcn);
+
rl = ntfs_attr_find_vcn(na, start_vcn);
if (!rl) {
if (errno == ENOENT)
|