From 5fc5f0c42322c20751ea21472d8b00edc46ecfff Mon Sep 17 00:00:00 2001 From: Stefan Chivu Date: Wed, 9 Nov 2022 15:03:37 +0200 Subject: [PATCH] common/win32: Fixed function name typo There was a typo in the function name cephfs_errno_to_ntsatus defined in common/win32/errno.cc. It has been replaced with cephfs_errno_to_ntstatus_map to avoid conflicts with the existing cephfs_errno_to_ntstatus function. Signed-off-by: Stefan Chivu --- src/common/win32/errno.cc | 2 +- src/dokan/ceph_dokan.cc | 46 ++++++++++++++++----------------- src/include/win32/win32_errno.h | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/common/win32/errno.cc b/src/common/win32/errno.cc index bac9320a361..d0942fac9af 100644 --- a/src/common/win32/errno.cc +++ b/src/common/win32/errno.cc @@ -638,7 +638,7 @@ static const ceph::unordered_map cephfs_errno_to_ntstatus = { {CEPHFS_EOLDSNAPC, STATUS_DATA_ERROR} }; -__u32 cephfs_errno_to_ntsatus(int cephfs_errno) +__u32 cephfs_errno_to_ntstatus_map(int cephfs_errno) { cephfs_errno = abs(cephfs_errno); diff --git a/src/dokan/ceph_dokan.cc b/src/dokan/ceph_dokan.cc index 65df2c13afa..8147b4542db 100644 --- a/src/dokan/ceph_dokan.cc +++ b/src/dokan/ceph_dokan.cc @@ -93,7 +93,7 @@ static NTSTATUS do_open_file( if (fd < 0) { dout(2) << __func__ << " " << path << ": ceph_open failed. Error: " << fd << dendl; - return cephfs_errno_to_ntsatus(fd); + return cephfs_errno_to_ntstatus_map(fd); } fdc->fd = fd; @@ -115,7 +115,7 @@ static NTSTATUS WinCephCreateDirectory( if (ret < 0) { dout(2) << __func__ << " " << path << ": ceph_mkdir failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } return 0; } @@ -335,7 +335,7 @@ static NTSTATUS WinCephReadFile( if (fd_new < 0) { dout(2) << __func__ << " " << path << ": ceph_open failed. Error: " << fd_new << dendl; - return cephfs_errno_to_ntsatus(fd_new); + return cephfs_errno_to_ntstatus_map(fd_new); } int ret = ceph_read(cmount, fd_new, (char*) Buffer, BufferLength, Offset); @@ -345,7 +345,7 @@ static NTSTATUS WinCephReadFile( << ". Offset: " << Offset << "Buffer length: " << BufferLength << dendl; ceph_close(cmount, fd_new); - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } *ReadLength = ret; ceph_close(cmount, fd_new); @@ -357,7 +357,7 @@ static NTSTATUS WinCephReadFile( << ": ceph_read failed. Error: " << ret << ". Offset: " << Offset << "Buffer length: " << BufferLength << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } *ReadLength = ret; return 0; @@ -386,7 +386,7 @@ static NTSTATUS WinCephWriteFile( if (ret) { dout(2) << __func__ << " " << path << ": ceph_statx failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } Offset = stbuf.stx_size; @@ -422,7 +422,7 @@ static NTSTATUS WinCephWriteFile( if (fd_new < 0) { dout(2) << __func__ << " " << path << ": ceph_open failed. Error: " << fd_new << dendl; - return cephfs_errno_to_ntsatus(fd_new); + return cephfs_errno_to_ntstatus_map(fd_new); } int ret = ceph_write(cmount, fd_new, (char*) Buffer, @@ -433,7 +433,7 @@ static NTSTATUS WinCephWriteFile( << ". Offset: " << Offset << "Buffer length: " << NumberOfBytesToWrite << dendl; ceph_close(cmount, fd_new); - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } *NumberOfBytesWritten = ret; ceph_close(cmount, fd_new); @@ -446,7 +446,7 @@ static NTSTATUS WinCephWriteFile( << ": ceph_write failed. Error: " << ret << ". Offset: " << Offset << "Buffer length: " << NumberOfBytesToWrite << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } *NumberOfBytesWritten = ret; return 0; @@ -467,7 +467,7 @@ static NTSTATUS WinCephFlushFileBuffers( if (ret) { dout(2) << __func__ << " " << get_path(FileName) << ": ceph_sync failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } return 0; } @@ -490,14 +490,14 @@ static NTSTATUS WinCephGetFileInformation( if (ret) { dout(2) << __func__ << " " << path << ": ceph_statx failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } } else { int ret = ceph_fstatx(cmount, fdc->fd, &stbuf, requested_attrs, 0); if (ret) { dout(2) << __func__ << " " << path << ": ceph_fstatx failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } } @@ -534,7 +534,7 @@ static NTSTATUS WinCephFindFiles( if (ret != 0) { dout(2) << __func__ << " " << path << ": ceph_mkdir failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } WIN32_FIND_DATAW findData; @@ -554,7 +554,7 @@ static NTSTATUS WinCephFindFiles( if (ret < 0) { dout(2) << __func__ << " " << path << ": ceph_readdirplus_r failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } to_wstring(result.d_name).copy(findData.cFileName, MAX_PATH); @@ -617,7 +617,7 @@ static NTSTATUS WinCephDeleteDirectory( if (ret != 0) { dout(2) << __func__ << " " << path << ": ceph_opendir failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } WIN32_FIND_DATAW findData; @@ -654,7 +654,7 @@ static NTSTATUS WinCephMoveFile( << ": ceph_rename failed. Error: " << ret << dendl; } - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } static NTSTATUS WinCephSetEndOfFile( @@ -673,7 +673,7 @@ static NTSTATUS WinCephSetEndOfFile( dout(2) << __func__ << " " << get_path(FileName) << ": ceph_ftruncate failed. Error: " << ret << " Offset: " << ByteOffset << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } return 0; @@ -696,7 +696,7 @@ static NTSTATUS WinCephSetAllocationSize( if (ret) { dout(2) << __func__ << " " << get_path(FileName) << ": ceph_fstatx failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } if ((unsigned long long) AllocSize < stbuf.stx_size) { @@ -704,7 +704,7 @@ static NTSTATUS WinCephSetAllocationSize( if (ret) { dout(2) << __func__ << " " << get_path(FileName) << ": ceph_ftruncate failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } return 0; } @@ -756,7 +756,7 @@ static NTSTATUS WinCephSetFileTime( if (ret) { dout(2) << __func__ << " " << path << ": ceph_setattrx failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } return 0; } @@ -810,7 +810,7 @@ static NTSTATUS WinCephGetDiskFreeSpace( int ret = ceph_statfs(cmount, "/", &vfsbuf); if (ret) { derr << "ceph_statfs failed. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret);; + return cephfs_errno_to_ntstatus_map(ret);; } *FreeBytesAvailable = vfsbuf.f_bsize * vfsbuf.f_bfree; @@ -874,7 +874,7 @@ NTSTATUS get_volume_serial(PDWORD serial) { fsid_str, sizeof(fsid_str)); if (ret < 0) { dout(2) << "Coudln't retrieve the cluster fsid. Error: " << ret << dendl; - return cephfs_errno_to_ntsatus(ret); + return cephfs_errno_to_ntstatus_map(ret); } uuid_d fsid; @@ -931,7 +931,7 @@ int do_map() { r = ceph_mount(cmount, g_cfg->root_path.c_str()); if (r) { derr << "ceph_mount failed. Error: " << r << dendl; - return cephfs_errno_to_ntsatus(r); + return cephfs_errno_to_ntstatus_map(r); } if (g_cfg->win_vol_name.empty()) { diff --git a/src/include/win32/win32_errno.h b/src/include/win32/win32_errno.h index c842b250f4b..dd8ff8474fb 100644 --- a/src/include/win32/win32_errno.h +++ b/src/include/win32/win32_errno.h @@ -137,7 +137,7 @@ extern "C" { __s32 wsae_to_errno(__s32 r); __u32 errno_to_ntstatus(__s32 r); -__u32 cephfs_errno_to_ntsatus(int cephfs_errno); +__u32 cephfs_errno_to_ntstatus_map(int cephfs_errno); #ifdef __cplusplus } -- 2.39.5