• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/ntfs/

Lines Matching refs:index

2  * index.c - NTFS kernel index handling.  Part of the Linux-NTFS project.
27 #include "index.h"
31 * ntfs_index_ctx_get - allocate and initialize a new index context
32 * @idx_ni: ntfs index inode with which to initialize the context
34 * Allocate a new index context, initialize it with @idx_ni and return it.
37 * Locking: Caller must hold i_mutex on the index inode.
50 * ntfs_index_ctx_put - release an index context
51 * @ictx: index context to free
53 * Release the index context @ictx, releasing all associated resources.
55 * Locking: Caller must hold i_mutex on the index inode.
79 * ntfs_index_lookup - find a key in an index and return its index entry
80 * @key: [IN] key for which to search in the index
82 * @ictx: [IN/OUT] context describing the index and the returned entry
87 * Look for the @key in the index specified by the index lookup context @ictx.
88 * ntfs_index_lookup() walks the contents of the index looking for the @key.
90 * If the @key is found in the index, 0 is returned and @ictx is setup to
91 * describe the index entry containing the matching @key. @ictx->entry is the
92 * index entry and @ictx->data and @ictx->data_len are the index entry data and
95 * If the @key is not found in the index, -ENOENT is returned and @ictx is
96 * setup to describe the index entry whose key collates immediately after the
97 * search @key, i.e. this is the position in the index at which an index entry
106 * If the index entry was modified, call flush_dcache_index_entry_page()
111 * Locking: - Caller must hold i_mutex on the index inode.
112 * - Each page cache page in the index allocation mapping must be
145 idx_ni->itype.index.collation_rule)) {
148 idx_ni->itype.index.collation_rule));
151 /* Get hold of the mft record for the index inode. */
163 /* Find the index root attribute in the mft record. */
174 /* Get to the index root value (it has been verified in read_inode). */
177 index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
178 /* The first index entry. */
179 ie = (INDEX_ENTRY*)((u8*)&ir->index +
180 le32_to_cpu(ir->index.entries_offset));
227 rc = ntfs_collate(vol, idx_ni->itype.index.collation_rule, key,
231 * is definitely no such key in this index but we might need to
245 * We have finished with this index without success. Check for the
254 /* Consistency check: Verify that an index allocation exists. */
256 ntfs_error(sb, "No index allocation attribute but index entry "
265 * We are done with the index root and the mft record. Release them,
274 * Convert vcn to index into the index allocation attribute in units
279 idx_ni->itype.index.vcn_size_bits >> PAGE_CACHE_SHIFT);
281 ntfs_error(sb, "Failed to map index page, error %ld.",
289 /* Get to the index allocation block. */
291 idx_ni->itype.index.vcn_size_bits) & ~PAGE_CACHE_MASK));
306 ntfs_error(sb, "Actual VCN (0x%llx) of index buffer is "
314 if (le32_to_cpu(ia->index.allocated_size) + 0x18 !=
315 idx_ni->itype.index.block_size) {
317 "a size (%u) differing from the index "
321 le32_to_cpu(ia->index.allocated_size) + 0x18,
322 idx_ni->itype.index.block_size);
325 index_end = (u8*)ia + idx_ni->itype.index.block_size;
334 index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
335 if (index_end > (u8*)ia + idx_ni->itype.index.block_size) {
336 ntfs_error(sb, "Size of index buffer (VCN 0x%llx) of inode "
341 /* The first index entry. */
342 ie = (INDEX_ENTRY*)((u8*)&ia->index +
343 le32_to_cpu(ia->index.entries_offset));
345 * Iterate similar to above big loop but applied to index buffer, thus
390 rc = ntfs_collate(vol, idx_ni->itype.index.collation_rule, key,
394 * is definitely no such key in this index but we might need to
408 * We have finished with this index buffer without success. Check for
416 if ((ia->index.flags & NODE_MASK) == LEAF_NODE) {
452 ntfs_error(sb, "Corrupt index. Aborting lookup.");