Changes by: antona
Update of /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs
In directory usw-pr-cvs1:/tmp/cvs-serv3888/linux/fs/ntfs
Modified Files:
aops.c attrib.c attrib.h dir.c inode.c super.c
Log Message:
More attribute list work, cleanups, bug fixes.
Index: aops.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs/aops.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -U2 -r1.50 -r1.51
--- aops.c 8 Feb 2002 05:17:11 -0000 1.50
+++ aops.c 10 Feb 2002 02:22:58 -0000 1.51
@@ -220,5 +220,5 @@
/* Find the data attribute in the mft record. */
- if (!lookup_attr(AT_DATA, NULL, 0, 0, NULL, 0, 0, NULL, 0, ctx)) {
+ if (!lookup_attr(AT_DATA, NULL, 0, 0, 0, NULL, 0, ctx)) {
err = -ENOENT;
goto put_unm_dec_unl_err_out;
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs/attrib.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -U2 -r1.58 -r1.59
--- attrib.c 8 Feb 2002 02:53:55 -0000 1.58
+++ attrib.c 10 Feb 2002 02:22:58 -0000 1.59
@@ -1,4 +1,4 @@
/**
- * attrib.c - NTFS attributes operations. Part of the Linux-NTFS project.
+ * attrib.c - NTFS attribute operations. Part of the Linux-NTFS project.
*
* Copyright (c) 2001,2002 Anton Altaparmakov.
@@ -24,4 +24,5 @@
/* Temporary helper functions -- might become macros */
+
/**
* rl_mm - run_list memmove
@@ -485,4 +486,6 @@
}
+// TODO: I AM HERE (AIA)
+
/**
* decompress_mapping_pairs - convert mapping pairs array to run list
@@ -498,9 +501,4 @@
* longer valid.
*
- * FIXME: For now we take the conceptionally simplest approach of creating the
- * new run list disregarding the already existing one and then splicing the
- * two into one if that is possible (we check for overlap and discard the new
- * run list if overlap present and return error).
- *
* Check the return value for error with IS_ERR(ret_val). If this is FALSE,
* the function was successful, the return value is the new run list, and if
@@ -514,4 +512,9 @@
* -EINVAL Invalid parameters were passed in.
* -ERANGE The two run lists overlap.
+ *
+ * FIXME: For now we take the conceptionally simplest approach of creating the
+ * new run list disregarding the already existing one and then splicing the
+ * two into one if that is possible (we check for overlap and discard the new
+ * run list if overlap present and return error).
*/
run_list *decompress_mapping_pairs(const ntfs_volume *vol,
@@ -640,8 +643,10 @@
* can investigate it further!
*/
- if (unlikely(deltaxcn == (LCN)-1))
- ntfs_error(vol->sb, "lcn delta == -1");
- if (unlikely(lcn == (LCN)-1))
- ntfs_error(vol->sb, "lcn == -1");
+ if (vol->major_ver < 3) {
+ if (unlikely(deltaxcn == (LCN)-1))
+ ntfs_error(vol->sb, "lcn delta == -1");
+ if (unlikely(lcn == (LCN)-1))
+ ntfs_error(vol->sb, "lcn == -1");
+ }
#endif
/* Check lcn is not below -1. */
@@ -736,11 +741,11 @@
int map_run_list(ntfs_inode *ni, VCN vcn)
{
- run_list *rl;
attr_search_context *ctx;
MFT_RECORD *mrec;
- int err;
- ATTR_TYPES at;
+ run_list *rl;
const uchar_t *name;
u32 name_len;
+ ATTR_TYPES at;
+ int err;
ntfs_debug("Mapping run list part containing vcn 0x%Lx.\n",
@@ -768,6 +773,6 @@
/* Find the attribute in the mft record. */
- if (!lookup_attr(at, name, name_len, CASE_SENSITIVE, NULL, 0, vcn,
- NULL, 0, ctx)) {
+ if (!lookup_attr(at, name, name_len, CASE_SENSITIVE, vcn, NULL, 0,
+ ctx)) {
put_attr_search_ctx(ctx);
err = -ENOENT;
@@ -837,5 +842,5 @@
return (LCN)LCN_ENOENT;
- for (i = 0; likely(rl[i].length); i++)
+ for (i = 0; likely(rl[i].length); i++) {
if (unlikely(vcn < rl[i+1].vcn)) {
if (likely(rl[i].lcn >= (LCN)0))
@@ -843,4 +848,5 @@
return rl[i].lcn;
}
+ }
/*
* The terminator element is setup to the correct value, i.e. one of
@@ -859,10 +865,10 @@
* @name_len: attribute name length (only needed if @name present)
* @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present)
- * @upcase: unicode upcase table
- * @ucpase_len: length of upcase table in unicode characters
* @val: attribute value to find (optional, resident attributes only)
* @val_len: attribute value length
* @ctx: search context with mft record and attribute to search from
*
+ * You shouldn't need to call this function directly. Use lookup_attr() instead.
+ *
* find_attr() takes a search context @ctx as parameter and searches the mft
* record specified by @ctx->mrec, beginning at @ctx->attr, for an attribute of
@@ -875,7 +881,10 @@
* is FALSE, the search begins after @ctx->attr.
*
- * If @ic is IGNORE_CASE, the @name comparisson is not case sensitive and if it
- * is CASE_SENSITIVE, the comparison is case sensitive. When @name is present,
- * @name_len is the @name length in Unicode characters.
+ * If @ic is IGNORE_CASE, the @name comparisson is not case sensitive and
+ * @ctx->ntfs_ino must be set to the ntfs inode to which the mft record
+ * @ctx->mrec belongs. This is so we can get at the ntfs volume and hence at
+ * the upcase table. If @ic is CASE_SENSITIVE, the comparison is case
+ * sensitive. When @name is present, @name_len is the @name length in Unicode
+ * characters.
*
* If @name is not present (NULL), we assume that the unnamed attribute is
@@ -899,10 +908,21 @@
*/
BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
- const IGNORE_CASE_BOOL ic, const uchar_t *upcase,
- const u32 upcase_len, const u8 *val, const u32 val_len,
+ const IGNORE_CASE_BOOL ic, const u8 *val, const u32 val_len,
attr_search_context *ctx)
{
ATTR_RECORD *a;
+ ntfs_volume *vol;
+ uchar_t *upcase;
+ u32 upcase_len;
+ if (ic == IGNORE_CASE) {
+ vol = ctx->ntfs_ino->vol;
+ upcase = vol->upcase;
+ upcase_len = vol->upcase_len;
+ } else {
+ vol = NULL;
+ upcase = NULL;
+ upcase_len = 0;
+ }
/*
* Iterate over attributes in mft record starting at @ctx->attr, or the
@@ -913,8 +933,8 @@
ctx->is_first = FALSE;
} else
- a = (ATTR_RECORD*)((char*)ctx->attr +
+ a = (ATTR_RECORD*)((u8*)ctx->attr +
le32_to_cpu(ctx->attr->length));
- for (;; a = (ATTR_RECORD*)((char*)a + le32_to_cpu(a->length))) {
- if ((char*)a < (char*)ctx->mrec || (char*)a > (char*)ctx->mrec +
+ for (;; a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))) {
+ if ((u8*)a < (u8*)ctx->mrec || (u8*)a > (u8*)ctx->mrec +
le32_to_cpu(ctx->mrec->bytes_allocated))
break;
@@ -936,10 +956,10 @@
return FALSE;
} else if (!ntfs_are_names_equal(name, name_len,
- (uchar_t*)((char*)a + le16_to_cpu(a->name_offset)),
+ (uchar_t*)((u8*)a + le16_to_cpu(a->name_offset)),
a->name_length, ic, upcase, upcase_len)) {
register int rc;
rc = ntfs_collate_names(name, name_len,
- (uchar_t*)((char*)a +
+ (uchar_t*)((u8*)a +
le16_to_cpu(a->name_offset)),
a->name_length, 1, IGNORE_CASE,
@@ -955,5 +975,5 @@
continue;
rc = ntfs_collate_names(name, name_len,
- (uchar_t*)((char*)a +
+ (uchar_t*)((u8*)a +
le16_to_cpu(a->name_offset)),
a->name_length, 1, CASE_SENSITIVE,
@@ -975,5 +995,5 @@
register int rc;
- rc = memcmp(val, (char*)a +le16_to_cpu(a->value_offset),
+ rc = memcmp(val, (u8*)a +le16_to_cpu(a->value_offset),
min(val_len, le32_to_cpu(a->value_length)));
/*
@@ -997,5 +1017,13 @@
/**
- * load_attribute_list -
+ * load_attribute_list - load an attribute list into memory
+ * @vol: ntfs volume from which to read
+ * @rl: run list of the attribute list
+ * @al: destination buffer
+ * @size: size of the destination buffer in bytes
+ *
+ * Walk the run list @rl and load all clusters from it copying them into the
+ * linear buffer @al. The maximum number of bytes copied to @al is @size bytes.
+ * Note, @size does not need to be a multiple of the cluster size.
*
* Return 0 on success or -errno on error.
@@ -1022,6 +1050,9 @@
(long long)rl->vcn, (long long)lcn);
/* The attribute list cannot be sparse. */
- if (lcn < 0)
- goto rl_err;
+ if (lcn < 0) {
+ ntfs_error(sb, "vcn_to_lcn() failed. Cannot read "
+ "attribute list.");
+ return -EIO;;
+ }
block = lcn << vol->cluster_size_bits >> block_size_bits;
/* Read the run from device in chunks of block_size bytes. */
@@ -1058,5 +1089,6 @@
return 0;
}
- }
+ } else
+ brelse(bh);
/* Real overflow! */
ntfs_error(sb, "Attribute list buffer overflow. Read attribute list "
@@ -1064,7 +1096,4 @@
err_out:
return -EIO;
-rl_err:
- ntfs_error(sb, "vcn_to_lcn() failed. Cannot read attribute list.");
- goto err_out;
bread_err:
ntfs_error(sb, "sb_bread() failed. Cannot read attribute list.");
@@ -1073,5 +1102,15 @@
/**
- * find_external_attr -
+ * find_external_attr - find an attribute in the attribute list of an ntfs inode
+ * @type: attribute type to find
+ * @name: attribute name to find (optional, i.e. NULL means don't care)
+ * @name_len: attribute name length (only needed if @name present)
+ * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present)
+ * @lowest_vcn: lowest vcn to find (optional, non-resident attributes only)
+ * @val: attribute value to find (optional, resident attributes only)
+ * @val_len: attribute value length
+ * @ctx: search context with mft record and attribute to search from
+ *
+ * You shouldn't need to call this function directly. Use lookup_attr() instead.
*
* Find an attribute by searching the attribute list for the corresponding
@@ -1080,11 +1119,22 @@
* in there and return it.
*
- * NOTE: ctx->ntfs_ino must be the base inode on first call. On subsequent
- * calls it can be any extended inode, too (ctx->base_ntfs_ino is then the
+ * On first search @ctx->ntfs_ino must be the base mft record and @ctx must
+ * have been obtained from a call to get_attr_search_ctx(). On subsequent calls
+ * @ctx->ntfs_ino can be any extent inode, too (@ctx->base_ntfs_ino is then the
* base inode).
*
- * TODO: Flesh out the above description for this important function...
+ * After finishing with the attribute/mft record you need to call
+ * release_attr_search_ctx() to cleanup the search context (unmapping any
+ * mapped inodes, etc).
+ *
+ * Return TRUE if the search was successful and FALSE if not. When TRUE,
+ * @ctx->attr is the found attribute and it is in mft record @ctx->mrec. When
+ * FALSE, @ctx->attr is the attribute which collates just after the attribute
+ * being searched for in the base ntfs inode, i.e. if one wants to add the
+ * attribute to the mft record this is the correct place to insert it into
+ * and if there is not enough space, the attribute should be placed in an
+ * extent mft record.
*/
-BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
+static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
const u32 name_len, const IGNORE_CASE_BOOL ic,
const VCN lowest_vcn, const u8 *val, const u32 val_len,
@@ -1311,7 +1361,4 @@
return FALSE;
not_found:
- /* Not found, cleanup current mapping if any and not the base. */
- if (ni != base_ni)
- unmap_extent_mft_record(ni);
/*
* Seek to the end of the base mft record, i.e. when we return false,
@@ -1323,10 +1370,6 @@
* FIXME: Do we really want to do this here? Think about it... (AIA)
*/
- ctx->ntfs_ino = base_ni;
- ctx->mrec = ctx->base_mrec;
- ctx->attr = ctx->base_attr;
- ctx->is_first = TRUE;
- find_attr(type, name, name_len, ic, vol->upcase, vol->upcase_len, val,
- val_len, ctx);
+ reinit_attr_search_ctx(ctx);
+ find_attr(type, name, name_len, ic, val, val_len, ctx);
ntfs_debug("Done, not found.\n");
return FALSE;
@@ -1334,5 +1377,57 @@
/**
- * init_attr_search_ctx -
+ * lookup_attr - find an attribute in an ntfs inode
+ * @type: attribute type to find
+ * @name: attribute name to find (optional, i.e. NULL means don't care)
+ * @name_len: attribute name length (only needed if @name present)
+ * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present)
+ * @lowest_vcn: lowest vcn to find (optional, non-resident attributes only)
+ * @val: attribute value to find (optional, resident attributes only)
+ * @val_len: attribute value length
+ * @ctx: search context with mft record and attribute to search from
+ *
+ * Find an attribute in an ntfs inode. On first search @ctx->ntfs_ino must
+ * be the base mft record and @ctx must have been obtained from a call to
+ * get_attr_search_ctx().
+ *
+ * This function transparently handles attribute lists and @ctx is used to
+ * continue searches where they were left off at.
+ *
+ * After finishing with the attribute/mft record you need to call
+ * release_attr_search_ctx() to cleanup the search context (unmapping any
+ * mapped inodes, etc).
+ *
+ * Return TRUE if the search was successful and FALSE if not. When TRUE,
+ * @ctx->attr is the found attribute and it is in mft record @ctx->mrec. When
+ * FALSE, @ctx->attr is the attribute which collates just after the attribute
+ * being searched for, i.e. if one wants to add the attribute to the mft
+ * record this is the correct place to insert it into.
+ */
+BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
+ const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
+ const u32 val_len, attr_search_context *ctx)
+{
+ ntfs_inode *base_ni;
+
+ ntfs_debug("Entering.\n");
+ if (ctx->base_ntfs_ino)
+ base_ni = ctx->base_ntfs_ino;
+ else
+ base_ni = ctx->ntfs_ino;
+ /* Sanity check, just for debugging really. */
+ BUG_ON(!base_ni);
+ if (NInoAttrList(base_ni))
+ return find_attr(type, name, name_len, ic, val, val_len, ctx);
+ return find_external_attr(type, name, name_len, ic, lowest_vcn, val,
+ val_len, ctx);
+}
+
+/**
+ * init_attr_search_ctx - initialize an attribute search context
+ * @ctx: attribute search context to initialize
+ * @ni: ntfs inode with which to initialize the search context
+ * @mrec: mft record with which to initialize the search context
+ *
+ * Initialize the attribute search context @ctx with @ni and @mrec.
*/
static inline void init_attr_search_ctx(attr_search_context *ctx,
@@ -1351,29 +1446,12 @@
/**
- * get_attr_search_ctx -
- */
-int get_attr_search_ctx(attr_search_context **ctx, ntfs_inode *ni,
- MFT_RECORD *mrec)
-{
- *ctx = kmem_cache_alloc(ntfs_attr_ctx_cache, SLAB_NOFS);
- if (unlikely(!*ctx))
- return -ENOMEM;
- init_attr_search_ctx(*ctx, ni, mrec);
- return 0;
-}
-
-/**
- * put_attr_search_ctx -
- */
-void put_attr_search_ctx(attr_search_context *ctx)
-{
- if (ctx->base_ntfs_ino && ctx->ntfs_ino != ctx->base_ntfs_ino)
- unmap_mft_record(READ, ctx->ntfs_ino);
- kmem_cache_free(ntfs_attr_ctx_cache, ctx);
- return;
-}
-
-/**
- * reinit_attr_search_ctx -
+ * reinit_attr_search_ctx - reinitialize an attribute search context
+ * @ctx: attribute search context to reinitialize
+ *
+ * Reinitialize the attribute search context @ctx, unmapping an associated
+ * extent mft record if present, and initialize the search context again.
+ *
+ * This is used when a search for a new attribute is being started to reset
+ * the search context to the beginning.
*/
void reinit_attr_search_ctx(attr_search_context *ctx)
@@ -1394,48 +1472,35 @@
/**
- * lookup_attr - find an attribute in an ntfs inode
- * @type: attribute type to find
- * @name: attribute name to find (optional, i.e. NULL means don't care)
- * @name_len: attribute name length (only needed if @name present)
- * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present)
- * @upcase: unicode upcase table
- * @ucpase_len: length of upcase table in unicode characters
- * @lowest_vcn: lowest vcn to find (optional, non-resident attributes only)
- * @val: attribute value to find (optional, resident attributes only)
- * @val_len: attribute value length
- * @ctx: search context with mft record and attribute to search from
- *
- * Find an attribute in an ntfs inode inode. On first search ctx->ntfs_ino must
- * be the base mft record and ctx must have been obtained from a call to
- * get_attr_search_ctx().
- *
- * This function transparently handles attribute lists and ctx is used to
- * continue searches where they were left off at.
+ * get_attr_search_ctx - allocate and initialize a new attribute search context
+ * @ctx: address of pointer in which to return the new search context
+ * @ni: ntfs inode with which to initialize the search context
+ * @mrec: mft record with which to initialize the search context
*
- * After finishing with the attribute/mft record you need to call
- * release_attr_search_ctx() to cleanup the search context (unmapping any
- * mapped inodes, etc).
- *
- * TODO: Flesh out above description for this master function.
+ * Allocate a new attribute search context, initialize it with @ni and @mrec,
+ * and return it in *@ctx. Return 0 on success or -ENOMEM if allocation failed.
*/
-BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
- const IGNORE_CASE_BOOL ic, const uchar_t *upcase,
- const u32 upcase_len, const VCN lowest_vcn, const u8 *val,
- const u32 val_len, attr_search_context *ctx)
+int get_attr_search_ctx(attr_search_context **ctx, ntfs_inode *ni,
+ MFT_RECORD *mrec)
{
- ntfs_inode *base_ni;
+ *ctx = kmem_cache_alloc(ntfs_attr_ctx_cache, SLAB_NOFS);
+ if (unlikely(!*ctx))
+ return -ENOMEM;
+ init_attr_search_ctx(*ctx, ni, mrec);
+ return 0;
+}
- ntfs_debug("Entering.\n");
- if (ctx->base_ntfs_ino)
- base_ni = ctx->base_ntfs_ino;
- else
- base_ni = ctx->ntfs_ino;
- /* Sanity check, just for debugging really. */
- BUG_ON(!base_ni);
- if (likely(!NInoAttrList(base_ni)))
- return find_attr(type, name, name_len, ic, upcase, upcase_len,
- val, val_len, ctx);
- return find_external_attr(type, name, name_len, ic, lowest_vcn, val,
- val_len, ctx);
+/**
+ * put_attr_search_ctx - release an attribute search context
+ * @ctx: attribute search context to free
+ *
+ * Release the attribute search context @ctx, unmapping an associated extent
+ * mft record if prseent.
+ */
+void put_attr_search_ctx(attr_search_context *ctx)
+{
+ if (ctx->base_ntfs_ino && ctx->ntfs_ino != ctx->base_ntfs_ino)
+ unmap_mft_record(READ, ctx->ntfs_ino);
+ kmem_cache_free(ntfs_attr_ctx_cache, ctx);
+ return;
}
Index: attrib.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs/attrib.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -U2 -r1.14 -r1.15
--- attrib.h 8 Feb 2002 02:53:55 -0000 1.14
+++ attrib.h 10 Feb 2002 02:22:58 -0000 1.15
@@ -68,10 +68,15 @@
extern run_list *decompress_mapping_pairs(const ntfs_volume *vol,
const ATTR_RECORD *attr, run_list *run_list);
+
extern int map_run_list(ntfs_inode *ni, VCN vcn);
+
extern LCN vcn_to_lcn(const run_list *rl, const VCN vcn);
extern BOOL find_attr(const ATTR_TYPES type, const uchar_t *name,
- const u32 name_len, const IGNORE_CASE_BOOL ic,
- const uchar_t *upcase, const u32 upcase_len, const u8 *val,
+ const u32 name_len, const IGNORE_CASE_BOOL ic, const u8 *val,
+ const u32 val_len, attr_search_context *ctx);
+
+BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
+ const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
const u32 val_len, attr_search_context *ctx);
@@ -86,13 +91,8 @@
}
+extern void reinit_attr_search_ctx(attr_search_context *ctx);
extern int get_attr_search_ctx(attr_search_context **ctx, ntfs_inode *ni,
MFT_RECORD *mrec);
extern void put_attr_search_ctx(attr_search_context *ctx);
-extern void reinit_attr_search_ctx(attr_search_context *ctx);
-
-BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
- const IGNORE_CASE_BOOL ic, const uchar_t *upcase,
- const u32 upcase_len, const VCN lowest_vcn, const u8 *val,
- const u32 val_len, attr_search_context *ctx);
#endif /* _LINUX_NTFS_ATTRIB_H */
Index: dir.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs/dir.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -U2 -r1.41 -r1.42
--- dir.c 8 Feb 2002 02:53:55 -0000 1.41
+++ dir.c 10 Feb 2002 02:22:58 -0000 1.42
@@ -76,6 +76,6 @@
/* Find the index root attribute in the mft record. */
- if (!lookup_attr(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, NULL, 0, 0,
- NULL, 0, ctx)) {
+ if (!lookup_attr(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, 0, NULL, 0,
+ ctx)) {
ntfs_error(sb, "Index root attribute missing in directory "
"inode %Li.",
@@ -547,6 +547,6 @@
ir_pos = (s64)filp->f_pos;
/* Find the index root attribute in the mft record. */
- if (!lookup_attr(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, NULL, 0, 0,
- NULL, 0, ctx)) {
+ if (!lookup_attr(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, 0, NULL, 0,
+ ctx)) {
ntfs_error(sb, "Index root attribute missing in directory "
"inode %Li.", (unsigned long long)ndir->mft_no);
@@ -607,6 +607,6 @@
} else {
/* Find the index bitmap attribute in the mft record. */
- if (!lookup_attr(AT_BITMAP, I30, 4, CASE_SENSITIVE, NULL, 0, 0,
- NULL, 0, ctx)) {
+ if (!lookup_attr(AT_BITMAP, I30, 4, CASE_SENSITIVE, 0, NULL, 0,
+ ctx)) {
ntfs_error(sb, "Index bitmap attribute missing in "
"directory inode %Li.",
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs/inode.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -U2 -r1.64 -r1.65
--- inode.c 8 Feb 2002 05:17:11 -0000 1.64
+++ inode.c 10 Feb 2002 02:22:58 -0000 1.65
@@ -135,6 +135,5 @@
/* Loop through all hard links. */
- while (lookup_attr(AT_FILE_NAME, NULL, 0, 0, NULL, 0, 0, NULL, 0,
- ctx)) {
+ while (lookup_attr(AT_FILE_NAME, NULL, 0, 0, 0, NULL, 0, ctx)) {
FILE_NAME_ATTR *file_name_attr;
ATTR_RECORD *attr = ctx->attr;
@@ -304,6 +303,6 @@
* I don't think this actually ever happens.
*/
- if (!lookup_attr(AT_STANDARD_INFORMATION, NULL, 0, 0, NULL, 0, 0, NULL,
- 0, ctx)) {
+ if (!lookup_attr(AT_STANDARD_INFORMATION, NULL, 0, 0, 0, NULL, 0,
+ ctx)) {
/*
* TODO: We should be performing a hot fix here (if the recover
@@ -346,6 +345,5 @@
*/
reinit_attr_search_ctx(ctx);
- if (lookup_attr(AT_ATTRIBUTE_LIST, NULL, 0, 0, NULL, 0, 0, NULL, 0,
- ctx)) {
+ if (lookup_attr(AT_ATTRIBUTE_LIST, NULL, 0, 0, 0, NULL, 0, ctx)) {
if (vi->i_ino == FILE_MFT)
goto skip_attr_list_load;
@@ -418,6 +416,6 @@
/* It is a directory, find index root attribute. */
reinit_attr_search_ctx(ctx);
- if (!lookup_attr(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, NULL, 0,
- 0, NULL, 0, ctx)) {
+ if (!lookup_attr(AT_INDEX_ROOT, I30, 4, CASE_SENSITIVE, 0,
+ NULL, 0, ctx)) {
// FIXME: File is corrupt! Hot-fix with empty index
// root attribute if recovery option is set.
@@ -514,5 +512,5 @@
reinit_attr_search_ctx(ctx);
if (!lookup_attr(AT_INDEX_ALLOCATION, I30, 4, CASE_SENSITIVE,
- NULL, 0, 0, NULL, 0, ctx)) {
+ 0, NULL, 0, ctx)) {
ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute "
"is not present but $INDEX_ROOT "
@@ -558,6 +556,6 @@
/* Find bitmap attribute. */
reinit_attr_search_ctx(ctx);
- if (!lookup_attr(AT_BITMAP, I30, 4, CASE_SENSITIVE, NULL, 0, 0,
- NULL, 0, ctx)) {
+ if (!lookup_attr(AT_BITMAP, I30, 4, CASE_SENSITIVE, 0, NULL, 0,
+ ctx)) {
ntfs_error(vi->i_sb, "$BITMAP attribute is not "
"present but it must be.");
@@ -626,6 +624,5 @@
/* It is a file, find the unnamed data attribute. */
reinit_attr_search_ctx(ctx);
- if (!lookup_attr(AT_DATA, NULL, 0, 0, NULL, 0, 0, NULL, 0,
- ctx)) {
+ if (!lookup_attr(AT_DATA, NULL, 0, 0, 0, NULL, 0, ctx)) {
vi->i_size = 0LL;
/*
@@ -880,6 +877,5 @@
/* Find the attribute list attribute if present. */
- if (lookup_attr(AT_ATTRIBUTE_LIST, NULL, 0, 0, NULL, 0, 0, NULL, 0,
- ctx)) {
+ if (lookup_attr(AT_ATTRIBUTE_LIST, NULL, 0, 0, 0, NULL, 0, ctx)) {
ATTR_LIST_ENTRY *al_entry, *next_al_entry;
u8 *al_end;
@@ -1003,6 +999,5 @@
attr = NULL;
next_vcn = last_vcn = highest_vcn = 0;
- while (lookup_attr(AT_DATA, NULL, 0, 0, NULL, 0, next_vcn, NULL, 0,
- ctx)) {
+ while (lookup_attr(AT_DATA, NULL, 0, 0, next_vcn, NULL, 0, ctx)) {
run_list *nrl;
Index: super.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs/super.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -U2 -r1.72 -r1.73
--- super.c 8 Feb 2002 02:53:55 -0000 1.72
+++ super.c 10 Feb 2002 02:22:58 -0000 1.73
@@ -769,6 +769,5 @@
rl = NULL;
next_vcn = last_vcn = highest_vcn = 0;
- while (lookup_attr(AT_BITMAP, NULL, 0, 0, NULL, 0, next_vcn, NULL, 0,
- ctx)) {
+ while (lookup_attr(AT_BITMAP, NULL, 0, 0, next_vcn, NULL, 0, ctx)) {
run_list *nrl;
@@ -927,7 +926,6 @@
goto get_ctx_vol_failed;
}
- if (!lookup_attr(AT_VOLUME_INFORMATION, NULL, 0, 0, NULL, 0, 0, NULL,
- 0, ctx) || ctx->attr->non_resident ||
- ctx->attr->flags) {
+ if (!lookup_attr(AT_VOLUME_INFORMATION, NULL, 0, 0, 0, NULL, 0, ctx) ||
+ ctx->attr->non_resident || ctx->attr->flags) {
err_put_vol:
put_attr_search_ctx(ctx);
|