hpc / mpifileutils

File utilities designed for scalability and performance.
https://hpc.github.io/mpifileutils
BSD 3-Clause "New" or "Revised" License
164 stars 64 forks source link

mfu_flist_copy extra stat call #479

Open daltonbohning opened 3 years ago

daltonbohning commented 3 years ago

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.