From f8176a74ec9ab129a19113ce1b99d272185d27fb Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 18 Jun 2017 17:06:27 +0200 Subject: [PATCH] fuse: Rename DirSnapshots -> SnapshotsDir --- src/restic/fuse/root.go | 2 +- .../{dir_snapshots.go => snapshots_dir.go} | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) rename src/restic/fuse/{dir_snapshots.go => snapshots_dir.go} (82%) diff --git a/src/restic/fuse/root.go b/src/restic/fuse/root.go index bf3fa9068..39a148c19 100644 --- a/src/restic/fuse/root.go +++ b/src/restic/fuse/root.go @@ -28,7 +28,7 @@ type Root struct { cfg Config inode uint64 snapshots restic.Snapshots - dirSnapshots *DirSnapshots + dirSnapshots *SnapshotsDir blobSizeCache *BlobSizeCache } diff --git a/src/restic/fuse/dir_snapshots.go b/src/restic/fuse/snapshots_dir.go similarity index 82% rename from src/restic/fuse/dir_snapshots.go rename to src/restic/fuse/snapshots_dir.go index e739f9ab2..39f07f3ba 100644 --- a/src/restic/fuse/dir_snapshots.go +++ b/src/restic/fuse/snapshots_dir.go @@ -16,8 +16,8 @@ import ( "bazil.org/fuse/fs" ) -// DirSnapshots is a fuse directory which contains snapshots. -type DirSnapshots struct { +// SnapshotsDir is a fuse directory which contains snapshots. +type SnapshotsDir struct { inode uint64 root *Root snapshots restic.Snapshots @@ -25,13 +25,13 @@ type DirSnapshots struct { } // ensure that *DirSnapshots implements these interfaces -var _ = fs.HandleReadDirAller(&DirSnapshots{}) -var _ = fs.NodeStringLookuper(&DirSnapshots{}) +var _ = fs.HandleReadDirAller(&SnapshotsDir{}) +var _ = fs.NodeStringLookuper(&SnapshotsDir{}) // NewDirSnapshots returns a new directory containing snapshots. -func NewDirSnapshots(root *Root, inode uint64, snapshots restic.Snapshots) *DirSnapshots { +func NewDirSnapshots(root *Root, inode uint64, snapshots restic.Snapshots) *SnapshotsDir { debug.Log("create snapshots dir with %d snapshots, inode %d", len(snapshots), inode) - d := &DirSnapshots{ + d := &SnapshotsDir{ root: root, inode: inode, snapshots: snapshots, @@ -56,7 +56,7 @@ func NewDirSnapshots(root *Root, inode uint64, snapshots restic.Snapshots) *DirS } // Attr returns the attributes for the root node. -func (d *DirSnapshots) Attr(ctx context.Context, attr *fuse.Attr) error { +func (d *SnapshotsDir) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Inode = d.inode attr.Mode = os.ModeDir | 0555 @@ -69,7 +69,7 @@ func (d *DirSnapshots) Attr(ctx context.Context, attr *fuse.Attr) error { } // ReadDirAll returns all entries of the root node. -func (d *DirSnapshots) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { +func (d *SnapshotsDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { debug.Log("ReadDirAll()") items := []fuse.Dirent{ { @@ -96,7 +96,7 @@ func (d *DirSnapshots) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { } // Lookup returns a specific entry from the root node. -func (d *DirSnapshots) Lookup(ctx context.Context, name string) (fs.Node, error) { +func (d *SnapshotsDir) Lookup(ctx context.Context, name string) (fs.Node, error) { debug.Log("Lookup(%s)", name) sn, ok := d.names[name]