fuse: Rename DirSnapshots -> SnapshotsDir

This commit is contained in:
Alexander Neumann 2017-06-18 17:06:27 +02:00
parent e60a96a71a
commit f8176a74ec
2 changed files with 10 additions and 10 deletions

View file

@ -28,7 +28,7 @@ type Root struct {
cfg Config cfg Config
inode uint64 inode uint64
snapshots restic.Snapshots snapshots restic.Snapshots
dirSnapshots *DirSnapshots dirSnapshots *SnapshotsDir
blobSizeCache *BlobSizeCache blobSizeCache *BlobSizeCache
} }

View file

@ -16,8 +16,8 @@ import (
"bazil.org/fuse/fs" "bazil.org/fuse/fs"
) )
// DirSnapshots is a fuse directory which contains snapshots. // SnapshotsDir is a fuse directory which contains snapshots.
type DirSnapshots struct { type SnapshotsDir struct {
inode uint64 inode uint64
root *Root root *Root
snapshots restic.Snapshots snapshots restic.Snapshots
@ -25,13 +25,13 @@ type DirSnapshots struct {
} }
// ensure that *DirSnapshots implements these interfaces // ensure that *DirSnapshots implements these interfaces
var _ = fs.HandleReadDirAller(&DirSnapshots{}) var _ = fs.HandleReadDirAller(&SnapshotsDir{})
var _ = fs.NodeStringLookuper(&DirSnapshots{}) var _ = fs.NodeStringLookuper(&SnapshotsDir{})
// NewDirSnapshots returns a new directory containing snapshots. // 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) debug.Log("create snapshots dir with %d snapshots, inode %d", len(snapshots), inode)
d := &DirSnapshots{ d := &SnapshotsDir{
root: root, root: root,
inode: inode, inode: inode,
snapshots: snapshots, snapshots: snapshots,
@ -56,7 +56,7 @@ func NewDirSnapshots(root *Root, inode uint64, snapshots restic.Snapshots) *DirS
} }
// Attr returns the attributes for the root node. // 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.Inode = d.inode
attr.Mode = os.ModeDir | 0555 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. // 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()") debug.Log("ReadDirAll()")
items := []fuse.Dirent{ 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. // 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) debug.Log("Lookup(%s)", name)
sn, ok := d.names[name] sn, ok := d.names[name]