NTFS_ATTR_FIND_VCN_NOLOCK

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

 

NAME

ntfs_attr_find_vcn_nolock - find a vcn in the runlist of an ntfs inode  

SYNOPSIS

"SYNOPSIS"

runlist_element * ntfs_attr_find_vcn_nolock (ntfs_inode * ni, const VCN vcn, const BOOL write_locked);  

ARGUMENTS

ni
ntfs inode describing the runlist to search
vcn
vcn to find
write_locked
true if the runlist is locked for writing
 

DESCRIPTION

Find the virtual cluster number vcn in the runlist described by the ntfs inode ni and return the address of the runlist element containing the vcn.

If the vcn is not mapped yet, the attempt is made to map the attribute extent containing the vcn and the vcn to lcn conversion is retried.

If write_locked is true the caller has locked the runlist for writing and if false for reading.

Note you need to distinguish between the lcn of the returned runlist element being >= 0 and LCN_HOLE. In the later case you have to return zeroes on read and allocate clusters on write.

Return the runlist element containing the vcn on success and ERR_PTR(-errno) on error. You need to test the return value with IS_ERR to decide if the return is success or failure and PTR_ERR to get to the error code if IS_ERR is true.  

THE POSSIBLE ERROR RETURN CODES ARE

-ENOENT - No such vcn in the runlist, i.e. vcn is out of bounds. -ENOMEM - Not enough memory to map runlist. -EIO - Critical error (runlist/file is corrupt, i/o error, etc).  

LOCKING

- The runlist must be locked on entry and is left locked on return. - If write_locked is FALSE, i.e. the runlist is locked for reading, the lock may be dropped inside the function so you cannot rely on the runlist still being the same when this function returns.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
THE POSSIBLE ERROR RETURN CODES ARE
LOCKING

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