From 3a67b6ddc17ae8bca7c3930749e0da2fbcf30c82 Mon Sep 17 00:00:00 2001 From: sparklxb Date: Fri, 10 Mar 2017 14:45:53 +0800 Subject: [PATCH] complement weed mount --- weed/command/mount_std.go | 9 +-------- weed/server/filer_server_handlers_api.go | 6 +----- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index bd3b6a490..61f8119f7 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -107,8 +107,6 @@ func (dir *Dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { return ret, nil } -const greeting = "hello, world\n" - type File struct { Id uint64 // FileId filer.FileId @@ -117,11 +115,6 @@ type File struct { func (file *File) Attr(context context.Context, attr *fuse.Attr) error { attr.Inode = file.Id - attr.Mode = 0444 - attr.Size = uint64(len(greeting)) + attr.Mode = 0000 return nil } - -func (file *File) ReadAll(ctx context.Context) ([]byte, error) { - return []byte(greeting), nil -} diff --git a/weed/server/filer_server_handlers_api.go b/weed/server/filer_server_handlers_api.go index fe82827f4..f2a64e6cb 100644 --- a/weed/server/filer_server_handlers_api.go +++ b/weed/server/filer_server_handlers_api.go @@ -27,11 +27,7 @@ func (fs *FilerServer) apiHandler(w http.ResponseWriter, r *http.Request) { writeJsonQuiet(w, r, http.StatusOK, res) case "listFiles": res := filer.ListFilesResult{} - limit := 1 - if len(apiRequest.FileName) == 0 { - limit = 100 - } - res.Files, err = fs.filer.ListFiles(apiRequest.Directory, apiRequest.FileName, limit) + res.Files, err = fs.filer.ListFiles(apiRequest.Directory, apiRequest.FileName, 100) if err != nil { res.Error = err.Error() }