From bff3004f5079f1fbc8f7c2a09a52e43e0610d17a Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Wed, 20 Apr 2011 11:55:24 -0700 Subject: [PATCH] Client: unmount should not be able to fail 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 --- src/client/Client.cc | 4 +--- src/client/Client.h | 2 +- src/client/SyntheticClient.cc | 4 ++-- src/client/libceph.h | 2 +- src/libceph.cc | 13 +++++-------- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index ff4dd4536859d..97f4ba6b5e49f 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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; } diff --git a/src/client/Client.h b/src/client/Client.h index e31237e2e3e1e..f1fde59d6a04c 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -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); diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index d3975f816e8d7..d4a60c86a2ea9 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -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; } diff --git a/src/client/libceph.h b/src/client/libceph.h index a35d5da4c17b0..6059e8729a79c 100644 --- a/src/client/libceph.h +++ b/src/client/libceph.h @@ -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); diff --git a/src/libceph.cc b/src/libceph.cc index aeb50c93b1d0b..32a3a7c4106ec 100644 --- a/src/libceph.cc +++ b/src/libceph.cc @@ -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, -- 2.39.5