In mfu_create_file there is an lstat call to make sure the file exists before calling truncate, but mknod was just called above, so the file should already exist under normal circumstances. It seems that this extra lstat call could be removed, which is called on every file when copy_opts->sparse.
truncate will return ENOENT if the file doesn't exist, so that could be check instead.
In
mfu_create_file
there is anlstat
call to make sure the file exists before callingtruncate
, butmknod
was just called above, so the file should already exist under normal circumstances. It seems that this extralstat
call could be removed, which is called on every file whencopy_opts->sparse
.truncate
will returnENOENT
if the file doesn't exist, so that could be check instead.