UltraDefrag Engine Logo UltraDefrag Engine

Architecture - Reference Manual - Guides

Optimization

Functions

void MovePartOfFileBlock (PFILENAME pfn, ULONGLONG startVcn, ULONGLONG targetLcn, ULONGLONG n_clusters)
 Moves a part of file.
void DefragmentFreeSpaceRTL (void)
 Defragments the free space by moving all files to the beginning part of the volume.
void DefragmentFreeSpaceLTR (void)
 Defragments the free space by moving all files to the terminal part of the volume.
int MoveAllFilesRTL (void)
 Moves all files to the beginning part of the volume.
int OptimizationRoutine (char *volume_name)
 Performs a single pass of the volume optimization.
int Optimize (char *volume_name)
 Performs a volume optimization job.
BOOLEAN MoveTheUnfragmentedFile (PFILENAME pfn, ULONGLONG target)
 Moves a file containing a single fragment.

Function Documentation

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 DefragmentFreeSpaceRTL ( void   ) 

Defragments the free space by moving all files to the beginning part of the volume.

Note:
  • StartingPoint takes no effect here.
  • Usually this function increases a number of fragmented files.

Definition at line 187 of file optimize.c.

References CheckForStopEvent(), GetFileSpaceState(), IsFileLocked(), MovePartOfFileBlock(), and RemarkBlock().

void DefragmentFreeSpaceLTR ( void   ) 

Defragments the free space by moving all files to the terminal part of the volume.

Note:
  • StartingPoint works here.
  • Usually this function increases a number of fragmented files.

Definition at line 255 of file optimize.c.

References CheckForStopEvent(), GetFileSpaceState(), IsFileLocked(), MovePartOfFileBlock(), and RemarkBlock().

Referenced by OptimizationRoutine().

int MoveAllFilesRTL ( void   ) 

Moves all files to the beginning part of the volume.

Returns:
Zero if at least one file has been moved, negative value otherwise.

Definition at line 369 of file optimize.c.

References CheckForStopEvent(), IsFileLocked(), and MoveTheUnfragmentedFile().

Referenced by OptimizationRoutine().

int OptimizationRoutine ( char *  volume_name  ) 

Performs a single pass of the volume optimization.

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

DbgPrintFreeSpaceList();

DbgPrintFreeSpaceList();

AnalyzeFreeSpace(volume_name); /* refresh free space map */

Definition at line 126 of file optimize.c.

References Analyze(), CheckForStopEvent(), Defragment(), DefragmentFreeSpaceLTR(), and MoveAllFilesRTL().

Referenced by Optimize().

int Optimize ( char *  volume_name  ) 

Performs a volume optimization job.

Parameters:
[in] volume_name the name of the volume.
Returns:
Zero for success, negative value otherwise.
Note:
  • The algorithm used here is effective. Even when the volume to be optimized has a low amount of free space.
  • We cannot update a number of fragmented files during the volume optimization process.

Definition at line 50 of file optimize.c.

References CheckForStopEvent(), IsFileLocked(), and OptimizationRoutine().

Referenced by udefrag_kernel_start().

BOOLEAN MoveTheUnfragmentedFile ( PFILENAME  pfn,
ULONGLONG  target 
)

Moves a file containing a single fragment.

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 optimizer only, not for defragmenter!

Definition at line 329 of file optimize.c.

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

Referenced by MoveAllFilesRTL().


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