LCOV - code coverage report
Current view: top level - spdk/module/event/subsystems/ublk - ublk.c (source / functions) Hit Total Coverage
Test: Combined Lines: 16 17 94.1 %
Date: 2024-07-15 15:46:34 Functions: 6 6 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*   SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  *   Copyright (C) 2022 Intel Corporation.
       3                 :            :  *   All rights reserved.
       4                 :            :  */
       5                 :            : 
       6                 :            : #include "spdk/stdinc.h"
       7                 :            : #include "spdk/ublk.h"
       8                 :            : #include "spdk_internal/init.h"
       9                 :            : 
      10                 :            : static void
      11                 :        436 : ublk_subsystem_init(void)
      12                 :            : {
      13                 :        436 :         spdk_ublk_init();
      14                 :        436 :         spdk_subsystem_init_next(0);
      15                 :        436 : }
      16                 :            : 
      17                 :            : static void
      18                 :        436 : ublk_subsystem_fini_done(void *arg)
      19                 :            : {
      20                 :        436 :         spdk_subsystem_fini_next();
      21                 :        436 : }
      22                 :            : 
      23                 :            : static void
      24                 :        436 : ublk_subsystem_fini(void)
      25                 :            : {
      26                 :            :         int rc;
      27                 :            : 
      28                 :        436 :         rc = spdk_ublk_fini(ublk_subsystem_fini_done, NULL);
      29         [ -  + ]:        436 :         if (rc != 0) {
      30                 :          0 :                 ublk_subsystem_fini_done(NULL);
      31                 :            :         }
      32                 :        436 : }
      33                 :            : 
      34                 :            : static void
      35                 :         71 : ublk_subsystem_write_config_json(struct spdk_json_write_ctx *w)
      36                 :            : {
      37                 :         71 :         spdk_ublk_write_config_json(w);
      38                 :         71 : }
      39                 :            : 
      40                 :            : static struct spdk_subsystem g_spdk_subsystem_ublk = {
      41                 :            :         .name = "ublk",
      42                 :            :         .init = ublk_subsystem_init,
      43                 :            :         .fini = ublk_subsystem_fini,
      44                 :            :         .write_config_json = ublk_subsystem_write_config_json,
      45                 :            : };
      46                 :            : 
      47                 :        494 : SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_ublk);
      48                 :        494 : SPDK_SUBSYSTEM_DEPEND(ublk, bdev)

Generated by: LCOV version 1.14