Changes by: flatcap
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv15795/libntfs
Modified Files:
attrib.c
Log Message:
bugfix for the transplanted runlist functions
a few bits to help folding
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/attrib.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -U2 -r1.29 -r1.30
--- attrib.c 23 Apr 2002 11:11:36 -0000 1.29
+++ attrib.c 23 Apr 2002 16:10:48 -0000 1.30
@@ -1,3 +1,3 @@
-/*
+/**
* $Id$
*
@@ -34,4 +34,7 @@
/* FIXME: Need to write the new flags to disk. */
+/**
+ * set_ntfs_volume_flags
+ */
int set_ntfs_volume_flags(ntfs_volume *v, MFT_RECORD *b, const __u16 flags)
{
@@ -83,4 +86,7 @@
}
+/**
+ * get_attribute_value_length
+ */
__s64 get_attribute_value_length(const ATTR_RECORD *a)
{
@@ -98,4 +104,7 @@
}
+/**
+ * get_attribute_value
+ */
__s64 get_attribute_value(const ntfs_volume *vol, const MFT_RECORD *m,
const ATTR_RECORD *a, __u8 *b)
@@ -260,4 +269,7 @@
}
+/**
+ * set_attribute_value
+ */
int set_attribute_value(ntfs_volume *vol, ATTR_RECORD *a,
const __u8 *b, __s64 l)
@@ -362,5 +374,5 @@
/* Temporary helper functions -- might become macros */
-/*
+/**
* ntfs_rl_mm - run_list memmove
*/
@@ -372,5 +384,5 @@
}
-/*
+/**
* rl_mc - run_list memory copy
*/
@@ -382,5 +394,5 @@
}
-/*
+/**
* ntfs_rl_realloc - Reallocate memory for run_lists
* @rl: original run list
@@ -408,5 +420,5 @@
}
-/*
+/**
* ntfs_are_rl_mergeable - test if two run_lists can be joined together
* @one: original run_list
@@ -438,5 +450,5 @@
}
-/*
+/**
* __ntfs_rl_merge - merge two run lists without testing if they can be merged
* @dst: original, destination run list
@@ -453,5 +465,5 @@
}
-/*
+/**
* ntfs_rl_merge - test if two run lists can be joined together and merge them
* @dst: original, destination run list
@@ -476,5 +488,5 @@
}
-/*
+/**
* ntfs_rl_append - append a run list after a given element
* @dst: original run list to be worked on
@@ -538,9 +550,8 @@
dst[magic + 1].vcn = dst[magic].vcn + dst[magic].length;
- free(src);
return dst;
}
-/*
+/**
* ntfs_rl_insert - insert a run list into another
* @dst: original run list to be worked on
@@ -646,9 +657,8 @@
dst[magic - 1].length;
}
- free(src);
return dst;
}
-/*
+/**
* ntfs_rl_replace - overwrite a run_list element with another run list
* @dst: original run list to be worked on
@@ -711,9 +721,8 @@
if (dst[magic].lcn == LCN_ENOENT)
dst[magic].vcn = dst[magic - 1].vcn + dst[magic - 1].length;
- free(src);
return dst;
}
-/*
+/**
* ntfs_rl_split - insert a run list into the centre of a hole
* @dst: original run list to be worked on
@@ -762,5 +771,4 @@
dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn;
- free(src);
return dst;
}
@@ -924,5 +932,7 @@
drl = ntfs_rl_split(drl, ds, srl + sstart, ss, dins);
}
- if (!drl) {
+ if (drl) {
+ free (srl);
+ } else {
Dperror("Merge failed, returning error code");
return drl;
@@ -990,4 +1000,5 @@
/* The merge was completed successfully. */
Dputs("Merged run list:");
+ Dputs("res:");
ntfs_debug_dump_run_list(drl);
return drl;
@@ -1219,5 +1230,5 @@
/* If no existing run list was specified, we are done. */
if (!old_rl) {
- Dputs("Mapping pairs array successfully decompressedr:");
+ Dputs("Mapping pairs array successfully decompressed:");
ntfs_debug_dump_run_list(rl);
return rl;
@@ -1238,4 +1249,5 @@
}
+
// FIXME/TODO: Eeek! (AIA) Have to implement attribute open / close for this!
#if 0
@@ -1358,5 +1370,5 @@
}
-/*
+/**
* Internal function:
*
@@ -1535,5 +1547,5 @@
}
-/*
+/**
* Internal function:
*
@@ -1880,5 +1892,5 @@
}
-/*
+/**
* Internal function:
*
|