Skip to content

Commit 2f7eca9

Browse files
committed
Clean up old uses of previous config reader
1 parent 6bf5b28 commit 2f7eca9

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

src/bdev_lsvd.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#include "spdk/bdev_module.h"
33
#include <future>
44

5+
#include "backend.h"
56
#include "bdev_lsvd.h"
7+
#include "config.h"
68
#include "image.h"
79
#include "request.h"
810
#include "smartiov.h"
911
#include "spdk/thread.h"
10-
#include "src/backend.h"
11-
#include "src/config.h"
1212
#include "utils.h"
1313

1414
static int bdev_lsvd_init(void);

src/config.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class lsvd_config
3232
u64 gc_write_window = 4; // max GC writes outstanding
3333
bool no_gc = false; // turn off GC
3434

35-
lsvd_config() {}
3635
~lsvd_config() {}
37-
int read();
3836

3937
inline fspath wlog_path(str imgname)
4038
{
@@ -45,4 +43,7 @@ class lsvd_config
4543
static opt<lsvd_config> from_json(str json);
4644
static opt<lsvd_config> from_file(str path);
4745
static lsvd_config get_default();
46+
47+
private:
48+
lsvd_config() {}
4849
};

src/spdk_wrap.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "spdk_wrap.h"
22
#include "config.h"
3-
#include "src/utils.h"
3+
#include "utils.h"
44

55
spdk_completion::spdk_completion(rbd_callback_t cb, void *cb_arg)
66
: cb(cb), cb_arg(cb_arg)
@@ -59,10 +59,7 @@ inline void spdk_completion::dec_and_free()
5959
lsvd_rbd *lsvd_rbd::open_image(rados_ioctx_t io, std::string name)
6060
{
6161
try {
62-
lsvd_config cfg;
63-
auto err = cfg.read();
64-
PR_ERR_RET_IF(err < 0, nullptr, -err, "Failed to read config");
65-
62+
auto cfg = lsvd_config::get_default();
6663
return new lsvd_rbd(name, io, cfg);
6764
} catch (std::runtime_error &e) {
6865
log_error("Failed to open image: {}", e.what());

src/translate.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include "extent.h"
1414
#include "misc_cache.h"
1515
#include "request.h"
16-
#include "src/utils.h"
1716
#include "translate.h"
17+
#include "utils.h"
1818

1919
/*
2020
* Architecture:

0 commit comments

Comments
 (0)