GET_NR_FREE_CLUSTERS

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

 

NAME

get_nr_free_clusters - return the number of free clusters on a volume  

SYNOPSIS

"SYNOPSIS"

s64 get_nr_free_clusters (ntfs_volume * vol);  

ARGUMENTS

vol
ntfs volume for which to obtain free cluster count
 

DESCRIPTION

Calculate the number of free clusters on the mounted NTFS volume vol. We actually calculate the number of clusters in use instead because this allows us to not care about partial pages as these will be just zero filled and hence not be counted as allocated clusters.

The only particularity is that clusters beyond the end of the logical ntfs volume will be marked as allocated to prevent errors which means we have to discount those at the end. This is important as the cluster bitmap always has a size in multiples of 8 bytes, i.e. up to 63 clusters could be outside the logical volume and marked in use when they are not as they do not exist.

If any pages cannot be read we assume all clusters in the erroring pages are in use. This means we return an underestimate on errors which is better than an overestimate.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION

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