]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 7 Apr 2005 03:52:32 +0000 (03:52 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 7 Apr 2005 03:52:32 +0000 (03:52 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@139 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/client/Client.cc [new file with mode: 0644]
ceph/client/Client.h [new file with mode: 0644]
ceph/client/msgthread.h [new file with mode: 0644]

diff --git a/ceph/client/Client.cc b/ceph/client/Client.cc
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/client/Client.h b/ceph/client/Client.h
new file mode 100644 (file)
index 0000000..289aa83
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef __CLIENT_H
+#define __CLIENT_H
+
+#include "msg/Message.h"
+#include "msgthread.h"
+
+#include "include/types.h"
+
+#include <set>
+#include <map>
+#include <hash_map>
+using namespace std;
+
+// types for my local metadata cache
+struct Inode {
+};
+struct Dir {
+};
+struct Dentry {
+};
+
+// file handle for any open file state
+struct Fh {
+  inodeno_t ino;
+  //...
+};
+
+class Client {
+ protected:
+  // cache
+  map<inodeno_t, Inode*> inode_map;
+  Inode*                 root;
+
+  // file handles
+  map<fh_t, Fh*>         fh_map;
+
+  // global semaphore/mutex protecting cache+fh structures
+  // ??
+
+  
+ public:
+  Client();
+  ~Client();
+
+  // fs ops.
+  // these shoud (more or less) mirror the actual system calls.
+  int statfs(const char *path, struct statfs *stbuf);
+
+  // namespace ops
+  //?int getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler);
+  int link(const char *existing, const char *new);
+  int unlink(const char *path);
+  int rename(const char *from, const char *to);
+
+  // dirs
+  int mkdir(const char *path, mode_t mode);
+  int rmdir(const char *path);
+
+  // symlinks
+  int readlink(const char *path, char *buf, size_t size);
+  int symlink(const char *existing, const char *new);
+
+  // inode stuff
+  int getattr(const char *path, struct stat *stbuf);
+  int chmod(const char *path, mode_t mode);
+  int chown(const char *path, uid_t uid, gid_t gid);
+  int utime(const char *path, struct utimbuf *buf);
+  
+  // file ops
+  int mknod(const char *path, mode_t mode);
+  int open(const char *path, int mode);
+  int read(fh_t fh, char *buf, size_t size, off_t offset);
+  int write(fh_t fh, const char *buf, size_t size, off_t offset);
+  int truncate(fh_t fh, off_t size);
+  int fsync(fh_t fh);
+
+};
+
+#endif
diff --git a/ceph/client/msgthread.h b/ceph/client/msgthread.h
new file mode 100644 (file)
index 0000000..b4d415e
--- /dev/null
@@ -0,0 +1,11 @@
+#include "msg/Message.h"
+
+// send the message, expecting no response.  threads other than the
+// MPI thread use this function; if the MPI thread uses this function
+// it could deadlock: this function could wait for the out queue to be
+// emptied, but only the MPI thread can empty it.
+void obfsmpi_send(Message *m)
+
+// send the message to a server and wait for the response.  threads
+// other than the MPI thread use this function.
+Message *obfsmpi_sendrecv(Message *m)