2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-01 03:12:31 +00:00
Commit Graph

40 Commits

Author SHA1 Message Date
Alexander Neumann
fccde030d5 Refactor Index.Lookup() to return struct PackedBlob 2015-10-31 14:47:42 +01:00
Klaus Post
d6935d6625 Fix log message
'inode' isn't tested, so we don't want to imply that in the debug message.
2015-08-16 14:16:40 +02:00
Klaus Post
dfe232cf46 Add Windows node support.
The syscall.Stat_t doesn't exist on Windows, so it is replaced by an interface,
which Windows can fill out, and field access is replaced by function calls.

Common Unix functionality is put into "node_unix.go", so there is less boilerplate.

Symlinks are skipped on Windows, since they require admin privileges.
2015-08-14 15:57:47 +02:00
Alexander Neumann
55ddd5317d Reduce memory usage for fuse mount
This changes `repository.LoadBlob()` so that a destination buffer must
be provided, which enables the fuse code to use a buffer from a
`sync.Pool`. In addition, release the buffers when the file is closed.
At the moment, the max memory usage is defined by the max file size that
is read in one go (e.g. with `cat`). It could be further optimized by
implementing a LRU caching scheme.
2015-07-26 14:25:59 +02:00
Alexander Neumann
5cdcc99eba Use array instead of hash for backend.ID
Since backend.ID is always a slice of constant length, use an array
instead of a slice. Mostly, arrays behave as slices, except that an
array cannot be nil, so use `*backend.ID` insteaf of `backend.ID` in
places where the absence of an ID is possible (e.g. for the Subtree of a
Node, which may not present when the node is a file node).

This change allows to directly use backend.ID as the the key for a map,
so that arbitrary data structures (e.g. a Set implemented as a
map[backend.ID]struct{}) can easily be formed.
2015-07-25 18:01:57 +02:00
Alexander Neumann
3e0a97fb13 Fix restore filter
Internally rename restorer.Filter -> restorer.SelectForRestore to make
semantic clear.

In addition, swap parameters to filepath.Match() so that the pattern can
really be matched.

Limitation: The filter only works on the filename, not on any path
component, e.g. '*.go' selects all go files, 'subdir/foo*' doesn't
select anything.

Fixes #202.
2015-07-09 20:12:31 +02:00
Alexander Neumann
cf37b619fd Merge pull request #191 from restic/fix-189
Fix restoring symlink timestamps for linux
2015-05-17 14:26:54 +02:00
Alexander Neumann
14a3ed4e9d Move error annotation for symlink timestamp restore 2015-05-16 13:25:10 +02:00
Alexander Neumann
d42242556b Fix restic for i386
Some functions aren't implemented on Linux/i386, e.g. user.LookupId()
and user.Current(), so ignore these errors.
2015-05-14 23:16:35 +02:00
Alexander Neumann
44219c5afe node/Linux: Implement setting timestamps for symlinks 2015-05-14 23:06:11 +02:00
Alexander Neumann
aa5fd9e9bc Remove execute bit from node.go 2015-05-14 15:53:49 +02:00
Florian Weingarten
bace4607bf Fix ModTime for directories 2015-05-13 23:11:31 -04:00
Alexander Neumann
95536e8a21 Rename 'Repo' -> 'Repository' 2015-05-09 23:59:58 +02:00
Alexander Neumann
232c472836 Move package 'repo' to package 'repository' 2015-05-09 23:52:03 +02:00
Alexander Neumann
ae21938f3e Rename 'Repository' -> Repo 2015-05-09 17:41:28 +02:00
Alexander Neumann
d9b5832034 Rename variables 2015-05-09 13:47:21 +02:00
Alexander Neumann
87ebf12945 Rename 'Server' to 'Repository' 2015-05-09 13:25:52 +02:00
Alexander Neumann
8be9e95d20 Rename package 'server' to 'repo' 2015-05-09 13:24:15 +02:00
Chris Howey
a1c8dac561 Add node to build on freebsd.
Also note that inode is 32 bit in go freebsd stat struct. Assumed
to be 64bit in restic.
2015-05-05 18:06:36 -05:00
Alexander Neumann
1723be5a50 node: Move unix-specific functions back to node.go 2015-05-05 21:34:12 +02:00
Alexander Neumann
6fe38b0cd8 fix comments to have the standard form 2015-05-02 16:22:43 +02:00
Alexander Neumann
0ca678228d node: add comments 2015-05-02 16:12:19 +02:00
Alexander Neumann
97619e743c replace github.com/juju/arrar by /errors 2015-05-02 01:29:54 +02:00
Florian Weingarten
e9009358a9 catch err 2015-05-02 00:16:13 +02:00
Florian Weingarten
6e20eba852 uid lookup cache 2015-05-02 00:16:13 +02:00
Alexander Neumann
60a0fe8349 Major restructure, bundle blobs
This commit also breaks the repository format.
2015-04-29 23:27:32 +02:00
Florian Weingarten
adcde1988e uint64(stat.Rdev) works on both platforms 2015-04-28 23:55:47 -04:00
Florian Weingarten
6ba11d8fb7 move fillExtra to node.go 2015-04-29 03:45:24 +00:00
Florian Weingarten
91a2a5f90a Move isNewer() into node.go 2015-04-29 03:31:07 +00:00
Florian Weingarten
4bb724fac2 Refactor node.go 2015-04-29 03:07:22 +00:00
Florian Weingarten
8ba47df8d1 golint 2015-04-28 10:23:13 -04:00
Alexander Neumann
d19b23d4f1 Move Server and Key to new sub-package 2015-04-26 14:46:15 +02:00
Florian Weingarten
ebae478631 Prefer mixedCaps over underscore 2015-04-24 19:39:32 -04:00
Alexander Neumann
d2105a5085 Node: Also store ModeType bits in Mode
This fixes #120
2015-04-07 21:57:26 +02:00
Alexander Neumann
24b14e21cc Remove pools for nodes and IDs
This removes the allocation pools for nodes and IDs. I feel they aren't
really needed. Benchmarks:

    benchmark                         old ns/op      new ns/op      delta
    BenchmarkChunkEncrypt             197890867      198616293      +0.37%
    BenchmarkChunkEncryptParallel     196127004      198819818      +1.37%
    BenchmarkArchiveDirectory         1098848419     1087237723     -1.06%
    BenchmarkPreload                  30464455       29910239       -1.82%
    BenchmarkLoadTree                 3265092        3088543        -5.41%
    BenchmarkEncryptWriter            37213511       37134683       -0.21%
    BenchmarkEncrypt                  36037879       36166546       +0.36%
    BenchmarkDecryptReader            38165659       38556734       +1.02%
    BenchmarkEncryptDecryptReader     77027044       77194987       +0.22%
    BenchmarkDecrypt                  36017602       35937888       -0.22%
    BenchmarkSaveJSON                 47906          50270          +4.93%
    BenchmarkSaveFrom                 49775973       50520969       +1.50%
    BenchmarkLoadJSONID               105290245      107281849      +1.89%
    BenchmarkChunkerWithSHA256        151501430      148264078      -2.14%
    BenchmarkChunkerWithMD5           93606346       94036392       +0.46%
    BenchmarkChunker                  74285431       75933882       +2.22%
    BenchmarkPipelineWalker           387689         346467         -10.63%

    benchmark                         old MB/s     new MB/s     speedup
    BenchmarkChunkEncrypt             52.99        52.79        1.00x
    BenchmarkChunkEncryptParallel     53.46        52.74        0.99x
    BenchmarkEncryptWriter            225.42       225.90       1.00x
    BenchmarkEncrypt                  232.77       231.94       1.00x
    BenchmarkDecryptReader            219.79       217.57       0.99x
    BenchmarkEncryptDecryptReader     108.90       108.67       1.00x
    BenchmarkDecrypt                  232.90       233.42       1.00x
    BenchmarkSaveFrom                 84.26        83.02        0.99x
    BenchmarkChunkerWithSHA256        69.21        70.72        1.02x
    BenchmarkChunkerWithMD5           112.02       111.51       1.00x
    BenchmarkChunker                  141.15       138.09       0.98x

    benchmark                         old allocs     new allocs     delta
    BenchmarkChunkEncrypt             110            110            +0.00%
    BenchmarkChunkEncryptParallel     100            100            +0.00%
    BenchmarkArchiveDirectory         475591         476635         +0.22%
    BenchmarkPreload                  28059          24182          -13.82%
    BenchmarkLoadTree                 3124           2889           -7.52%
    BenchmarkEncryptWriter            19             19             +0.00%
    BenchmarkEncrypt                  13             13             +0.00%
    BenchmarkDecryptReader            16             15             -6.25%
    BenchmarkEncryptDecryptReader     39             39             +0.00%
    BenchmarkDecrypt                  11             11             +0.00%
    BenchmarkSaveJSON                 74             74             +0.00%
    BenchmarkSaveFrom                 109            112            +2.75%
    BenchmarkLoadJSONID               103630         97849          -5.58%
    BenchmarkChunkerWithSHA256        13             13             +0.00%
    BenchmarkChunkerWithMD5           12             12             +0.00%
    BenchmarkChunker                  6              6              +0.00%
    BenchmarkPipelineWalker           212            165            -22.17%

    benchmark                         old bytes     new bytes     delta
    BenchmarkChunkEncrypt             64697         64697         +0.00%
    BenchmarkChunkEncryptParallel     64681         64681         +0.00%
    BenchmarkArchiveDirectory         193385504     193790864     +0.21%
    BenchmarkPreload                  4064701       3942000       -3.02%
    BenchmarkLoadTree                 344954        325396        -5.67%
    BenchmarkEncryptWriter            12793         12793         +0.00%
    BenchmarkEncrypt                  1950          1950          +0.00%
    BenchmarkDecryptReader            3120          2774          -11.09%
    BenchmarkEncryptDecryptReader     1528036       1528036       +0.00%
    BenchmarkDecrypt                  1919          1919          +0.00%
    BenchmarkSaveJSON                 5524          5524          +0.00%
    BenchmarkSaveFrom                 31353         40804         +30.14%
    BenchmarkLoadJSONID               12872020      16010968      +24.39%
    BenchmarkChunkerWithSHA256        26821         26821         +0.00%
    BenchmarkChunkerWithMD5           13554         13554         +0.00%
    BenchmarkChunker                  13458         13458         +0.00%
    BenchmarkPipelineWalker           58584         55560         -5.16%
2015-03-28 16:51:37 +01:00
Alexander Neumann
ba892e1ec2 Refactor backup pipeline 2015-03-08 14:16:01 +01:00
Alexander Neumann
f8f8107d55 wip 2015-02-15 15:17:24 +01:00
Alexander Neumann
26d3949c8b Use file size from FileInfo 2015-02-03 22:05:25 +01:00
Alexander Neumann
1da693a7d7 Move platform specific code to different files 2015-02-03 21:18:19 +01:00
Alexander Neumann
460ebebeef Split out Node and Blob from tree.go 2015-02-03 21:07:55 +01:00