Changes by: szaka
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19096/libntfs
Modified Files:
attrib.c dir.c index.c inode.c tree.c
Log Message:
NTFS_INDEX_ prefix $I30, $SII, $SDH, $O and $Q indexes
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -p -r1.186 -r1.187
--- attrib.c 21 Oct 2005 18:05:13 -0000 1.186
+++ attrib.c 23 Oct 2005 18:35:58 -0000 1.187
@@ -349,7 +349,7 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni
na = calloc(sizeof(ntfs_attr), 1);
if (!na)
return NULL;
- if (name && name != AT_UNNAMED && name != I30) {
+ if (name && name != AT_UNNAMED && name != NTFS_INDEX_I30) {
name = ntfs_ucsndup(name, name_len);
if (!name) {
err = errno;
@@ -427,7 +427,7 @@ void ntfs_attr_close(ntfs_attr *na)
if (NAttrNonResident(na) && na->rl)
free(na->rl);
/* Don't release if using an internal constant. */
- if (na->name != AT_UNNAMED && na->name != I30)
+ if (na->name != AT_UNNAMED && na->name != NTFS_INDEX_I30)
free(na->name);
free(na);
}
Index: dir.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/dir.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -p -r1.31 -r1.32
--- dir.c 21 Oct 2005 18:05:13 -0000 1.31
+++ dir.c 23 Oct 2005 18:35:58 -0000 1.32
@@ -51,18 +51,18 @@
* The little endian Unicode strings "$I30", "$SII", "$SDH", "$O"
* and "$Q" as global constants.
*/
-ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
+ntfschar NTFS_INDEX_I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
const_cpu_to_le16('3'), const_cpu_to_le16('0'),
const_cpu_to_le16('\0') };
-ntfschar SII[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'),
+ntfschar NTFS_INDEX_SII[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'),
const_cpu_to_le16('I'), const_cpu_to_le16('I'),
const_cpu_to_le16('\0') };
-ntfschar SDH[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'),
+ntfschar NTFS_INDEX_SDH[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'),
const_cpu_to_le16('D'), const_cpu_to_le16('H'),
const_cpu_to_le16('\0') };
-ntfschar O[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('O'),
+ntfschar NTFS_INDEX_O[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('O'),
const_cpu_to_le16('\0') };
-ntfschar Q[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('Q'),
+ntfschar NTFS_INDEX_Q[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('Q'),
const_cpu_to_le16('\0') };
/**
@@ -117,7 +117,7 @@ u64 ntfs_inode_lookup_by_name(ntfs_inode
return -1;
/* Find the index root attribute in the mft record. */
- if (ntfs_attr_lookup(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, 0, NULL,
+ if (ntfs_attr_lookup(AT_INDEX_ROOT, NTFS_INDEX_I30, 4, CASE_SENSITIVE, 0, NULL,
0, ctx)) {
ntfs_log_perror("Index root attribute missing in directory inode "
"0x%llx", (unsigned long long)dir_ni->mft_no);
@@ -252,7 +252,7 @@ found_it:
} /* Child node present, descend into it. */
/* Open the index allocation attribute. */
- ia_na = ntfs_attr_open(dir_ni, AT_INDEX_ALLOCATION, I30, 4);
+ ia_na = ntfs_attr_open(dir_ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4);
if (!ia_na) {
ntfs_log_perror("Failed to open index allocation attribute. Directory "
"inode 0x%llx is corrupt or driver bug",
@@ -757,7 +757,7 @@ int ntfs_readdir(ntfs_inode *dir_ni, s64
(unsigned long long)dir_ni->mft_no, (long long)*pos);
/* Open the index allocation attribute. */
- ia_na = ntfs_attr_open(dir_ni, AT_INDEX_ALLOCATION, I30, 4);
+ ia_na = ntfs_attr_open(dir_ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4);
if (!ia_na) {
if (errno != ENOENT) {
ntfs_log_perror("Failed to open index allocation attribute. "
@@ -808,7 +808,7 @@ int ntfs_readdir(ntfs_inode *dir_ni, s64
/* Get the offset into the index root attribute. */
ir_pos = (int)*pos;
/* Find the index root attribute in the mft record. */
- if (ntfs_attr_lookup(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, 0, NULL,
+ if (ntfs_attr_lookup(AT_INDEX_ROOT, NTFS_INDEX_I30, 4, CASE_SENSITIVE, 0, NULL,
0, ctx)) {
ntfs_log_debug("Index root attribute missing in directory inode "
"0x%llx.\n", (unsigned long long)dir_ni->mft_no);
@@ -899,7 +899,7 @@ skip_index_root:
goto err_out;
}
- bmp_na = ntfs_attr_open(dir_ni, AT_BITMAP, I30, 4);
+ bmp_na = ntfs_attr_open(dir_ni, AT_BITMAP, NTFS_INDEX_I30, 4);
if (!bmp_na) {
ntfs_log_perror("Failed to open index bitmap attribute");
goto dir_err_out;
@@ -1153,7 +1153,7 @@ ntfs_inode *ntfs_create(ntfs_inode *dir_
ie->key_length = 0;
ie->flags = INDEX_ENTRY_END;
/* Add INDEX_ROOT attribute to inode. */
- if (ntfs_attr_add(ni, AT_INDEX_ROOT, I30, 4, (u8*)ir, ir_len)) {
+ if (ntfs_attr_add(ni, AT_INDEX_ROOT, NTFS_INDEX_I30, 4, (u8*)ir, ir_len)) {
err = errno;
free(ir);
ntfs_log_error("Failed to add INDEX_ROOT attribute.");
@@ -1254,7 +1254,7 @@ int ntfs_delete(ntfs_inode *ni, ntfs_ino
if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) {
ntfs_attr *na;
- na = ntfs_attr_open(ni, AT_INDEX_ROOT, I30, 4);
+ na = ntfs_attr_open(ni, AT_INDEX_ROOT, NTFS_INDEX_I30, 4);
if (!na) {
ntfs_log_error("Corrupt directory or library bug.");
errno = EIO;
@@ -1317,7 +1317,7 @@ search:
if (errno)
goto err_out;
/* Search for such FILE_NAME in index. */
- ictx = ntfs_index_ctx_get(dir_ni, I30, 4);
+ ictx = ntfs_index_ctx_get(dir_ni, NTFS_INDEX_I30, 4);
if (!ictx)
goto err_out;
if (ntfs_index_lookup(fn, le32_to_cpu(actx->attr->value_length), ictx))
@@ -1471,7 +1471,7 @@ int ntfs_link(ntfs_inode *ni, ntfs_inode
err = errno;
ntfs_log_error("Failed to add FILE_NAME attribute.");
/* Try to remove just added attribute from index. */
- ictx = ntfs_index_ctx_get(dir_ni, I30, 4);
+ ictx = ntfs_index_ctx_get(dir_ni, NTFS_INDEX_I30, 4);
if (!ictx)
goto rollback_failed;
if (ntfs_index_lookup(fn, fn_len, ictx)) {
@@ -1787,8 +1787,8 @@ struct ntfs_dir * ntfs_dir_create(ntfs_v
}
dir->inode = inode;
- dir->iroot = ntfs_attr_open(inode, AT_INDEX_ROOT, I30, 4);
- dir->ialloc = ntfs_attr_open(inode, AT_INDEX_ALLOCATION, I30, 4);
+ dir->iroot = ntfs_attr_open(inode, AT_INDEX_ROOT, NTFS_INDEX_I30, 4);
+ dir->ialloc = ntfs_attr_open(inode, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4);
if (!dir->iroot) {
ntfs_dir_free(dir);
@@ -1805,7 +1805,7 @@ struct ntfs_dir * ntfs_dir_create(ntfs_v
dir->mft_num = mft_num;
// This may not exist
- dir->bitmap = ntfs_bmp_create(inode, AT_BITMAP, I30, 4);
+ dir->bitmap = ntfs_bmp_create(inode, AT_BITMAP, NTFS_INDEX_I30, 4);
if (dir->iroot) {
rec = find_first_attribute(AT_INDEX_ROOT, inode->mrec);
Index: index.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/index.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- index.c 21 Oct 2005 18:05:13 -0000 1.16
+++ index.c 23 Oct 2005 18:35:58 -0000 1.17
@@ -477,7 +477,7 @@ int ntfs_index_add_filename(ntfs_inode *
errno = EINVAL;
return -1;
}
- ictx = ntfs_index_ctx_get(ni, I30, 4);
+ ictx = ntfs_index_ctx_get(ni, NTFS_INDEX_I30, 4);
if (!ictx)
return -1;
fn_size = (fn->file_name_length * sizeof(ntfschar)) +
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/inode.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -p -r1.70 -r1.71
--- inode.c 21 Oct 2005 18:05:13 -0000 1.70
+++ inode.c 23 Oct 2005 18:35:58 -0000 1.71
@@ -530,7 +530,7 @@ static int ntfs_inode_sync_file_name(ntf
ntfs_log_trace("Failed to open inode with index.\n");
continue;
}
- ictx = ntfs_index_ctx_get(index_ni, I30, 4);
+ ictx = ntfs_index_ctx_get(index_ni, NTFS_INDEX_I30, 4);
if (!ictx) {
if (!err)
err = errno;
Index: tree.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/tree.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- tree.c 21 Oct 2005 18:05:13 -0000 1.2
+++ tree.c 23 Oct 2005 18:35:58 -0000 1.3
@@ -1422,7 +1422,7 @@ int ntfs_dt_root_replace(struct ntfs_dt
del->header->index_length += len;
del->header->allocated_size += len;
- ntfs_mft_resize_resident(del->dir->inode, AT_INDEX_ROOT, I30, 4, del->data, del->data_len);
+ ntfs_mft_resize_resident(del->dir->inode, AT_INDEX_ROOT, NTFS_INDEX_I30, 4, del->data, del->data_len);
//utils_dump_mem(attr, 0, del->data_len, DM_DEFAULTS);
@@ -1573,7 +1573,7 @@ BOOL ntfs_dt_root_remove(struct ntfs_dt
del->header->index_length = del->data_len - 16;
del->header->allocated_size = del->data_len - 16;
- ntfs_mft_resize_resident(del->dir->inode, AT_INDEX_ROOT, I30, 4, del->data, del->data_len);
+ ntfs_mft_resize_resident(del->dir->inode, AT_INDEX_ROOT, NTFS_INDEX_I30, 4, del->data, del->data_len);
old = del->data;
del->data = realloc(del->data, del->data_len);
del->header = (INDEX_HEADER*) (del->data + 0x10);
@@ -1908,7 +1908,7 @@ int ntfs_dt_root_add(struct ntfs_dt *par
//utils_dump_mem(parent->data, 0, parent->data_len, DM_DEFAULTS);
ntfs_log_debug("\n");
- ntfs_mft_resize_resident(parent->dir->inode, AT_INDEX_ROOT, I30, 4, parent->data, parent->data_len);
+ ntfs_mft_resize_resident(parent->dir->inode, AT_INDEX_ROOT, NTFS_INDEX_I30, 4, parent->data, parent->data_len);
//realloc children, sub_nodes
ntfs_dt_create_children2(parent, parent->child_count + 1);
|