Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cab5868

Browse files
rhtwhyrusleeping
authored andcommittedNov 20, 2015
Add config option for flatfs no-sync
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
1 parent 856e250 commit cab5868

File tree

9 files changed

+63
-43
lines changed

9 files changed

+63
-43
lines changed
 

‎Godeps/Godeps.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/jbenet/go-datastore/coalesce/coalesce.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/jbenet/go-datastore/elastigo/datastore.go

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/jbenet/go-datastore/flatfs/flatfs.go

+31-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/jbenet/go-datastore/flatfs/flatfs_test.go

+18-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/jbenet/go-datastore/lru/datastore_test.go

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Godeps/_workspace/src/github.com/jbenet/go-datastore/timecache/timecache.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎repo/config/datastore.go

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type Datastore struct {
1616
GCPeriod string // in ns, us, ms, s, m, h
1717

1818
Params *json.RawMessage
19+
NoSync bool
1920
}
2021

2122
func (d *Datastore) ParamData() []byte {

‎repo/fsrepo/defaultds.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func openDefaultDatastore(r *FSRepo) (repo.Datastore, error) {
3939
// including "/" from datastore.Key and 2 bytes from multihash. To
4040
// reach a uniform 256-way split, we need approximately 4 bytes of
4141
// prefix.
42-
blocksDS, err := flatfs.New(path.Join(r.path, flatfsDirectory), 4)
42+
syncfs := !r.config.Datastore.NoSync
43+
blocksDS, err := flatfs.New(path.Join(r.path, flatfsDirectory), 4, syncfs)
4344
if err != nil {
4445
return nil, fmt.Errorf("unable to open flatfs datastore: %v", err)
4546
}

0 commit comments

Comments
 (0)
Please sign in to comment.