From 9078a77850dd680bfa938d9ed7c83600a60c0e7b Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 6 Feb 2016 19:27:59 +0100 Subject: [PATCH] Move pathfs_frontend to internal/fusefrontend "git status" for reference: renamed: pathfs_frontend/args.go -> internal/fusefrontend/args.go renamed: pathfs_frontend/compat_darwin.go -> internal/fusefrontend/compat_darwin.go renamed: pathfs_frontend/compat_linux.go -> internal/fusefrontend/compat_linux.go renamed: pathfs_frontend/file.go -> internal/fusefrontend/file.go renamed: pathfs_frontend/file_holes.go -> internal/fusefrontend/file_holes.go renamed: pathfs_frontend/fs.go -> internal/fusefrontend/fs.go renamed: pathfs_frontend/fs_dir.go -> internal/fusefrontend/fs_dir.go renamed: pathfs_frontend/names.go -> internal/fusefrontend/names.go renamed: pathfs_frontend/write_lock.go -> internal/fusefrontend/write_lock.go modified: main.go --- {pathfs_frontend => internal/fusefrontend}/args.go | 4 ++-- .../fusefrontend}/compat_darwin.go | 2 +- .../fusefrontend}/compat_linux.go | 2 +- {pathfs_frontend => internal/fusefrontend}/file.go | 2 +- .../fusefrontend}/file_holes.go | 2 +- {pathfs_frontend => internal/fusefrontend}/fs.go | 2 +- {pathfs_frontend => internal/fusefrontend}/fs_dir.go | 2 +- {pathfs_frontend => internal/fusefrontend}/names.go | 2 +- .../fusefrontend}/write_lock.go | 2 +- main.go | 12 ++++++------ 10 files changed, 16 insertions(+), 16 deletions(-) rename {pathfs_frontend => internal/fusefrontend}/args.go (63%) rename {pathfs_frontend => internal/fusefrontend}/compat_darwin.go (94%) rename {pathfs_frontend => internal/fusefrontend}/compat_linux.go (95%) rename {pathfs_frontend => internal/fusefrontend}/file.go (99%) rename {pathfs_frontend => internal/fusefrontend}/file_holes.go (97%) rename {pathfs_frontend => internal/fusefrontend}/fs.go (99%) rename {pathfs_frontend => internal/fusefrontend}/fs_dir.go (99%) rename {pathfs_frontend => internal/fusefrontend}/names.go (98%) rename {pathfs_frontend => internal/fusefrontend}/write_lock.go (98%) diff --git a/pathfs_frontend/args.go b/internal/fusefrontend/args.go similarity index 63% rename from pathfs_frontend/args.go rename to internal/fusefrontend/args.go index 91f9ba7..e8cab04 100644 --- a/pathfs_frontend/args.go +++ b/internal/fusefrontend/args.go @@ -1,6 +1,6 @@ -package pathfs_frontend +package fusefrontend -// Container for arguments that are passed from main() to pathfs_frontend +// Container for arguments that are passed from main() to fusefrontend type Args struct { Masterkey []byte Cipherdir string diff --git a/pathfs_frontend/compat_darwin.go b/internal/fusefrontend/compat_darwin.go similarity index 94% rename from pathfs_frontend/compat_darwin.go rename to internal/fusefrontend/compat_darwin.go index 3ddb50d..445fb45 100644 --- a/pathfs_frontend/compat_darwin.go +++ b/internal/fusefrontend/compat_darwin.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend // prealloc - preallocate space without changing the file size. This prevents // us from running out of space in the middle of an operation. diff --git a/pathfs_frontend/compat_linux.go b/internal/fusefrontend/compat_linux.go similarity index 95% rename from pathfs_frontend/compat_linux.go rename to internal/fusefrontend/compat_linux.go index 7ed3c74..4108792 100644 --- a/pathfs_frontend/compat_linux.go +++ b/internal/fusefrontend/compat_linux.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend import "syscall" diff --git a/pathfs_frontend/file.go b/internal/fusefrontend/file.go similarity index 99% rename from pathfs_frontend/file.go rename to internal/fusefrontend/file.go index 387eb35..2e0b504 100644 --- a/pathfs_frontend/file.go +++ b/internal/fusefrontend/file.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend // FUSE operations on file handles diff --git a/pathfs_frontend/file_holes.go b/internal/fusefrontend/file_holes.go similarity index 97% rename from pathfs_frontend/file_holes.go rename to internal/fusefrontend/file_holes.go index a147deb..0259ae9 100644 --- a/pathfs_frontend/file_holes.go +++ b/internal/fusefrontend/file_holes.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend // Helper functions for sparse files (files with holes) diff --git a/pathfs_frontend/fs.go b/internal/fusefrontend/fs.go similarity index 99% rename from pathfs_frontend/fs.go rename to internal/fusefrontend/fs.go index 212f0a7..0331215 100644 --- a/pathfs_frontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend // FUSE operations on paths diff --git a/pathfs_frontend/fs_dir.go b/internal/fusefrontend/fs_dir.go similarity index 99% rename from pathfs_frontend/fs_dir.go rename to internal/fusefrontend/fs_dir.go index d378d28..2b1e25d 100644 --- a/pathfs_frontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend // Mkdir and Rmdir diff --git a/pathfs_frontend/names.go b/internal/fusefrontend/names.go similarity index 98% rename from pathfs_frontend/names.go rename to internal/fusefrontend/names.go index 160fa0a..5760c87 100644 --- a/pathfs_frontend/names.go +++ b/internal/fusefrontend/names.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend // This file forwards file encryption operations to cryptfs diff --git a/pathfs_frontend/write_lock.go b/internal/fusefrontend/write_lock.go similarity index 98% rename from pathfs_frontend/write_lock.go rename to internal/fusefrontend/write_lock.go index 0704eb6..a8ec6b6 100644 --- a/pathfs_frontend/write_lock.go +++ b/internal/fusefrontend/write_lock.go @@ -1,4 +1,4 @@ -package pathfs_frontend +package fusefrontend import ( "sync" diff --git a/main.go b/main.go index 58e1155..e91e83f 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,7 @@ import ( "github.com/hanwen/go-fuse/fuse/nodefs" "github.com/hanwen/go-fuse/fuse/pathfs" - "github.com/rfjakob/gocryptfs/pathfs_frontend" + "github.com/rfjakob/gocryptfs/internal/fusefrontend" "github.com/rfjakob/gocryptfs/internal/configfile" "github.com/rfjakob/gocryptfs/internal/toggledlog" "github.com/rfjakob/gocryptfs/internal/nametransform" @@ -304,7 +304,7 @@ func main() { } // Initialize FUSE server toggledlog.Debug.Printf("cli args: %v", args) - srv := pathfsFrontend(masterkey, args, confFile) + srv := initFuseFrontend(masterkey, args, confFile) toggledlog.Info.Println(colorGreen + "Filesystem mounted and ready." + colorReset) // We are ready - send USR1 signal to our parent and switch to syslog if args.notifypid > 0 { @@ -324,13 +324,13 @@ func main() { // main exits with code 0 } -// pathfsFrontend - initialize gocryptfs/pathfs_frontend +// initFuseFrontend - initialize gocryptfs/fusefrontend // Calls os.Exit on errors -func pathfsFrontend(key []byte, args argContainer, confFile *configfile.ConfFile) *fuse.Server { +func initFuseFrontend(key []byte, args argContainer, confFile *configfile.ConfFile) *fuse.Server { // Reconciliate CLI and config file arguments into a Args struct that is passed to the // filesystem implementation - frontendArgs := pathfs_frontend.Args{ + frontendArgs := fusefrontend.Args{ Cipherdir: args.cipherdir, Masterkey: key, OpenSSL: args.openssl, @@ -359,7 +359,7 @@ func pathfsFrontend(key []byte, args argContainer, confFile *configfile.ConfFile jsonBytes, _ := json.MarshalIndent(frontendArgs, "", "\t") toggledlog.Debug.Printf("frontendArgs: %s", string(jsonBytes)) - finalFs := pathfs_frontend.NewFS(frontendArgs) + finalFs := fusefrontend.NewFS(frontendArgs) pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true} pathFs := pathfs.NewPathNodeFs(finalFs, pathFsOpts) fuseOpts := &nodefs.Options{