NTFS_ATTR_LOOKUP

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

 

NAME

ntfs_attr_lookup - find an attribute in an ntfs inode  

SYNOPSIS

"SYNOPSIS"

int ntfs_attr_lookup (const ATTR_TYPE type, const ntfschar * name, const u32 name_len, const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 * val, const u32 val_len, ntfs_attr_search_ctx * ctx);  

ARGUMENTS

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
 

DESCRIPTION

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 ntfs_attr_get_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 ntfs_attr_put_search_ctx to cleanup the search context (unmapping any mapped inodes, etc).

Return 0 if the search was successful and -errno if not.

When 0, ctx->attr is the found attribute and it is in mft record ctx->mrec. If an attribute list attribute is present, ctx->al_entry is the attribute list entry of the found attribute.

When -ENOENT, 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. If an attribute list attribute is present, ctx->al_entry is the attribute list entry which collates just after the attribute list entry of 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 its attribute list entry into.

When -errno != -ENOENT, an error occured during the lookup. ctx->attr is then undefined and in particular you should not rely on it not changing.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION

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