]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: dispatch RGWDeleteRequest in object branch in rgw_unlink().
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 28 Oct 2015 23:10:10 +0000 (19:10 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 17:05:22 +0000 (12:05 -0500)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.cc

index 298eea88dca630df3522c94779df0ebb4ae3a7c1..89e84e8e982d01e4620a36df9f48ff3d5f8775e3 100644 (file)
@@ -145,16 +145,14 @@ int rgw_rename(struct rgw_fs *rgw_fs,
 int rgw_unlink(struct rgw_fs *rgw_fs, struct rgw_file_handle* parent,
              const char* path)
 {
-  /* XXXX remove uri and deal with bucket and object names */
-  string uri;
   int rc = 0;
 
   RGWLibFS *fs = static_cast<RGWLibFS*>(rgw_fs->fs_private);
   CephContext* cct = static_cast<CephContext*>(rgw_fs->rgw);
 
   if (fs->is_root(rgw_fs)) {
-    /* for now, root always contains one user's bucket namespace */
-    uri = "/";
+    /* XXXX remove uri and deal with bucket and object names */
+    string uri = "/";
     uri += path;
     RGWDeleteBucketRequest req(cct, fs->get_user(), uri);
     rc = librgw.get_fe()->execute_req(&req);
@@ -162,9 +160,8 @@ int rgw_unlink(struct rgw_fs *rgw_fs, struct rgw_file_handle* parent,
     /*
      * object
      */
-      /* TODO: implement
-       * RGWDeleteObjectRequest req(cct, fs->get_user(), uri);
-      */
+    RGWDeleteObjRequest req(cct, fs->get_user(), "/", path);
+    rc = librgw.get_fe()->execute_req(&req);
   }
 
   return rc;