@@ -85,43 +85,43 @@ struct ceph_fuse_fake_inode_stag {
8585using namespace std ;
8686
8787static const ceph::unordered_map<int ,int > cephfs_errno_to_system_errno = {
88- {CEPHFS_EBLOCKLISTED , ESHUTDOWN},
89- {CEPHFS_EPERM , EPERM},
90- {CEPHFS_ESTALE , ESTALE},
91- {CEPHFS_ENOSPC , ENOSPC},
92- {CEPHFS_ETIMEDOUT , ETIMEDOUT},
93- {CEPHFS_EIO , EIO},
94- {CEPHFS_ENOTCONN , ENOTCONN},
95- {CEPHFS_EEXIST , EEXIST},
96- {CEPHFS_EINTR , EINTR},
97- {CEPHFS_EINVAL , EINVAL},
98- {CEPHFS_EBADF , EBADF},
99- {CEPHFS_EROFS , EROFS},
100- {CEPHFS_EAGAIN , EAGAIN},
101- {CEPHFS_EACCES , EACCES},
102- {CEPHFS_ELOOP , ELOOP},
103- {CEPHFS_EISDIR , EISDIR},
104- {CEPHFS_ENOENT , ENOENT},
105- {CEPHFS_ENOTDIR , ENOTDIR},
106- {CEPHFS_ENAMETOOLONG , ENAMETOOLONG},
107- {CEPHFS_EBUSY , EBUSY},
108- {CEPHFS_EDQUOT , EDQUOT},
109- {CEPHFS_EFBIG , EFBIG},
110- {CEPHFS_ERANGE , ERANGE},
111- {CEPHFS_ENXIO , ENXIO},
112- {CEPHFS_ECANCELED , ECANCELED},
113- {CEPHFS_ENODATA , ENODATA},
114- {CEPHFS_EOPNOTSUPP , EOPNOTSUPP},
115- {CEPHFS_EXDEV , EXDEV},
116- {CEPHFS_ENOMEM , ENOMEM},
117- {CEPHFS_ENOTRECOVERABLE , ENOTRECOVERABLE},
118- {CEPHFS_ENOSYS , ENOSYS},
119- {CEPHFS_ENOTEMPTY , ENOTEMPTY},
120- {CEPHFS_EDEADLK , EDEADLK},
121- {CEPHFS_EDOM , EDOM},
122- {CEPHFS_EMLINK , EMLINK},
123- {CEPHFS_ETIME , ETIME},
124- {CEPHFS_EOLDSNAPC , EIO} // forcing to EIO for now
88+ {EBLOCKLISTED , ESHUTDOWN},
89+ {EPERM , EPERM},
90+ {ESTALE , ESTALE},
91+ {ENOSPC , ENOSPC},
92+ {ETIMEDOUT , ETIMEDOUT},
93+ {EIO , EIO},
94+ {ENOTCONN , ENOTCONN},
95+ {EEXIST , EEXIST},
96+ {EINTR , EINTR},
97+ {EINVAL , EINVAL},
98+ {EBADF , EBADF},
99+ {EROFS , EROFS},
100+ {EAGAIN , EAGAIN},
101+ {EACCES , EACCES},
102+ {ELOOP , ELOOP},
103+ {EISDIR , EISDIR},
104+ {ENOENT , ENOENT},
105+ {ENOTDIR , ENOTDIR},
106+ {ENAMETOOLONG , ENAMETOOLONG},
107+ {EBUSY , EBUSY},
108+ {EDQUOT , EDQUOT},
109+ {EFBIG , EFBIG},
110+ {ERANGE , ERANGE},
111+ {ENXIO , ENXIO},
112+ {ECANCELED , ECANCELED},
113+ {ENODATA , ENODATA},
114+ {EOPNOTSUPP , EOPNOTSUPP},
115+ {EXDEV , EXDEV},
116+ {ENOMEM , ENOMEM},
117+ {ENOTRECOVERABLE , ENOTRECOVERABLE},
118+ {ENOSYS , ENOSYS},
119+ {ENOTEMPTY , ENOTEMPTY},
120+ {EDEADLK , EDEADLK},
121+ {EDOM , EDOM},
122+ {EMLINK , EMLINK},
123+ {ETIME , ETIME},
124+ {EOLDSNAPC , EIO} // forcing to EIO for now
125125};
126126
127127/* Requirements:
@@ -283,7 +283,7 @@ static int getgroups(fuse_req_t req, gid_t **sgids)
283283
284284 gid_t *gids = new (std::nothrow) gid_t [c];
285285 if (!gids) {
286- return -get_sys_errno (CEPHFS_ENOMEM );
286+ return -get_sys_errno (ENOMEM );
287287 }
288288 c = fuse_req_getgroups (req, c, gids);
289289 if (c < 0 ) {
@@ -293,7 +293,7 @@ static int getgroups(fuse_req_t req, gid_t **sgids)
293293 }
294294 return c;
295295#endif
296- return -get_sys_errno (CEPHFS_ENOSYS );
296+ return -get_sys_errno (ENOSYS );
297297}
298298
299299static void get_fuse_groups (UserPerm& perms, fuse_req_t req)
@@ -379,7 +379,7 @@ static void fuse_ll_getattr(fuse_req_t req, fuse_ino_t ino,
379379 UserPerm perms (ctx->uid , ctx->gid );
380380 Inode *in = cfuse->iget (ino);
381381 if (!in) {
382- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
382+ fuse_reply_err (req, get_sys_errno (EINVAL ));
383383 return ;
384384 }
385385
@@ -406,7 +406,7 @@ static void fuse_ll_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
406406 UserPerm perms (ctx->uid , ctx->gid );
407407 Inode *in = cfuse->iget (ino);
408408 if (!in) {
409- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
409+ fuse_reply_err (req, get_sys_errno (EINVAL ));
410410 return ;
411411 }
412412
@@ -448,7 +448,7 @@ static void fuse_ll_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
448448 UserPerm perms (ctx->uid , ctx->gid );
449449 Inode *in = cfuse->iget (ino);
450450 if (!in) {
451- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
451+ fuse_reply_err (req, get_sys_errno (EINVAL ));
452452 return ;
453453 }
454454
@@ -468,7 +468,7 @@ static void fuse_ll_listxattr(fuse_req_t req, fuse_ino_t ino, size_t size)
468468 UserPerm perms (ctx->uid , ctx->gid );
469469 Inode *in = cfuse->iget (ino);
470470 if (!in) {
471- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
471+ fuse_reply_err (req, get_sys_errno (EINVAL ));
472472 return ;
473473 }
474474
@@ -498,7 +498,7 @@ static void fuse_ll_getxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
498498 UserPerm perms (ctx->uid , ctx->gid );
499499 Inode *in = cfuse->iget (ino);
500500 if (!in) {
501- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
501+ fuse_reply_err (req, get_sys_errno (EINVAL ));
502502 return ;
503503 }
504504
@@ -523,7 +523,7 @@ static void fuse_ll_removexattr(fuse_req_t req, fuse_ino_t ino,
523523 UserPerm perms (ctx->uid , ctx->gid );
524524 Inode *in = cfuse->iget (ino);
525525 if (!in) {
526- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
526+ fuse_reply_err (req, get_sys_errno (EINVAL ));
527527 return ;
528528 }
529529
@@ -544,7 +544,7 @@ static void fuse_ll_opendir(fuse_req_t req, fuse_ino_t ino,
544544 void *dirp;
545545 Inode *in = cfuse->iget (ino);
546546 if (!in) {
547- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
547+ fuse_reply_err (req, get_sys_errno (EINVAL ));
548548 return ;
549549 }
550550
@@ -570,7 +570,7 @@ static void fuse_ll_readlink(fuse_req_t req, fuse_ino_t ino)
570570 UserPerm perms (ctx->uid , ctx->gid );
571571 Inode *in = cfuse->iget (ino);
572572 if (!in) {
573- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
573+ fuse_reply_err (req, get_sys_errno (EINVAL ));
574574 return ;
575575 }
576576
@@ -595,7 +595,7 @@ static void fuse_ll_mknod(fuse_req_t req, fuse_ino_t parent, const char *name,
595595 UserPerm perms (ctx->uid , ctx->gid );
596596 Inode *i2, *i1 = cfuse->iget (parent);
597597 if (!i1) {
598- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
598+ fuse_reply_err (req, get_sys_errno (EINVAL ));
599599 return ;
600600 }
601601
@@ -659,7 +659,7 @@ static void fuse_ll_mkdir(fuse_req_t req, fuse_ino_t parent, const char *name,
659659
660660 i1 = cfuse->iget (parent);
661661 if (!i1) {
662- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
662+ fuse_reply_err (req, get_sys_errno (EINVAL ));
663663 return ;
664664 }
665665
@@ -684,7 +684,7 @@ static void fuse_ll_unlink(fuse_req_t req, fuse_ino_t parent, const char *name)
684684 UserPerm perm (ctx->uid , ctx->gid );
685685 Inode *in = cfuse->iget (parent);
686686 if (!in) {
687- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
687+ fuse_reply_err (req, get_sys_errno (EINVAL ));
688688 return ;
689689 }
690690
@@ -703,7 +703,7 @@ static void fuse_ll_rmdir(fuse_req_t req, fuse_ino_t parent, const char *name)
703703 UserPerm perms (ctx->uid , ctx->gid );
704704 Inode *in = cfuse->iget (parent);
705705 if (!in) {
706- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
706+ fuse_reply_err (req, get_sys_errno (EINVAL ));
707707 return ;
708708 }
709709
@@ -724,7 +724,7 @@ static void fuse_ll_symlink(fuse_req_t req, const char *existing,
724724 UserPerm perms (ctx->uid , ctx->gid );
725725 Inode *i2, *i1 = cfuse->iget (parent);
726726 if (!i1) {
727- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
727+ fuse_reply_err (req, get_sys_errno (EINVAL ));
728728 return ;
729729 }
730730
@@ -757,7 +757,7 @@ static void fuse_ll_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
757757 // cephfs does not support renameat2 flavors; follow same logic as done in
758758 // kclient's ceph_rename()
759759 if (flags) {
760- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
760+ fuse_reply_err (req, get_sys_errno (EINVAL ));
761761 return ;
762762 }
763763#endif
@@ -768,7 +768,7 @@ static void fuse_ll_rename(fuse_req_t req, fuse_ino_t parent, const char *name,
768768 Inode *in = cfuse->iget (parent);
769769 Inode *nin = cfuse->iget (newparent);
770770 if (!in || !nin) {
771- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
771+ fuse_reply_err (req, get_sys_errno (EINVAL ));
772772 return ;
773773 }
774774
@@ -790,7 +790,7 @@ static void fuse_ll_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent,
790790 Inode *in = cfuse->iget (ino);
791791 Inode *nin = cfuse->iget (newparent);
792792 if (!in || !nin) {
793- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
793+ fuse_reply_err (req, get_sys_errno (EINVAL ));
794794 return ;
795795 }
796796
@@ -836,7 +836,7 @@ static void fuse_ll_open(fuse_req_t req, fuse_ino_t ino,
836836 UserPerm perms (ctx->uid , ctx->gid );
837837 Inode *in = cfuse->iget (ino);
838838 if (!in) {
839- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
839+ fuse_reply_err (req, get_sys_errno (EINVAL ));
840840 return ;
841841 }
842842
@@ -1033,15 +1033,15 @@ static void fuse_ll_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
10331033 rc.req = req;
10341034 rc.snap = cfuse->fino_snap (ino);
10351035 if (rc.snap == CEPH_MAXSNAP) {
1036- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
1036+ fuse_reply_err (req, get_sys_errno (EINVAL ));
10371037 return ;
10381038 }
10391039 rc.buf = new char [size];
10401040 rc.size = size;
10411041 rc.pos = 0 ;
10421042
10431043 int r = cfuse->client ->readdir_r_cb (dirp, fuse_ll_add_dirent, &rc);
1044- if (r == 0 || r == -CEPHFS_ENOSPC ) /* ignore ENOSPC from our callback */
1044+ if (r == 0 || r == -ENOSPC ) /* ignore ENOSPC from our callback */
10451045 fuse_reply_buf (req, rc.buf , rc.pos );
10461046 else
10471047 fuse_reply_err (req, get_sys_errno (-r));
@@ -1073,7 +1073,7 @@ static void fuse_ll_access(fuse_req_t req, fuse_ino_t ino, int mask)
10731073 UserPerm perms (ctx->uid , ctx->gid );
10741074 Inode *in = cfuse->iget (ino);
10751075 if (!in) {
1076- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
1076+ fuse_reply_err (req, get_sys_errno (EINVAL ));
10771077 return ;
10781078 }
10791079
@@ -1094,7 +1094,7 @@ static void fuse_ll_create(fuse_req_t req, fuse_ino_t parent, const char *name,
10941094 UserPerm perms (ctx->uid , ctx->gid );
10951095 Inode *i1 = cfuse->iget (parent), *i2;
10961096 if (!i1) {
1097- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
1097+ fuse_reply_err (req, get_sys_errno (EINVAL ));
10981098 return ;
10991099 }
11001100
@@ -1134,7 +1134,7 @@ static void fuse_ll_statfs(fuse_req_t req, fuse_ino_t ino)
11341134 UserPerm perms (ctx->uid , ctx->gid );
11351135 Inode *in = cfuse->iget (ino);
11361136 if (!in) {
1137- fuse_reply_err (req, get_sys_errno (CEPHFS_EINVAL ));
1137+ fuse_reply_err (req, get_sys_errno (EINVAL ));
11381138 return ;
11391139 }
11401140
0 commit comments