projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 3112-report-bug
[arvados.git]
/
services
/
keepstore
/
volume_unix.go
diff --git
a/services/keepstore/volume_unix.go
b/services/keepstore/volume_unix.go
index 0cebe4369524ede3ca6fd785d9cf5b3d849acc6c..75a75229a6861f83f45b9264bab9d577d7d0f880 100644
(file)
--- a/
services/keepstore/volume_unix.go
+++ b/
services/keepstore/volume_unix.go
@@
-103,13
+103,24
@@
func (v *UnixVolume) Touch(loc string) error {
if err != nil {
return err
}
if err != nil {
return err
}
- lockfile(f)
+ if e := lockfile(f); e != nil {
+ return e
+ }
defer unlockfile(f)
now := time.Now().Unix()
utime := syscall.Utimbuf{now, now}
return syscall.Utime(p, &utime)
}
defer unlockfile(f)
now := time.Now().Unix()
utime := syscall.Utimbuf{now, now}
return syscall.Utime(p, &utime)
}
+func (v *UnixVolume) Mtime(loc string) (time.Time, error) {
+ p := v.blockPath(loc)
+ if fi, err := os.Stat(p); err != nil {
+ return time.Time{}, err
+ } else {
+ return fi.ModTime(), nil
+ }
+}
+
// Read retrieves a block identified by the locator string "loc", and
// returns its contents as a byte slice.
//
// Read retrieves a block identified by the locator string "loc", and
// returns its contents as a byte slice.
//
@@
-248,7
+259,9
@@
func (v *UnixVolume) Delete(loc string) error {
if err != nil {
return err
}
if err != nil {
return err
}
- lockfile(f)
+ if e := lockfile(f); e != nil {
+ return e
+ }
defer unlockfile(f)
// If the block has been PUT more recently than -permission_ttl,
defer unlockfile(f)
// If the block has been PUT more recently than -permission_ttl,