summaryrefslogtreecommitdiff
path: root/netfs/fuse.h
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/fuse.h')
-rw-r--r--netfs/fuse.h113
1 files changed, 0 insertions, 113 deletions
diff --git a/netfs/fuse.h b/netfs/fuse.h
deleted file mode 100644
index 4a0abfd..0000000
--- a/netfs/fuse.h
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef FUSE_H
-#define FUSE_H
-
-#include <boost/thread/mutex.hpp>
-#include <Ice/Ice.h>
-#include "netfsComms.h"
-#include "fuseapp.h"
-#include "fuseConfig.h"
-#include "entCache.h"
-#include "intrusivePtrBase.h"
-
-#define LOCK boost::unique_lock<boost::mutex> _lck(_lock)
-
-class NetFS : public FuseAppBase
-{
- private:
- class ReqEnv : public NetFSComms::ReqEnv {
- public:
- ReqEnv(const NetFS *);
- };
-
- class OpenDir : public IntrusivePtrBase {
- public:
- OpenDir(Ice::Int remoteID, const std::string & path);
-
- Ice::Int remoteID;
- const std::string path;
- };
- typedef boost::intrusive_ptr<OpenDir> OpenDirPtr;
- typedef std::map<int, OpenDirPtr> OpenDirs;
-
- class OpenFile : public IntrusivePtrBase {
- public:
- OpenFile(Ice::Int remoteID, const std::string & path, int flags);
-
- Ice::Int remoteID;
- const std::string path;
- const int flags;
- };
- typedef boost::intrusive_ptr<OpenFile> OpenFilePtr;
- typedef std::map<int, OpenFilePtr> OpenFiles;
-
- public:
- NetFS(int & argc, char ** argv);
- ~NetFS();
- private:
- void * init (struct fuse_conn_info * info);
- int opt_parse(void *, const char * arg, int key, struct fuse_args *);
- void connect();
- void connect_nl();
- public:
- // misc
- int access(const char * p, int a);
- int getattr(const char * p, struct stat * s);
- int fgetattr(const char *, struct stat *, struct fuse_file_info *);
- int chmod(const char *, mode_t);
- int chown(const char *, uid_t, gid_t);
- int link(const char *, const char *);
- int readlink(const char *, char *, size_t);
- int rename(const char *, const char *);
- int symlink(const char *, const char *);
- int unlink(const char *);
- int utimens(const char *, const struct timespec tv[2]);
- // dirs
- int opendir(const char * p, struct fuse_file_info * fi);
- int releasedir(const char *, struct fuse_file_info * fi);
- int readdir(const char *, void * buf, fuse_fill_dir_t filler, off_t, struct fuse_file_info * fi);
- int mkdir(const char *, mode_t);
- int rmdir(const char *);
- // files
- int open(const char * p, struct fuse_file_info * fi);
- int create(const char *, mode_t, struct fuse_file_info *);
- int release(const char *, struct fuse_file_info * fi);
- int read(const char *, char * buf, size_t s, off_t o, struct fuse_file_info * fi);
- int write(const char *, const char * buf, size_t s, off_t o, struct fuse_file_info * fi);
- int truncate(const char *, off_t);
- int ftruncate(const char *, off_t, struct fuse_file_info *);
- // fs
- int statfs(const char *, struct statvfs *);
- // stuff
- int onError(const std::exception & err) throw();
- private:
- int getNextFileID();
- Ice::Int getRemoteIDforFile(int localID) const;
- int getNextDirID();
- Ice::Int getRemoteIDforDir(int localID) const;
-
- ReqEnv reqEnv();
-
- int & _argc;
- char ** _argv;
- Ice::CommunicatorPtr ic;
- FuseConfigPtr fc;
- mutable boost::mutex _lock;
-
- NetFSComms::FileSystemPrx filesystem;
- NetFSComms::ServicePrx service;
-
- mutable Ice::Long authtok;
-
- std::string mountPoint;
- std::string exportName;
- std::string configPath;
-
- UserEntCache uentries;
- GroupEntCache gentries;
- OpenDirs openDirs;
- int openDirID;
- OpenFiles openFiles;
- int openFileID;
-};
-
-#endif