Linux Kernel
3.7.1
|
#include <linux/slab.h>
#include "aops.h"
#include "collate.h"
#include "debug.h"
#include "index.h"
#include "ntfs.h"
Go to the source code of this file.
Functions | |
ntfs_index_context * | ntfs_index_ctx_get (ntfs_inode *idx_ni) |
void | ntfs_index_ctx_put (ntfs_index_context *ictx) |
int | ntfs_index_lookup (const void *key, const int key_len, ntfs_index_context *ictx) |
ntfs_index_context* ntfs_index_ctx_get | ( | ntfs_inode * | idx_ni | ) |
void ntfs_index_ctx_put | ( | ntfs_index_context * | ictx | ) |
ntfs_index_lookup - find a key in an index and return its index entry : [IN] key for which to search in the index : [IN] length of in bytes : [IN/OUT] context describing the index and the returned entry
Before calling ntfs_index_lookup(), must have been obtained from a call to ntfs_index_ctx_get().
Look for the in the index specified by the index lookup context . ntfs_index_lookup() walks the contents of the index looking for the .
If the is found in the index, 0 is returned and is setup to describe the index entry containing the matching . ->entry is the index entry and ->data and ->data_len are the index entry data and its length in bytes, respectively.
If the is not found in the index, -ENOENT is returned and is setup to describe the index entry whose key collates immediately after the search , i.e. this is the position in the index at which an index entry with a key of would need to be inserted.
If an error occurs return the negative error code and 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_mutex on the index inode.