archive: Optimize ChangesDirs on Linux

If we tear through a few layers of abstraction, we can get at the inodes
contained in a directory without having to stat all the files. This
allows us to eliminate identical files much earlier in the changelist
generation process.

Signed-off-by: Burke Libbey <burke@libbey.me>
This commit is contained in:
Burke Libbey 2015-04-14 15:28:54 -04:00
parent f71e128a11
commit a423e54ba4
4 changed files with 376 additions and 64 deletions

View file

@ -14,6 +14,12 @@ func fromStatT(s *syscall.Stat_t) (*Stat_t, error) {
mtim: s.Mtim}, nil
}
// FromStatT exists only on linux, and loads a system.Stat_t from a
// syscal.Stat_t.
func FromStatT(s *syscall.Stat_t) (*Stat_t, error) {
return fromStatT(s)
}
// Stat takes a path to a file and returns
// a system.Stat_t type pertaining to that file.
//