LCOV - code coverage report
Current view: top level - spdk/module/event/subsystems/nbd - nbd.c (source / functions) Hit Total Coverage
Test: Combined Lines: 15 15 100.0 %
Date: 2024-07-10 15:22:03 Functions: 6 6 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /*   SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  *   Copyright (C) 2017 Intel Corporation.
       3                 :            :  *   All rights reserved.
       4                 :            :  */
       5                 :            : 
       6                 :            : #include "spdk/stdinc.h"
       7                 :            : 
       8                 :            : #include "spdk/nbd.h"
       9                 :            : 
      10                 :            : #include "spdk_internal/init.h"
      11                 :            : 
      12                 :            : static void
      13                 :       1741 : nbd_subsystem_init(void)
      14                 :            : {
      15                 :            :         int rc;
      16                 :            : 
      17                 :       1741 :         rc = spdk_nbd_init();
      18                 :            : 
      19                 :       1741 :         spdk_subsystem_init_next(rc);
      20                 :       1741 : }
      21                 :            : 
      22                 :            : static void
      23                 :       1741 : nbd_subsystem_fini_done(void *arg)
      24                 :            : {
      25                 :       1741 :         spdk_subsystem_fini_next();
      26                 :       1741 : }
      27                 :            : 
      28                 :            : static void
      29                 :       1741 : nbd_subsystem_fini(void)
      30                 :            : {
      31                 :       1741 :         spdk_nbd_fini(nbd_subsystem_fini_done, NULL);
      32                 :       1741 : }
      33                 :            : 
      34                 :            : static void
      35                 :        131 : nbd_subsystem_write_config_json(struct spdk_json_write_ctx *w)
      36                 :            : {
      37                 :        131 :         spdk_nbd_write_config_json(w);
      38                 :        131 : }
      39                 :            : 
      40                 :            : static struct spdk_subsystem g_spdk_subsystem_nbd = {
      41                 :            :         .name = "nbd",
      42                 :            :         .init = nbd_subsystem_init,
      43                 :            :         .fini = nbd_subsystem_fini,
      44                 :            :         .write_config_json = nbd_subsystem_write_config_json,
      45                 :            : };
      46                 :            : 
      47                 :       1816 : SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_nbd);
      48                 :       1816 : SPDK_SUBSYSTEM_DEPEND(nbd, bdev)

Generated by: LCOV version 1.14