diff --git a/weed/command/mount.go b/weed/command/mount.go index dc279a529..37bf2d15a 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -31,7 +31,7 @@ type MountOptions struct { uidMap *string gidMap *string readOnly *bool - showSystemEntries *bool + includeSystemEntries *bool debug *bool debugPort *int localSocket *string @@ -100,7 +100,7 @@ func init() { mountOptions.uidMap = cmdMount.Flag.String("map.uid", "", "map local uid to uid on filer, comma-separated :") mountOptions.gidMap = cmdMount.Flag.String("map.gid", "", "map local gid to gid on filer, comma-separated :") mountOptions.readOnly = cmdMount.Flag.Bool("readOnly", false, "read only") - mountOptions.showSystemEntries = cmdMount.Flag.Bool("showSystemEntries", false, "show filer system entries (e.g. /topics, /etc) in directory listings") + mountOptions.includeSystemEntries = cmdMount.Flag.Bool("includeSystemEntries", false, "show filer system entries (e.g. /topics, /etc) in directory listings") mountOptions.debug = cmdMount.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:/debug/pprof/goroutine?debug=2") mountOptions.debugPort = cmdMount.Flag.Int("debug.port", 6061, "http port for debugging") mountOptions.localSocket = cmdMount.Flag.String("localSocket", "", "default to /tmp/seaweedfs-mount-.sock") diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index 6e1a97215..8cb617fbf 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -340,7 +340,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { VolumeServerAccess: *mountOptions.volumeServerAccess, Cipher: cipher, UidGidMapper: uidGidMapper, - ShowSystemEntries: *option.showSystemEntries, + IncludeSystemEntries: *option.includeSystemEntries, DisableXAttr: *option.disableXAttr, IsMacOs: runtime.GOOS == "darwin", MetadataFlushSeconds: *option.metadataFlushSeconds, diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index a1514d686..877d73f48 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -65,7 +65,7 @@ type Option struct { VolumeServerAccess string // how to access volume servers Cipher bool // whether encrypt data on volume server UidGidMapper *meta_cache.UidGidMapper - ShowSystemEntries bool + IncludeSystemEntries bool // Periodic metadata flush interval in seconds (0 to disable) // This protects chunks from being purged by volume.fsck for long-running writes @@ -204,7 +204,7 @@ func NewSeaweedFileSystem(option *Option) *WFS { wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.getUniqueCacheDirForRead(), "meta"), option.UidGidMapper, util.FullPath(option.FilerMountRootPath), - option.ShowSystemEntries, + option.IncludeSystemEntries, func(path util.FullPath) { wfs.inodeToPath.MarkChildrenCached(path) }, func(path util.FullPath) bool { diff --git a/weed/mount/weedfs_dir_read.go b/weed/mount/weedfs_dir_read.go index 9fc342b64..488a69f38 100644 --- a/weed/mount/weedfs_dir_read.go +++ b/weed/mount/weedfs_dir_read.go @@ -302,7 +302,7 @@ func (wfs *WFS) readDirectoryDirect(input *fuse.ReadIn, out *fuse.DirEntryList, if input.Offset >= dh.entryStreamOffset { if len(dh.entryStream) == 0 && input.Offset > dh.entryStreamOffset { skipCount := uint32(input.Offset-dh.entryStreamOffset) + batchSize - entries, snapshotTs, err := loadDirectoryEntriesDirect(context.Background(), wfs, wfs.option.UidGidMapper, dirPath, "", false, skipCount, dh.snapshotTsNs, wfs.option.ShowSystemEntries) + entries, snapshotTs, err := loadDirectoryEntriesDirect(context.Background(), wfs, wfs.option.UidGidMapper, dirPath, "", false, skipCount, dh.snapshotTsNs, wfs.option.IncludeSystemEntries) if err != nil { glog.Errorf("list filer directory: %v", err) return fuse.EIO @@ -331,7 +331,7 @@ func (wfs *WFS) readDirectoryDirect(input *fuse.ReadIn, out *fuse.DirEntryList, } } - entries, snapshotTs, err := loadDirectoryEntriesDirect(context.Background(), wfs, wfs.option.UidGidMapper, dirPath, lastEntryName, false, batchSize, dh.snapshotTsNs, wfs.option.ShowSystemEntries) + entries, snapshotTs, err := loadDirectoryEntriesDirect(context.Background(), wfs, wfs.option.UidGidMapper, dirPath, lastEntryName, false, batchSize, dh.snapshotTsNs, wfs.option.IncludeSystemEntries) if err != nil { glog.Errorf("list filer directory: %v", err) return fuse.EIO @@ -360,13 +360,13 @@ func (wfs *WFS) readDirectoryDirect(input *fuse.ReadIn, out *fuse.DirEntryList, return fuse.OK } -func loadDirectoryEntriesDirect(ctx context.Context, client filer_pb.FilerClient, uidGidMapper *meta_cache.UidGidMapper, dirPath util.FullPath, startFileName string, includeStart bool, limit uint32, snapshotTsNs int64, showSystemEntries bool) ([]*filer.Entry, int64, error) { +func loadDirectoryEntriesDirect(ctx context.Context, client filer_pb.FilerClient, uidGidMapper *meta_cache.UidGidMapper, dirPath util.FullPath, startFileName string, includeStart bool, limit uint32, snapshotTsNs int64, includeSystemEntries bool) ([]*filer.Entry, int64, error) { entries := make([]*filer.Entry, 0, limit) var actualSnapshotTsNs int64 err := client.WithFilerClient(false, func(sc filer_pb.SeaweedFilerClient) error { var innerErr error actualSnapshotTsNs, innerErr = filer_pb.DoSeaweedListWithSnapshot(ctx, sc, dirPath, "", func(entry *filer_pb.Entry, isLast bool) error { - if !showSystemEntries && meta_cache.IsHiddenSystemEntry(string(dirPath), entry.Name) { + if !includeSystemEntries && meta_cache.IsHiddenSystemEntry(string(dirPath), entry.Name) { return nil } if uidGidMapper != nil && entry.Attributes != nil {