diff options
author | Yehuda Sadeh <yehuda@hq.newdream.net> | 2011-09-20 12:52:22 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@hq.newdream.net> | 2011-09-20 12:52:22 -0700 |
commit | 726a5830ff643a2733127b1a4466cb7bb064ce4d (patch) | |
tree | e85351f000d1977d482d444441326dd4f51aaed3 /src/cls_rgw.cc | |
parent | 73bc7713ad7b2ea85e5868c2132362b28d6a164e (diff) | |
download | ceph-726a5830ff643a2733127b1a4466cb7bb064ce4d.tar.gz |
rgw: Makefile changes, move around definitions
Diffstat (limited to 'src/cls_rgw.cc')
-rw-r--r-- | src/cls_rgw.cc | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/src/cls_rgw.cc b/src/cls_rgw.cc index 616d6d7db3d..55c847a3013 100644 --- a/src/cls_rgw.cc +++ b/src/cls_rgw.cc @@ -1,6 +1,3 @@ - - - #include <iostream> #include <string.h> @@ -10,6 +7,7 @@ #include "include/types.h" #include "include/utime.h" #include "objclass/objclass.h" +#include "rgw/rgw_cls_api.h" CLS_VER(1,0) CLS_NAME(rgw) @@ -18,72 +16,6 @@ cls_handle_t h_class; cls_method_handle_t h_rgw_bucket_list; cls_method_handle_t h_rgw_bucket_modify; -struct rgw_bucket_dir_entry { - std::string name; - uint64_t size; - utime_t mtime; - uint64_t epoch; - - void encode(bufferlist &bl) const { - __u8 struct_v = 1; - ::encode(struct_v, bl); - ::encode(name, bl); - ::encode(mtime, bl); - ::encode(epoch, bl); - } - void decode(bufferlist::iterator &bl) { - __u8 struct_v; - ::decode(struct_v, bl); - ::decode(name, bl); - ::decode(mtime, bl); - ::decode(epoch, bl); - } -}; -WRITE_CLASS_ENCODER(rgw_bucket_dir_entry) - -struct rgw_bucket_dir_header { - uint64_t total_size; - uint64_t num_entries; - - void encode(bufferlist &bl) const { - __u8 struct_v = 1; - ::encode(struct_v, bl); - ::encode(total_size, bl); - ::encode(num_entries, bl); - } - void decode(bufferlist::iterator &bl) { - __u8 struct_v; - ::decode(struct_v, bl); - ::decode(total_size, bl); - ::decode(num_entries, bl); - } -}; -WRITE_CLASS_ENCODER(rgw_bucket_dir_header) - -struct rgw_bucket_dir { - struct rgw_bucket_dir_header header; - std::map<string, struct rgw_bucket_dir_entry> m; - - void encode(bufferlist &bl) const { - __u8 struct_v = 1; - ::encode(struct_v, bl); - ::encode(header, bl); - ::encode(m, bl); - } - void decode(bufferlist::iterator &bl) { - __u8 struct_v; - ::decode(struct_v, bl); - ::decode(header, bl); - ::decode(m, bl); - } -}; -WRITE_CLASS_ENCODER(rgw_bucket_dir) - -enum modify_op { - CLS_RGW_OP_ADD = 0, - CLS_RGW_OP_DEL = 1, -}; - static int read_bucket_dir(cls_method_context_t hctx, struct rgw_bucket_dir& dir) { bufferlist bl; |