Patent ID: 8818966
Filing Date: 2014-08-26
Classification: G06F

Abstract:
1. A method of reducing fragmentation of a file when writing to the file in a digital computer, said method comprising a data processor of the digital computer executing computer instructions stored in a non-transitory computer readable storage medium to perform the steps of: (a) responding to a request to write data to a specified number of blocks in a logical extent of the file beginning at a specified offset in the logical extent of the file by determining whether or not file system block allocations exist for the specified number of blocks in the logical extent of the file beginning at the specified offset in the logical extent of the file; and (b) upon determining in step (a) that file system block allocations exist for the specified number of blocks in the logical extent of the file beginning at the specified offset in the logical extent of the file, obtaining a measure of the fragmentation of the file over the file system block allocations for the specified number of blocks of the file beginning at the specified offset in the logical extent of the file, and based on the measure of fragmentation of the file over the file system block allocations for the specified number of blocks of the file beginning at the specified offset in the logical extent of the file, determining that the file is fragmented over the file system block allocations for the specified number of blocks in the logical extent of the file beginning at the specified offset in the logical extent of the file; and (c) in response to determining in step (b) that the file is fragmented over the file system block allocations for the specified number of blocks of the file beginning at the specified offset in the logical extent of the file, allocating a single extent of a number of contiguous file system blocks equal to the specified number, writing the specified number of blocks of data to the specified number of the contiguous file system blocks in the newly allocated single extent, and substituting the specified number of the contiguous file system blocks in the newly allocated single extent for the file system block allocations for the specified number of blocks in the logical extent of the file beginning at the specified offset in the logical extent of the file, in order to reduce the fragmentation of the file.