While stracing a running backshift progress, I see a lot of calls to mkdir, like this:
stat("files/1354189261.62_host_slash_thu-nov-29-12-41-01-2012_8f4e075b684ce05f/dir-etc/dir-.git/dir-objects/dir-2a", 0xd27e150) = -1 ENOENT (No such file or directory)
mkdir("files", 0755) = -1 EEXIST (File exists)
mkdir("files/1354189261.62_host_slash_thu-nov-29-12-41-01-2012_8f4e075b684ce05f", 0755) = -1 EEXIST (File exists)
mkdir("files/1354189261.62_host_slash_thu-nov-29-12-41-01-2012_8f4e075b684ce05f/dir-etc", 0755) = -1 EEXIST (File exists)
mkdir("files/1354189261.62_host_slash_thu-nov-29-12-41-01-2012_8f4e075b684ce05f/dir-etc/dir-.git", 0755) = -1 EEXIST (File exists)
mkdir("files/1354189261.62_host_slash_thu-nov-29-12-41-01-2012_8f4e075b684ce05f/dir-etc/dir-.git/dir-objects", 0755) = -1 EEXIST (File exists)
mkdir("files/1354189261.62_host_slash_thu-nov-29-12-41-01-2012_8f4e075b684ce05f/dir-etc/dir-.git/dir-objects/dir-2a", 0755) = 0
open("files/1354189261.62_host_slash_thu-nov-29-12-41-01-2012_8f4e075b684ce05f/dir-etc/dir-.git/dir-objects/dir-2a/entries", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/.git/objects/2a/494214459abb11c0b5672d4c3077d442e94a86", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=45, ...}) = 0
I think that this could get optimized by remembering which directories already exist (because backshift accessed/created them during the current run), and skip calling mkdir for these.
This should make backshift behave far better on a low-latency filesystem (e.g. sshfs).
Besides, what is the first call to open() meant to do? The file cannot exist (because the parent directories did not exist), and backshift does not appear to create the file there anyway.
Regards,
Daniel.