Skip to content

Commit

Permalink
Clean up old uses of previous config reader
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacKhor committed Aug 8, 2024
1 parent 6bf5b28 commit 2f7eca9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/bdev_lsvd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#include "spdk/bdev_module.h"
#include <future>

#include "backend.h"
#include "bdev_lsvd.h"
#include "config.h"
#include "image.h"
#include "request.h"
#include "smartiov.h"
#include "spdk/thread.h"
#include "src/backend.h"
#include "src/config.h"
#include "utils.h"

static int bdev_lsvd_init(void);
Expand Down
5 changes: 3 additions & 2 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class lsvd_config
u64 gc_write_window = 4; // max GC writes outstanding
bool no_gc = false; // turn off GC

lsvd_config() {}
~lsvd_config() {}
int read();

inline fspath wlog_path(str imgname)
{
Expand All @@ -45,4 +43,7 @@ class lsvd_config
static opt<lsvd_config> from_json(str json);
static opt<lsvd_config> from_file(str path);
static lsvd_config get_default();

private:
lsvd_config() {}
};
7 changes: 2 additions & 5 deletions src/spdk_wrap.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "spdk_wrap.h"
#include "config.h"
#include "src/utils.h"
#include "utils.h"

spdk_completion::spdk_completion(rbd_callback_t cb, void *cb_arg)
: cb(cb), cb_arg(cb_arg)
Expand Down Expand Up @@ -59,10 +59,7 @@ inline void spdk_completion::dec_and_free()
lsvd_rbd *lsvd_rbd::open_image(rados_ioctx_t io, std::string name)
{
try {
lsvd_config cfg;
auto err = cfg.read();
PR_ERR_RET_IF(err < 0, nullptr, -err, "Failed to read config");

auto cfg = lsvd_config::get_default();
return new lsvd_rbd(name, io, cfg);
} catch (std::runtime_error &e) {
log_error("Failed to open image: {}", e.what());
Expand Down
2 changes: 1 addition & 1 deletion src/translate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "extent.h"
#include "misc_cache.h"
#include "request.h"
#include "src/utils.h"
#include "translate.h"
#include "utils.h"

/*
* Architecture:
Expand Down

0 comments on commit 2f7eca9

Please sign in to comment.