UltraDefrag Engine Logo UltraDefrag Engine

Architecture - Reference Manual - Guides

Defragmentation

Functions

BOOLEAN MoveTheFile (PFILENAME pfn, ULONGLONG target)
 Moves a file and updates the global statistics and map.
int Defragment (char *volume_name)
 Performs a volume defragmentation.
NTSTATUS MovePartOfFile (HANDLE hFile, ULONGLONG startVcn, ULONGLONG targetLcn, ULONGLONG n_clusters)
 Moves a range of clusters belonging to the file.
NTSTATUS MoveBlocksOfFile (PFILENAME pfn, HANDLE hFile, ULONGLONG targetLcn)
 Moves a file entirely.
void MovePartOfFileBlock (PFILENAME pfn, ULONGLONG startVcn, ULONGLONG targetLcn, ULONGLONG n_clusters)
 Moves a part of file.
void DbgPrintBlocksOfFile (PBLOCKMAP blockmap)
 Prints sequently information about all blocks of the file.

Function Documentation

BOOLEAN MoveTheFile ( PFILENAME  pfn,
ULONGLONG  target 
)

Moves a file and updates the global statistics and map.

Parameters:
[in] pfn pointer to the structure describing the file.
[in] target the starting logical cluster number defining position of target space on the volume.
Returns:
Boolean value. TRUE indicates success, FALSE indicates failure.
Note:
For defragmenter only, not for optimizer!

Definition at line 324 of file defrag.c.

References DbgPrintBlocksOfFile(), DumpFile(), GetFileSpaceState(), MoveBlocksOfFile(), OpenTheFile(), ProcessFreedBlock(), RemarkBlock(), and TruncateFreeSpaceBlock().

Referenced by Defragment().

int Defragment ( char *  volume_name  ) 

Performs a volume defragmentation.

Parameters:
[in] volume_name the name of the volume.
Returns:
Zero if at least one file has been defragmented, negative value otherwise.

Definition at line 54 of file defrag.c.

References CheckForStopEvent(), IsFileLocked(), MoveTheFile(), and UpdateFragmentedFilesList().

Referenced by OptimizationRoutine(), and udefrag_kernel_start().

NTSTATUS MovePartOfFile ( HANDLE  hFile,
ULONGLONG  startVcn,
ULONGLONG  targetLcn,
ULONGLONG  n_clusters 
)

Moves a range of clusters belonging to the file.

Parameters:
[in] hFile handle of the file.
[in] startVcn the starting virtual cluster number defining position inside the file.
[in] targetLcn the starting logical cluster number defining position of target space on the volume.
[in] n_clusters the number of clusters to move.
Returns:
An appropriate NTSTATUS code.
Note:
On NT 4.0 this function can move no more than 256 kilobytes once.

Definition at line 150 of file defrag.c.

References CheckForStopEvent().

Referenced by MoveBlocksOfFile(), and MovePartOfFileBlock().

NTSTATUS MoveBlocksOfFile ( PFILENAME  pfn,
HANDLE  hFile,
ULONGLONG  targetLcn 
)

Moves a file entirely.

Parameters:
[in] pfn pointer to the structure describing the file.
[in] hFile handle of the file.
[in] targetLcn the starting logical cluster number defining position of target space on the volume.
Returns:
An appropriate NTSTATUS code.

Definition at line 200 of file defrag.c.

References MovePartOfFile().

Referenced by MoveTheFile(), and MoveTheUnfragmentedFile().

void MovePartOfFileBlock ( PFILENAME  pfn,
ULONGLONG  startVcn,
ULONGLONG  targetLcn,
ULONGLONG  n_clusters 
)

Moves a part of file.

Parameters:
[in] pfn pointer to the structure describing the file.
[in] startVcn the starting virtual cluster number defining position inside the file.
[in] targetLcn the starting logical cluster number defining position of target space on the volume.
[in] n_clusters the number of clusters to move.
Note:
On NT 4.0 this function has no size limit for the part of file to be moved, unlike the MovePartOfFile().

Definition at line 254 of file defrag.c.

References MovePartOfFile(), and OpenTheFile().

Referenced by DefragmentFreeSpaceLTR(), and DefragmentFreeSpaceRTL().

void DbgPrintBlocksOfFile ( PBLOCKMAP  blockmap  ) 

Prints sequently information about all blocks of the file.

Parameters:
[in] blockmap pointer to the list representing blocks of file.

Definition at line 304 of file defrag.c.

Referenced by MoveTheFile().


Generated on Sat May 29 23:06:46 2010 for UltraDefrag Engine by doxygen 1.6.2