diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 4fa3a43..53add12 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -2,14 +2,5 @@ ### IMPROVEMENTS : -- [#102] Directory times are now set to the filesystem mount time. -- [#101] Application panic events are pushed to syslog. -- Option extra_attr renamed to attr. - -### FEATURE : - -- [#103] New option : xattr can now be used to handle extended attributes on files. - -### BUGFIX : - -- [#105] fsync(2) calls are now handled as a no-op. +- Auto detect uid and gid based on the current user. +- Allow redirecting stdout and stderr. diff --git a/svfs/cache.go b/svfs/cache.go index b02e8d2..cd00ec9 100644 --- a/svfs/cache.go +++ b/svfs/cache.go @@ -212,6 +212,7 @@ func (c *Cache) Set(container, path, name string, node Node) { // only relying on a hashmap with basic functions. type SimpleCache struct { changes map[string]Node + mutex sync.Mutex } // NewSimpleCache creates a new simplistic cache. @@ -227,20 +228,28 @@ func (c *SimpleCache) key(container, path string) string { // Add pushes a new cache entry. func (c *SimpleCache) Add(container, path string, node Node) { + c.mutex.Lock() + defer c.mutex.Unlock() c.changes[c.key(container, path)] = node } // Exist checks whether a cache key exist or not. func (c *SimpleCache) Exist(container, path string) bool { + c.mutex.Lock() + defer c.mutex.Unlock() return c.changes[c.key(container, path)] != nil } // Get retrieves a cache entry for the given key. func (c *SimpleCache) Get(container, path string) Node { + c.mutex.Lock() + defer c.mutex.Unlock() return c.changes[c.key(container, path)] } // Remove pops the cache entry at this key. func (c *SimpleCache) Remove(container, path string) { + c.mutex.Lock() + defer c.mutex.Unlock() delete(c.changes, c.key(container, path)) } diff --git a/svfs/swift.go b/svfs/swift.go index 4eb2978..49d6242 100644 --- a/svfs/swift.go +++ b/svfs/swift.go @@ -35,7 +35,11 @@ func initSegment(c, prefix string, id *uint, t *swift.Object, d []byte, up *uint } func createContainer(name string) (*swift.Container, error) { - err := SwiftConnection.ContainerCreate(name, nil) + headers := make(map[string]string) + if StoragePolicy != "" { + headers[storagePolicyHeader] = StoragePolicy + } + err := SwiftConnection.ContainerCreate(name, headers) if err != nil { return nil, err } diff --git a/svfs/version.go b/svfs/version.go index 6ab2137..e23c3c1 100644 --- a/svfs/version.go +++ b/svfs/version.go @@ -1,4 +1,4 @@ package svfs // Version is the current SVFS version -const Version = "0.9.0" +const Version = "0.9.1"