Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31568/libntfs
Modified Files:
attrib.c attrlist.c index.c
Log Message:
* Fix bug in index.c (see Changelog).
* Minor fixes to attr{ib,list}.c.
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -p -r1.167 -r1.168
--- attrib.c 6 Jul 2005 22:47:16 -0000 1.167
+++ attrib.c 23 Jul 2005 00:50:32 -0000 1.168
@@ -2858,8 +2858,8 @@ int ntfs_attr_record_rm(ntfs_attr_search
* @name_len: name length in unicode characters of the new attribute
* @size: size of the new attribute
*
- * If inode haven't got enough space to add attribute, add attribute to one of it
- * extents, if no extents present or no one of them have enough space, than
+ * If inode haven't got enough space to add attribute, add attribute to one of
+ * it extents, if no extents present or no one of them have enough space, than
* allocate new extent and add attribute to it.
*
* If on one of this steps attribute list is needed but not present, than it is
@@ -4792,20 +4792,7 @@ put_err_out:
* attribute is made bigger and the attribute is resident the newly
* "allocated" space is cleared and if the attribute is non-resident the
* newly allocated space is marked as not initialised and no real allocation
- * on disk is performed. FIXME: Do we have to create sparse runs or can we just
- * leave the runlist to finish below data_size, i.e. can we have
- * allocated_size < data_size? I guess that what we can't and thus we will have
- * to set the sparse bit of the attribute and create sparse runs to ensure that
- * allocated_size is >= data_size. We don't need to clear the partial run at
- * the end of the real allocation because we leave initialized_size low enough.
- * FIXME: Do we want that? Alternatively, we leave initialized_size = data_size
- * and do clear the partial run. The latter approach would be more inline with
- * what windows would do, even though windows wouldn't even make the attribute
- * sparse, it would just allocate clusters instead. TODO: Check what happens on
- * WinXP and 2003. FIXME: Make sure to check what NT4 does with an NTFS1.2
- * volume that has sparse files. I suspect it will blow up so we will need to
- * perform allocations of clusters, like NT4 would do for NTFS1.2 while we can
- * use sparse attributes on NTFS3.x.
+ * on disk is performed.
*
* On success return 0 and on error return -1 with errno set to the error code.
* The following error codes are defined:
Index: attrlist.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrlist.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- attrlist.c 6 Jul 2005 22:47:16 -0000 1.26
+++ attrlist.c 23 Jul 2005 00:50:33 -0000 1.27
@@ -92,6 +92,7 @@ int ntfs_attrlist_need(ntfs_inode *ni)
* EINVAL - Invalid arguments passed to function.
* ENOMEM - Not enough memory to allocate necessary buffers.
* EIO - I/O error occurred or damaged filesystem.
+ * EEXIST - Such attribute already present in attribute list.
*/
int ntfs_attrlist_entry_add(ntfs_inode *ni, ATTR_RECORD *attr)
{
@@ -159,7 +160,7 @@ int ntfs_attrlist_entry_add(ntfs_inode *
continue;
if (sle64_to_cpu(ale->lowest_vcn) ==
sle64_to_cpu(attr->lowest_vcn)) {
- err = EINVAL;
+ err = EEXIST;
Dprintf("%s(): Attribute with same type, name and "
"lowest vcn already present in attribute "
"list.\n", __FUNCTION__);
Index: index.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/index.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- index.c 6 Jul 2005 22:47:17 -0000 1.7
+++ index.c 23 Jul 2005 00:50:34 -0000 1.8
@@ -53,7 +53,7 @@ ntfs_index_context *ntfs_index_ctx_get(n
*ictx = (ntfs_index_context) {
.ni = ni,
.name = name,
- .name_len = name_len
+ .name_len = name_len,
};
return ictx;
}
@@ -88,7 +88,6 @@ void ntfs_index_ctx_put(ntfs_index_conte
}
}
free(ictx);
- return;
}
/**
@@ -202,6 +201,7 @@ ir_done:
ictx->is_in_root = TRUE;
ictx->actx = actx;
ictx->ia = NULL;
+ ictx->ir = ir;
done:
ictx->entry = ie;
ictx->data = (u8*)ie + offsetof(INDEX_ENTRY, key);
|