]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use CEPHFS_E*
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 12 Sep 2022 13:05:33 +0000 (13:05 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 10 Nov 2022 07:38:14 +0000 (09:38 +0200)
The cephfs client uses CEPHFS_E* errors, except for a few methods
that are still using errno values.

We're addressing this inconsistency.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/client/Client.cc

index b1f20c8e7550b2bdfcdfcbf989f6dc0ee343728a..21921715c062e37e73e7c0930e337f048f930443 100644 (file)
@@ -2539,7 +2539,7 @@ ref_t<MClientRequest> Client::build_client_request(MetaRequest *request)
   int max_retry = sizeof(((struct ceph_mds_request_head*)0)->num_retry);
   max_retry = 1 << (max_retry * CHAR_BIT);
   if (request->retry_attempt >= max_retry) {
-    request->abort(-EMULTIHOP);
+    request->abort(-CEPHFS_EMULTIHOP);
     request->caller_cond->notify_all();
     ldout(cct, 1) << __func__ << " request tid " << request->tid
                   << " seq overflow" << ", abort it" << dendl;
@@ -2623,7 +2623,7 @@ void Client::handle_client_request_forward(const MConstRef<MClientRequestForward
   auto num_fwd = fwd->get_num_fwd();
   if (num_fwd <= request->num_fwd || num_fwd >= max_fwd) {
     if (request->num_fwd >= max_fwd || num_fwd >= max_fwd) {
-      request->abort(-EMULTIHOP);
+      request->abort(-CEPHFS_EMULTIHOP);
       request->caller_cond->notify_all();
       ldout(cct, 1) << __func__ << " tid " << tid << " seq overflow"
                     << ", abort it" << dendl;
@@ -5952,7 +5952,7 @@ int Client::may_delete(const char *relpath, const UserPerm& perms) {
 
   RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
   if (!mref_reader.is_state_satisfied())
-    return -ENOTCONN;
+    return -CEPHFS_ENOTCONN;
 
   filepath path(relpath);
   string name = path.last_dentry();