summaryrefslogtreecommitdiff
path: root/netfs/fuse.h
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-10-30 21:10:06 +0000
committerrandomdan <randomdan@localhost>2010-10-30 21:10:06 +0000
commitadaab3c3caaddd8e6a829be9342679016e1d1b59 (patch)
tree03211c5e4c67fe977e239c8079040a4a44403f97 /netfs/fuse.h
parentMerge all FS operations into one interface (diff)
downloadnetfs-adaab3c3caaddd8e6a829be9342679016e1d1b59.tar.bz2
netfs-adaab3c3caaddd8e6a829be9342679016e1d1b59.tar.xz
netfs-adaab3c3caaddd8e6a829be9342679016e1d1b59.zip
Reopen files and directories on reauthentication
Diffstat (limited to 'netfs/fuse.h')
-rw-r--r--netfs/fuse.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/netfs/fuse.h b/netfs/fuse.h
index b890838..b16a67c 100644
--- a/netfs/fuse.h
+++ b/netfs/fuse.h
@@ -6,20 +6,44 @@
#include "fuseapp.h"
#include "fuseConfig.h"
#include "entCache.h"
+#include "intrusivePtrBase.h"
class NetFS : public FuseAppBase
{
- public:
+ 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();
// misc
int access(const char * p, int a);
int getattr(const char * p, struct stat * s);
@@ -49,7 +73,9 @@ class NetFS : public FuseAppBase
// fs
int statfs(const char *, struct statvfs *);
// stuff
- int onError(const std::exception & err) const throw();
+ int onError(const std::exception & err) throw();
+ int getNextFileID();
+ int getNextDirID();
ReqEnv reqEnv();
@@ -68,6 +94,10 @@ class NetFS : public FuseAppBase
std::string configPath;
EntCache entries;
+ OpenDirs openDirs;
+ int openDirID;
+ OpenFiles openFiles;
+ int openFileID;
};
#endif