NTFS_INDEX_LOOKUP

Section: (9)
Updated: 09 October 2005
Index Return to Main Contents

 

NAME

ntfs_index_lookup - find a key in an index and return its index entry  

SYNOPSIS

"SYNOPSIS"

int ntfs_index_lookup (const void * key, const int key_len, ntfs_index_context * ictx);  

ARGUMENTS

key
[IN] key for which to search in the index
key_len
[IN] length of key in bytes
ictx
[IN/OUT] context describing the index and the returned entry
 

DESCRIPTION

Before calling ntfs_index_lookup, ictx must have been obtained from a call to ntfs_index_ctx_get.

Look for the key in the index specified by the index lookup context ictx. ntfs_index_lookup walks the contents of the index looking for the key.

If the key is found in the index, 0 is returned and ictx is setup to describe the index entry containing the matching key. ictx->entry is the index entry and ictx->data and ictx->data_len are the index entry data and its length in bytes, respectively.

If the key is not found in the index, -ENOENT is returned and ictx is setup to describe the index entry whose key collates immediately after the search key, i.e. this is the position in the index at which an index entry with a key of key would need to be inserted.

If an error occurs return the negative error code and ictx is left untouched.

When finished with the entry and its data, call ntfs_index_ctx_put to free the context and other associated resources.

If the index entry was modified, call flush_dcache_index_entry_page immediately after the modification and either ntfs_index_entry_mark_dirty or ntfs_index_entry_write before the call to ntfs_index_ctx_put to ensure that the changes are written to disk.  

LOCKING

- Caller must hold i_sem on the index inode. - Each page cache page in the index allocation mapping must be locked whilst being accessed otherwise we may find a corrupt page due to it being under ->writepage at the moment which applies the mst protection fixups before writing out and then removes them again after the write is complete after which it unlocks the page.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
LOCKING

This document was created by man2html, using the manual pages.
Time: 00:02:33 GMT, October 09, 2005