diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-05-18 10:31:12 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-05-18 10:31:12 -0700 |
| commit | ac48c899e8ccf959940b11033c2222796519386f (patch) | |
| tree | c09452048bc2c68a2933feed4bec9b50516ed0df /weed/command/mount_std.go | |
| parent | 0c856e838792c22476d87ba6e8a03f85d8cf71b5 (diff) | |
| download | seaweedfs-ac48c899e8ccf959940b11033c2222796519386f.tar.xz seaweedfs-ac48c899e8ccf959940b11033c2222796519386f.zip | |
add printouts for synchronizing metadata which can be slow for large folders
Diffstat (limited to 'weed/command/mount_std.go')
| -rw-r--r-- | weed/command/mount_std.go | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index 550921188..3d2f267bc 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -141,26 +141,13 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { options = append(options, fuse.AllowNonEmptyMount()) } - // mount - c, err := fuse.Mount(dir, options...) - if err != nil { - glog.V(0).Infof("mount: %v", err) - return true - } - defer fuse.Unmount(dir) - - grace.OnInterrupt(func() { - fuse.Unmount(dir) - c.Close() - }) - // find mount point mountRoot := filerMountRootPath if mountRoot != "/" && strings.HasSuffix(mountRoot, "/") { mountRoot = mountRoot[0 : len(mountRoot)-1] } - err = fs.Serve(c, filesys.NewSeaweedFileSystem(&filesys.Option{ + seaweedFileSystem := filesys.NewSeaweedFileSystem(&filesys.Option{ FilerGrpcAddress: filerGrpcAddress, GrpcDialOption: grpcDialOption, FilerMountRootPath: mountRoot, @@ -182,7 +169,23 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { OutsideContainerClusterMode: *mountOptions.outsideContainerClusterMode, AsyncMetaDataCaching: *mountOptions.asyncMetaDataCaching, Cipher: cipher, - })) + }) + + // mount + c, err := fuse.Mount(dir, options...) + if err != nil { + glog.V(0).Infof("mount: %v", err) + return true + } + defer fuse.Unmount(dir) + + grace.OnInterrupt(func() { + fuse.Unmount(dir) + c.Close() + }) + + glog.V(0).Infof("mounted %s%s to %s", filer, mountRoot, dir) + err = fs.Serve(c, seaweedFileSystem) // check if the mount process has an error to report <-c.Ready |
