]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Makefile: kill cls_trivialmap
authorSage Weil <sage@newdream.net>
Thu, 18 Jun 2009 20:24:09 +0000 (13:24 -0700)
committerSage Weil <sage@newdream.net>
Thu, 18 Jun 2009 20:24:09 +0000 (13:24 -0700)
src/Makefile.am
src/cls_trivialmap.cc [deleted file]

index 518465e648b010e4e3624de6c2aa247816f907ee..81024f3c2e68f616927edc41364e802465f29f34 100644 (file)
@@ -140,10 +140,6 @@ libcls_crypto.so: cls_crypto.cc
        ${CXX} -I. -fPIC -shared -g -o libcls_crypto.so -lcrypto cls_crypto.cc
 BUILT_SOURCES += libcls_crypto.so
 
-libcls_trivialmap.so: cls_trivialmap.cc
-       ${CXX} -I. -fPIC -shared -g -o libcls_trivialmap.so cls_trivialmap.cc
-BUILT_SOURCES += libcls_trivialmap.so
-
 libcls_acl.so: cls_acl.cc
        ${CXX} -I. -fPIC -shared -g -o libcls_acl.so cls_acl.cc
 BUILT_SOURCES += libcls_acl.so
diff --git a/src/cls_trivialmap.cc b/src/cls_trivialmap.cc
deleted file mode 100644 (file)
index c936f84..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-
-#include <iostream>
-#include <errno.h>
-
-#include "include/types.h"
-#include "objclass/objclass.h"
-
-
-CLS_VER(1,0)
-CLS_NAME(trivialmap)
-
-cls_handle_t h_class;
-cls_method_handle_t h_read_all;
-cls_method_handle_t h_update;
-
-static int read_all(cls_method_context_t ctx, bufferlist *inbl, bufferlist *outbl)
-{
-  return cls_cxx_read(ctx, 0, 0, outbl);
-}
-
-static int update(cls_method_context_t ctx, bufferlist *inbl, bufferlist *outbl)
-{
-  bufferlist::iterator ip = inbl->begin();
-
-  // read the whole object
-  bufferlist bl;
-  int r = cls_cxx_read(ctx, 0, 0, &bl);
-  if (r < 0)
-    return r;
-
-  // parse
-  bufferlist header;
-  map<nstring, bufferlist> m;
-  if (bl.length()) {
-    bufferlist::iterator p = bl.begin();
-    ::decode(header, p);
-    ::decode(m, p);
-    assert(p.end());
-  }
-  // do the update(s)
-  while (!ip.end()) {
-    __u8 op;
-    nstring key;
-    ::decode(op, ip);
-    ::decode(key, ip);
-    
-    switch (op) {
-    case 1: // insert key
-      {
-       bufferlist data;
-       ::decode(data, ip);
-       m[key] = data;
-      }
-      break;
-
-    case 2: // remove key
-      m.erase(key);
-      break;
-
-    case 3: // update header
-      {
-       ::decode(header, ip);
-      }
-      break;
-
-    default:
-      return -EINVAL;
-    }
-  }
-
-  // reencode
-  bufferlist obl;
-  ::encode(header, obl);
-  ::encode(m, obl);
-
-  // write it out
-  cls_cxx_replace(ctx, 0, obl.length(), &obl);
-
-  return 0;
-}
-
-
-void class_init()
-{
-   cls_register("trivialmap", &h_class);
-   cls_register_cxx_method(h_class, "read_all", CLS_METHOD_RD, read_all, &h_read_all);
-   cls_register_cxx_method(h_class, "update", CLS_METHOD_WR, update, &h_update);
-   return;
-}
-