vfs_ceph: replace deprecated ceph_shutdown() call
authorDavid Disseldorp <ddiss@samba.org>
Wed, 8 Feb 2017 16:51:32 +0000 (17:51 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Wed, 15 Feb 2017 16:04:14 +0000 (17:04 +0100)
ceph_shutdown() is the equivalent to ceph_unmount() + ceph_release()
without error handling.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/modules/vfs_ceph.c

index 1cd364269b5e4df3b96f3220bcc7a1036dc332b0..5cdb37236736c4309c5b892c451def0d0180316a 100644 (file)
@@ -149,6 +149,8 @@ err_out:
 
 static void cephwrap_disconnect(struct vfs_handle_struct *handle)
 {
+       int ret;
+
        if (!cmount) {
                DBG_ERR("[CEPH] Error, ceph not mounted\n");
                return;
@@ -160,7 +162,15 @@ static void cephwrap_disconnect(struct vfs_handle_struct *handle)
                return;
        }
 
-       ceph_shutdown(cmount);
+       ret = ceph_unmount(cmount);
+       if (ret < 0) {
+               DBG_ERR("[CEPH] failed to unmount: %s\n", strerror(-ret));
+       }
+
+       ret = ceph_release(cmount);
+       if (ret < 0) {
+               DBG_ERR("[CEPH] failed to release: %s\n", strerror(-ret));
+       }
 
        cmount = NULL;  /* Make it safe */
 }