]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 17 Jul 2005 18:11:21 +0000 (18:11 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 17 Jul 2005 18:11:21 +0000 (18:11 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@462 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/mds/CInode.h
ceph/mds/Capability.h [new file with mode: 0644]

index fe9500117a468b67ec783b6554a46ac92b6b2767..b2fe4d3f0657d653faed8489ccdcbf545d22014b 100644 (file)
@@ -202,6 +202,9 @@ class CInode : LRUObject {
   // waiters
   multimap<int,Context*>  waiting;
 
+  // issued client capabilities
+  map<int, Capability>  caps;
+
   // open file state (me)
   map<fileh_t, CFile*>  fh_map;                   // locally opened files
   int                   nrdonly, nrdwr, nwronly;  // file mode counts
@@ -397,8 +400,18 @@ class CInode : LRUObject {
   void finish_waiting(int mask, int result = 0);
 
 
+  // -- caps -- (new)
+  bool is_caps_issued() { return !caps.empty(); }
+  void add_cap(int client, Capability& cap) {
+       assert(caps.count(client) == 0);
+       caps[client] = cap;
+  }
+  void remove_cap(int client) {
+       assert(caps.count(client) == 1);
+       caps.erase(client);
+  }
 
-  // -- open files --
+  // -- open files -- (old)
   bool is_open_write() { return nwronly; }
   bool is_open_read() { return nrdonly; }
   bool is_open() { return is_open_write() || is_open_read(); }
diff --git a/ceph/mds/Capability.h b/ceph/mds/Capability.h
new file mode 100644 (file)
index 0000000..a05aa25
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __CAPABILITY_H
+#define __CAPABILITY_H
+
+// definite caps
+#define CAP_FILE_RDCACHE   1
+#define CAP_FILE_RD        2
+#define CAP_FILE_WR        4
+#define CAP_FILE_WRBUFFER  8
+#define CAP_INODE_STAT    16
+
+// heuristics
+#define CAP_FILE_DELAYFLUSH  32
+
+class Capability {
+  int wanted_caps;     // what the client wants
+  int pending_caps;    // what we've sent them
+  int confirmed_caps;  // what they've confirmed they've received
+
+  Capability(int wants = 0) :
+       wanted_caps(wants),
+       pending_caps(0),
+       confirmed_caps(0) { }
+};
+
+
+
+
+
+#endif