From 02a8be62cc7c1a492be5c9bc1fdf816b7d223b96 Mon Sep 17 00:00:00 2001
From: zhongjiawei <zhongjiawei1@huawei.com>
Date: Wed, 11 Dec 2024 15:48:55 +0800
Subject: [PATCH 06/11] image store:fix code style

---
 .../oci/storage/image_store/image_store.c     | 29 +++++++++----------
 .../oci/storage/image_store/image_store.h     |  9 +++---
 .../oci/storage/image_store/image_type.c      |  6 ++--
 .../oci/storage/image_store/image_type.h      |  6 ++--
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/daemon/modules/image/oci/storage/image_store/image_store.c b/src/daemon/modules/image/oci/storage/image_store/image_store.c
index 71bf36e0..1909e7f7 100644
--- a/src/daemon/modules/image/oci/storage/image_store/image_store.c
+++ b/src/daemon/modules/image/oci/storage/image_store/image_store.c
@@ -19,33 +19,34 @@
 #include <stdio.h>
 #include <string.h>
 #include <sha256.h>
+#include <limits.h>
+#include <pthread.h>
+#include <stdlib.h>
+
+#include <isula_libutils/defs.h>
+#include <isula_libutils/log.h>
 #include <isula_libutils/storage_image.h>
 #include <isula_libutils/imagetool_images_list.h>
 #include <isula_libutils/json_common.h>
 #include <isula_libutils/auto_cleanup.h>
-#include <limits.h>
-#include <pthread.h>
-#include <stdlib.h>
+#include <isula_libutils/imagetool_image.h>
+#include <isula_libutils/imagetool_image_summary.h>
+#include <isula_libutils/registry_manifest_schema1.h>
+#include <isula_libutils/registry_manifest_schema2.h>
+#include <isula_libutils/oci_image_manifest.h>
+#include <isula_libutils/image_manifest_v1_compatibility.h>
 
 #include <isula_libutils/utils_macro.h>
 
 #include "utils.h"
 #include "utils_file.h"
 #include "utils_images.h"
-#include "isula_libutils/log.h"
 #include "constants.h"
 #include "utils_array.h"
 #include "utils_string.h"
 #include "utils_regex.h"
-#include "isula_libutils/defs.h"
 #include "map.h"
 #include "utils_convert.h"
-#include "isula_libutils/imagetool_image.h"
-#include "isula_libutils/imagetool_image_summary.h"
-#include "isula_libutils/registry_manifest_schema1.h"
-#include "isula_libutils/registry_manifest_schema2.h"
-#include "isula_libutils/oci_image_manifest.h"
-#include "isula_libutils/image_manifest_v1_compatibility.h"
 #include "registry_type.h"
 #include "mediatype.h"
 #include "storage.h"
@@ -1361,8 +1362,7 @@ int image_store_set_big_data(const char *id, const char *key, const char *data)
 
     if (!image_store_lock(EXCLUSIVE)) {
         ERROR("Failed to lock image store with exclusive lock, not allowed to change image big data assignments");
-        ret = -1;
-        goto out;
+        return -1;
     }
 
     img = lookup(id);
@@ -1648,8 +1648,7 @@ int image_store_get_names(const char *id, char ***names, size_t *names_len)
 
     if (!image_store_lock(SHARED)) {
         ERROR("Failed to lock image store with shared lock, not allowed to get image names assignments");
-        ret = -1;
-        goto out;
+        return -1;
     }
 
     img = lookup(id);
diff --git a/src/daemon/modules/image/oci/storage/image_store/image_store.h b/src/daemon/modules/image/oci/storage/image_store/image_store.h
index 4544f84b..82bc1696 100644
--- a/src/daemon/modules/image/oci/storage/image_store/image_store.h
+++ b/src/daemon/modules/image/oci/storage/image_store/image_store.h
@@ -18,16 +18,17 @@
 #include <stdbool.h>
 #include <string.h>
 #include <pthread.h>
-#include <isula_libutils/imagetool_fs_info.h>
 #include <stdint.h>
 
+#include <isula_libutils/imagetool_fs_info.h>
+#include <isula_libutils/imagetool_image.h>
+#include <isula_libutils/imagetool_images_list.h>
+#include <isula_libutils/imagetool_image_summary.h>
+
 #include "storage.h"
 #include "utils_timestamp.h"
 #include "map.h"
 #include "linked_list.h"
-#include "isula_libutils/imagetool_image.h"
-#include "isula_libutils/imagetool_images_list.h"
-#include "isula_libutils/imagetool_image_summary.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/daemon/modules/image/oci/storage/image_store/image_type.c b/src/daemon/modules/image/oci/storage/image_store/image_type.c
index 50a81db2..67421cd6 100644
--- a/src/daemon/modules/image/oci/storage/image_store/image_type.c
+++ b/src/daemon/modules/image/oci/storage/image_store/image_type.c
@@ -19,11 +19,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "isula_libutils/storage_image.h"
+#include <isula_libutils/storage_image.h>
+#include <isula_libutils/log.h>
+
 #include "util_atomic.h"
 #include "utils.h"
-#include "isula_libutils/log.h"
-
 #include "utils_images.h"
 
 static image_t *create_empty_image()
diff --git a/src/daemon/modules/image/oci/storage/image_store/image_type.h b/src/daemon/modules/image/oci/storage/image_store/image_type.h
index d8376644..bbf7a7dc 100644
--- a/src/daemon/modules/image/oci/storage/image_store/image_type.h
+++ b/src/daemon/modules/image/oci/storage/image_store/image_type.h
@@ -19,9 +19,9 @@
 #include <stdint.h>
 #include <pthread.h>
 
-#include "isula_libutils/storage_image.h"
-#include "isula_libutils/log.h"
-#include "isula_libutils/oci_image_spec.h"
+#include <isula_libutils/storage_image.h>
+#include <isula_libutils/log.h>
+#include <isula_libutils/oci_image_spec.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.23.0

