diff --git a/common/include/concurrent_task_utils.h b/common/include/concurrent_task_utils.h deleted file mode 100644 index 96ead4af860310b19aac67dee508d86cdc2bee63..0000000000000000000000000000000000000000 --- a/common/include/concurrent_task_utils.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONCURRENT_TASK_COMMON_INCLUDE_CONCURRENT_TASK_UTILS_H -#define CONCURRENT_TASK_COMMON_INCLUDE_CONCURRENT_TASK_UTILS_H - -#include - - -uint64_t GetAddrTag(void* addr); - - -#endif // CONCURRENT_TASK_COMMON_INCLUDE_CONCURRENT_TASK_UTILS_H \ No newline at end of file diff --git a/common/src/concurrent_task_utils.cpp b/common/src/concurrent_task_utils.cpp deleted file mode 100644 index 82df7b7e26679c64e635f96926352c6c0a981747..0000000000000000000000000000000000000000 --- a/common/src/concurrent_task_utils.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "concurrent_task_utils.h" - - -uint64_t GetAddrTag(void* addr) -{ - uint64_t tag = 0; - if (addr != nullptr) { - tag = fdsan_create_owner_tag(FDSAN_OWNER_TYPE_FILE, (uint64_t)addr); - } - return tag; -} \ No newline at end of file diff --git a/qos/BUILD.gn b/qos/BUILD.gn index 2e298823cb1286c75c551ff1d3683bd725f35de4..8372df94d44e21143b4a26057dc2b1f7c8ad9685 100644 --- a/qos/BUILD.gn +++ b/qos/BUILD.gn @@ -19,7 +19,6 @@ config("qos_config") { "../include/", "../interfaces/inner_api/", "../services/include/", - "../common/include/", ] } @@ -39,7 +38,6 @@ ohos_shared_library("qos") { ] public_configs = [ ":qos_config" ] sources = [ - "../common/src/concurrent_task_utils.cpp", "../services/src/qos_interface.cpp", "qos.cpp", ] diff --git a/services/BUILD.gn b/services/BUILD.gn index 5cb3d245f37b03c95e75ed3db23b0c58d113d9ff..8c231099d710bb7329e33f515536968eed3ef9b8 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -25,7 +25,7 @@ config("concurrent_task_config") { "../include", "../frameworks/concurrent_task_client/include/", "../interfaces/inner_api/", - "../common/include/", + "../common/include", ] } @@ -53,7 +53,6 @@ ohos_shared_library("concurrentsvc") { ldflags = [ "-Wl,--exclude-libs=ALL" ] sources = [ - "../common/src/concurrent_task_utils.cpp", "src/concurrent_task_controller_interface.cpp", "src/concurrent_task_service.cpp", "src/concurrent_task_service_ability.cpp", diff --git a/services/src/qos_interface.cpp b/services/src/qos_interface.cpp index 4caa8824998784f27c7e2e5a74e32c6ef62f8ffa..ebabca7480befd3205e18464dc32a26693aba356 100644 --- a/services/src/qos_interface.cpp +++ b/services/src/qos_interface.cpp @@ -27,7 +27,6 @@ #include #include "concurrent_task_log.h" -#include "concurrent_task_utils.h" static int TrivalOpenRtgNode(void) { @@ -62,14 +61,13 @@ int EnableRtg(bool flag) if (fd < 0) { return fd; } - fdsan_exchange_owner_tag(fd, 0, GetAddrTag(static_cast(&fd))); int ret = ioctl(fd, CMD_ID_SET_ENABLE, &enableData); if (ret < 0) { CONCUR_LOGE("set rtg config enable failed."); } - fdsan_close_with_tag(fd, GetAddrTag(static_cast(&fd))); + close(fd); return 0; }; @@ -87,7 +85,6 @@ int QosApplyForOther(unsigned int level, int tid) if (fd < 0) { return fd; } - fdsan_exchange_owner_tag(fd, 0, GetAddrTag(static_cast(&fd))); struct QosCtrlData data; data.level = level; @@ -98,7 +95,7 @@ int QosApplyForOther(unsigned int level, int tid) if (ret < 0) { CONCUR_LOGE("[Interface] task %{public}d apply qos failed, errno = %{public}d", tid, errno); } - fdsan_close_with_tag(fd, GetAddrTag(static_cast(&fd))); + close(fd); return ret; } @@ -108,7 +105,6 @@ int QosLeave(void) if (fd < 0) { return fd; } - fdsan_exchange_owner_tag(fd, 0, GetAddrTag(static_cast(&fd))); struct QosCtrlData data; data.type = static_cast(QosManipulateType::QOS_LEAVE); @@ -118,7 +114,7 @@ int QosLeave(void) if (ret < 0) { CONCUR_LOGE("[Interface] task %{public}d leave qos failed, errno = %{public}d", gettid(), errno); } - fdsan_close_with_tag(fd, GetAddrTag(static_cast(&fd))); + close(fd); return ret; } @@ -128,7 +124,6 @@ int QosLeaveForOther(int tid) if (fd < 0) { return fd; } - fdsan_exchange_owner_tag(fd, 0, GetAddrTag(static_cast(&fd))); struct QosCtrlData data; data.type = static_cast(QosManipulateType::QOS_LEAVE); @@ -138,7 +133,7 @@ int QosLeaveForOther(int tid) if (ret < 0) { CONCUR_LOGE("[Interface] task %{public}d leave qos failed, errno = %{public}d", tid, errno); } - fdsan_close_with_tag(fd, GetAddrTag(static_cast(&fd))); + close(fd); return ret; } @@ -148,13 +143,12 @@ int QosPolicySet(const struct QosPolicyDatas* policyDatas) if (fd < 0) { return fd; } - fdsan_exchange_owner_tag(fd, 0, GetAddrTag(static_cast(&fd))); int ret = ioctl(fd, QOS_CTRL_POLICY_OPERATION, policyDatas); if (ret < 0) { CONCUR_LOGE("[Interface] set qos policy failed, errno = %{public}d", errno); } - fdsan_close_with_tag(fd, GetAddrTag(static_cast(&fd))); + close(fd); return ret; } @@ -170,7 +164,6 @@ int QosGetForOther(int tid, int& level) if (fd < 0) { return fd; } - fdsan_exchange_owner_tag(fd, 0, GetAddrTag(static_cast(&fd))); struct QosCtrlData data; data.type = static_cast(QosManipulateType::QOS_GET); @@ -183,6 +176,6 @@ int QosGetForOther(int tid, int& level) } level = data.qos; - fdsan_close_with_tag(fd, GetAddrTag(static_cast(&fd))); + close(fd); return ret; } \ No newline at end of file