]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Client: unmount should not be able to fail
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 20 Apr 2011 18:55:24 +0000 (11:55 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 25 Apr 2011 18:05:43 +0000 (11:05 -0700)
If unmount fails, what is the API users supposed to do?
The client needs to be able to clean up after itself.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/client/Client.cc
src/client/Client.h
src/client/SyntheticClient.cc
src/client/libceph.h
src/libceph.cc

index ff4dd4536859d2ed7e5ac743cc0357372cd4e08e..97f4ba6b5e49f7e848be259ee86038d78ca11eee 100644 (file)
@@ -3021,7 +3021,7 @@ int Client::mount(const std::string &mount_root)
 
 // UNMOUNT
 
-int Client::unmount()
+void Client::unmount()
 {
   Mutex::Locker lock(client_lock);
 
@@ -3142,8 +3142,6 @@ int Client::unmount()
   dout(2) << "unmounted." << dendl;
 
   objecter->shutdown();
-
-  return 0;
 }
 
 
index e31237e2e3e1ebebf05652b4ee9ce9088ca1cd09..f1fde59d6a04c025b0ea978c814337bd2f9e6508 100644 (file)
@@ -1223,7 +1223,7 @@ private:
 
 public:
   int mount(const std::string &mount_root);
-  int unmount();
+  void unmount();
 
   // these shoud (more or less) mirror the actual system calls.
   int statfs(const char *path, struct statvfs *stbuf);
index d3975f816e8d7e79663c706f5b48a1ffff8772a6..d4a60c86a2ea994ac13d6c4cf7b92513e17314dc 100644 (file)
@@ -928,8 +928,8 @@ int SyntheticClient::run()
   }
   dout(1) << "syn done, unmounting " << dendl;
 
-  if (client->unmount() == 0)
-    client->shutdown();
+  client->unmount();
+  client->shutdown();
   return 0;
 }
 
index a35d5da4c17b0edb9b5e27bb89166aac0a3fb8f9..6059e8729a79cbf5e026f99cf75e28d06b94fd93 100644 (file)
@@ -78,7 +78,7 @@ int ceph_conf_set(ceph_cluster_t *cluster, const char *option, const char *value
 int ceph_conf_get(ceph_cluster_t *cluster, const char *option, char *buf, size_t len);
 
 int ceph_mount(ceph_cluster_t *cluster, const char *root);
-int ceph_umount(ceph_cluster_t *cluster);
+void ceph_umount(ceph_cluster_t *cluster);
 
 int ceph_statfs(ceph_cluster_t *cluster, const char *path, struct statvfs *stbuf);
 int ceph_get_local_osd(ceph_cluster_t *cluster);
index aeb50c93b1d0b9ae4ff2bd709cf8591e0b2289c9..32a3a7c4106ec776ceb43339947a7dc9c667541f 100644 (file)
@@ -161,15 +161,12 @@ public:
     return 0;
   }
 
-  int umount()
+  void umount()
   {
     if (!mounted)
-      return -EINVAL;
-    int ret = client->unmount();
-    if (ret)
-      return ret;
+      return;
+    client->unmount();
     mounted = false;
-    return 0;
   }
 
   Client *get_client()
@@ -288,9 +285,9 @@ extern "C" int ceph_mount(ceph_cluster_t *cluster, const char *root)
   return cluster->mount(mount_root);
 }
 
-extern "C" int ceph_umount(ceph_cluster_t *cluster)
+extern "C" void ceph_umount(ceph_cluster_t *cluster)
 {
-  return cluster->umount();
+  cluster->umount();
 }
 
 extern "C" int ceph_statfs(ceph_cluster_t *cluster, const char *path,