The application discloses a method for fast
copying of internal files of a
file system, and relates to the technical field of
file copying, and comprises the following steps: S1, judging whether a source file exists; S2, opening the source file; S3, opening a target file, and creating the target file if the target file does not exist; and S4, calling an
ioctl interface realized by the
file system to complete the relevant index of
data content and the target file. The method for fast
copying of internal files of the
file system is different from physical
copying of a traditional file
system, utilizes the support of an efficient
Copy on Write of a btree
data structure, realizes a logical copying operation of the file
system, and when a file is to be copied, the
system does not copy
original data of the file, but copies
metadata describing the file, so that the source file and the target file share a same physical storage space, the effect of
file copying is achieved, the logical copying has a lower time
delay, and a better space
utilization rate is achieved.