Changes by: yura
Update of /cvs/linux-ntfs/ntfsprogs/libntfs
In directory delta357.server4you.de:/tmp/cvs-serv19627/libntfs
Modified Files:
index.c
Log Message:
Merge index code from ntfs-3g. Clean it a bit and fix adding index allocation when index root in the base mft record.
Index: index.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/libntfs/index.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -p -r1.28 -r1.29
--- index.c 17 Jul 2006 11:49:52 -0000 1.28
+++ index.c 2 Aug 2006 03:55:41 -0000 1.29
@@ -2,8 +2,9 @@
* index.c - NTFS index handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2004-2005 Anton Altaparmakov
- * Copyright (c) 2005 Yura Pakhuchiy
* Copyright (c) 2004-2005 Richard Russon
+ * Copyright (c) 2005-2006 Yura Pakhuchiy
+ * Copyright (c) 2005-2006 Szabolcs Szakacsits
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -42,6 +43,44 @@
[...2190 lines suppressed...]
+ if (!ntfs_ir_lookup(ni, name, attr->name_length, &ctx))
return NULL;
- }
- if (ntfs_attr_lookup(AT_INDEX_ROOT, name, attr->name_length, 0, 0, NULL,
- 0, ctx)) {
- ntfs_log_perror("ntfs_attr_lookup failed");
+ root = ntfs_malloc(sizeof(INDEX_ROOT));
+ if (!root)
goto out;
- }
-
- root = malloc(sizeof(INDEX_ROOT));
- if (!root) {
- ntfs_log_perror("malloc failed");
- goto out;
- }
*root = *((INDEX_ROOT *)((u8 *)ctx->attr +
le16_to_cpu(ctx->attr->value_offset)));
|