aboutsummaryrefslogtreecommitdiff
path: root/weed/filer2/filer.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-05-27 11:52:26 -0700
committerChris Lu <chris.lu@gmail.com>2018-05-27 11:52:26 -0700
commit458ada173ed6df2933c35fe0d3e3dd9457d3a975 (patch)
tree30f174c167b3299eedde32419ad1894f43cd544d /weed/filer2/filer.go
parent8647191bee2027232105b20b5c110ffda225f9ba (diff)
downloadseaweedfs-458ada173ed6df2933c35fe0d3e3dd9457d3a975.tar.xz
seaweedfs-458ada173ed6df2933c35fe0d3e3dd9457d3a975.zip
go fmt
Diffstat (limited to 'weed/filer2/filer.go')
-rw-r--r--weed/filer2/filer.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go
index 35d69b32e..f182adb13 100644
--- a/weed/filer2/filer.go
+++ b/weed/filer2/filer.go
@@ -3,12 +3,12 @@ package filer2
import (
"fmt"
+ "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/karlseguin/ccache"
- "strings"
+ "os"
"path/filepath"
+ "strings"
"time"
- "os"
- "github.com/chrislusf/seaweedfs/weed/glog"
)
type Filer struct {
@@ -24,15 +24,15 @@ func NewFiler(master string) *Filer {
}
}
-func (f *Filer) SetStore(store FilerStore) () {
+func (f *Filer) SetStore(store FilerStore) {
f.store = store
}
-func (f *Filer) DisableDirectoryCache() () {
+func (f *Filer) DisableDirectoryCache() {
f.directoryCache = nil
}
-func (f *Filer) CreateEntry(entry *Entry) (error) {
+func (f *Filer) CreateEntry(entry *Entry) error {
dirParts := strings.Split(string(entry.FullPath), "/")
@@ -94,11 +94,11 @@ func (f *Filer) CreateEntry(entry *Entry) (error) {
}
/*
- if !hasWritePermission(lastDirectoryEntry, entry) {
- glog.V(0).Infof("directory %s: %v, entry: uid=%d gid=%d",
- lastDirectoryEntry.FullPath, lastDirectoryEntry.Attr, entry.Uid, entry.Gid)
- return fmt.Errorf("no write permission in folder %v", lastDirectoryEntry.FullPath)
- }
+ if !hasWritePermission(lastDirectoryEntry, entry) {
+ glog.V(0).Infof("directory %s: %v, entry: uid=%d gid=%d",
+ lastDirectoryEntry.FullPath, lastDirectoryEntry.Attr, entry.Uid, entry.Gid)
+ return fmt.Errorf("no write permission in folder %v", lastDirectoryEntry.FullPath)
+ }
*/
if err := f.store.InsertEntry(entry); err != nil {
@@ -135,12 +135,12 @@ func (f *Filer) DeleteEntry(p FullPath) (fileEntry *Entry, err error) {
func (f *Filer) ListDirectoryEntries(p FullPath, startFileName string, inclusive bool, limit int) ([]*Entry, error) {
if strings.HasSuffix(string(p), "/") && len(p) > 1 {
- p = p[0:len(p)-1]
+ p = p[0 : len(p)-1]
}
return f.store.ListDirectoryEntries(p, startFileName, inclusive, limit)
}
-func (f *Filer) cacheGetDirectory(dirpath string) (*Entry) {
+func (f *Filer) cacheGetDirectory(dirpath string) *Entry {
if f.directoryCache == nil {
return nil
}