]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: rename rgw_obj::key to rgw_obj::loc
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 6 Aug 2014 20:15:36 +0000 (13:15 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 16 Jan 2015 22:18:46 +0000 (14:18 -0800)
to avoid confusion

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_common.h
src/rgw/rgw_json_enc.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 95f251df361306f6c6d031d99990dd0472ec1564..5ccaff14f053357670cce038e4d59449918471a5 100644 (file)
@@ -1018,13 +1018,13 @@ WRITE_CLASS_ENCODER(RGWBucketEnt)
 
 class rgw_obj {
   std::string orig_obj;
-  std::string orig_key;
-  std::string key;
+  std::string orig_loc;
+  std::string loc;
   std::string object;
   std::string instance;
 public:
   const std::string& get_object() const { return object; }
-  const std::string& get_key() const { return key; }
+  const std::string& get_loc() const { return loc; }
   const std::string& get_instance() const { return instance; }
   rgw_bucket bucket;
   std::string ns;
@@ -1045,23 +1045,23 @@ public:
     bucket = b;
     set_ns(n);
     set_obj(o);
-    set_key(k);
+    set_loc(k);
   }
   void init(rgw_bucket& b, const std::string& o, const std::string& k) {
     bucket = b;
     set_obj(o);
-    set_key(k);
+    set_loc(k);
   }
   void init(rgw_bucket& b, const std::string& o) {
     bucket = b;
     set_obj(o);
-    orig_key = key = o;
+    orig_loc = loc = o;
   }
   void init_ns(rgw_bucket& b, const std::string& o, const std::string& n) {
     bucket = b;
     set_ns(n);
     set_obj(o);
-    reset_key();
+    reset_loc();
   }
   int set_ns(const char *n) {
     if (!n)
@@ -1076,21 +1076,22 @@ public:
     set_obj(orig_obj);
     return 0;
   }
-  void set_instance(const string& i) {
+  int set_instance(const string& i) {
     if (i[0] == '_')
       return -EINVAL;
     instance = i;
     set_obj(orig_obj);
+    return 0;
   }
 
-  void set_key(const string& k) {
-    orig_key = k;
-    key = k;
+  void set_loc(const string& k) {
+    orig_loc = k;
+    loc = k;
   }
 
-  void reset_key() {
-    orig_key.clear();
-    key.clear();
+  void reset_loc() {
+    orig_loc.clear();
+    loc.clear();
   }
 
   void set_obj(const string& o) {
@@ -1116,10 +1117,10 @@ public:
       object.append("_");
       object.append(o);
     }
-    if (orig_key.size())
-      set_key(orig_key);
+    if (orig_loc.size())
+      set_loc(orig_loc);
     else
-      set_key(orig_obj);
+      set_loc(orig_obj);
   }
 
   /*
@@ -1230,7 +1231,7 @@ public:
   void encode(bufferlist& bl) const {
     ENCODE_START(4, 3, bl);
     ::encode(bucket.name, bl);
-    ::encode(key, bl);
+    ::encode(loc, bl);
     ::encode(ns, bl);
     ::encode(object, bl);
     ::encode(bucket, bl);
@@ -1240,7 +1241,7 @@ public:
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(4, 3, 3, bl);
     ::decode(bucket.name, bl);
-    ::decode(key, bl);
+    ::decode(loc, bl);
     ::decode(ns, bl);
     ::decode(object, bl);
     if (struct_v >= 2)
index 423dbbfdefb9a5fca9cab230c7b2c9f5527444bb..bc3d19fc0b66cec0a9a8f4a134069bcd23aa787e 100644 (file)
@@ -593,7 +593,7 @@ void RGWUploadPartInfo::dump(Formatter *f) const
 void rgw_obj::dump(Formatter *f) const
 {
   encode_json("bucket", bucket, f);
-  encode_json("key", key, f);
+  encode_json("key", loc, f);
   encode_json("ns", ns, f);
   encode_json("object", object, f);
 }
index c3bffccfb8e40db625d1beaf0b540be7695df120..4f4708d959f23307869e675f17b3953042c6d0db 100644 (file)
@@ -6076,7 +6076,7 @@ int RGWRados::cls_obj_prepare_op(rgw_bucket& bucket, RGWModifyOp op, string& tag
     return r;
 
   ObjectWriteOperation o;
-  cls_rgw_bucket_prepare_op(o, op, tag, obj.get_index_key(), obj.get_instance(), obj.get_key(), zone_public_config.log_data);
+  cls_rgw_bucket_prepare_op(o, op, tag, obj.get_index_key(), obj.get_instance(), obj.get_loc(), zone_public_config.log_data);
   r = index_ctx.operate(oid, &o);
   return r;
 }
index e074ab1266c6db63aa1b550c5856dc7621591969..08d3a620775ecafc49a5be12f30c8b5560b470ab 100644 (file)
@@ -47,7 +47,7 @@ static inline void get_obj_bucket_and_oid_key(const rgw_obj& obj, rgw_bucket& bu
 {
   bucket = obj.bucket;
   prepend_bucket_marker(bucket, obj.get_object(), oid);
-  prepend_bucket_marker(bucket, obj.get_key(), key);
+  prepend_bucket_marker(bucket, obj.get_loc(), key);
 }
 
 int rgw_policy_from_attrset(CephContext *cct, map<string, bufferlist>& attrset, RGWAccessControlPolicy *policy);