optimize the lock in ObObjectDevice

This commit is contained in:
obdev 2023-03-02 17:46:58 +00:00 committed by ob-robot
parent 49809d219c
commit 01644a390c
2 changed files with 3 additions and 5 deletions

View File

@ -256,7 +256,6 @@ int ObObjectDevice::release_res(void* ctx, const ObIOFd &fd, ObStorageAccessType
int ret = OB_SUCCESS;
int ret_tmp = OB_SUCCESS;
/*release the ctx*/
common::ObSpinLockGuard guard(lock_);
if (OB_ISNULL(ctx)) {
ret = OB_INVALID_ARGUMENT;
OB_LOG(WARN, "ctx is null, invald para!");
@ -304,7 +303,6 @@ int ObObjectDevice::open(const char *pathname, const int flags, const mode_t mod
int ret = OB_SUCCESS;
void* ctx = NULL;
ObStorageAccessType access_type = OB_STORAGE_ACCESS_MAX_TYPE;
common::ObSpinLockGuard guard(lock_);
//validate fd
if (fd_mng_.validate_fd(fd, false)) {
ret = OB_INIT_TWICE;

View File

@ -90,9 +90,9 @@ private:
ObStorageUtil util_;
/*obj ctx pool: use to create fd ctx(reader/writer)*/
common::ObPooledAllocator<ObStorageReader> reader_ctx_pool_;
common::ObPooledAllocator<ObStorageAppender> appender_ctx_pool_;
common::ObPooledAllocator<ObStorageWriter> overwriter_ctx_pool_;
common::ObPooledAllocator<ObStorageReader, ObMalloc, ObSpinLock> reader_ctx_pool_;
common::ObPooledAllocator<ObStorageAppender, ObMalloc, ObSpinLock> appender_ctx_pool_;
common::ObPooledAllocator<ObStorageWriter, ObMalloc, ObSpinLock> overwriter_ctx_pool_;
void* base_info_;
bool is_started_;
char storage_info_[OB_MAX_URI_LENGTH];