From 3a963c5f19e17a04db3ff5e8603ed8ae935ebbd2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 29 Jul 2020 15:52:00 +0800 Subject: [PATCH] crimson/common: move write_file into crimson namespace it simply does not belong to ceph::buffer Signed-off-by: Kefu Chai --- src/crimson/common/buffer_io.cc | 2 +- src/crimson/common/buffer_io.h | 2 +- src/crimson/os/cyanstore/cyan_store.cc | 6 +++--- src/crimson/osd/main.cc | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/crimson/common/buffer_io.cc b/src/crimson/common/buffer_io.cc index 7bdab058974..68355684559 100644 --- a/src/crimson/common/buffer_io.cc +++ b/src/crimson/common/buffer_io.cc @@ -9,7 +9,7 @@ #include "include/buffer.h" -namespace ceph::buffer { +namespace crimson { seastar::future<> write_file(ceph::buffer::list&& bl, seastar::sstring fn, diff --git a/src/crimson/common/buffer_io.h b/src/crimson/common/buffer_io.h index 5cc6a6e97b7..0a98ec58fc2 100644 --- a/src/crimson/common/buffer_io.h +++ b/src/crimson/common/buffer_io.h @@ -8,7 +8,7 @@ #include "include/buffer_fwd.h" -namespace ceph::buffer { +namespace crimson { seastar::future<> write_file(ceph::buffer::list&& bl, seastar::sstring fn, seastar::file_permissions= // 0644 diff --git a/src/crimson/os/cyanstore/cyan_store.cc b/src/crimson/os/cyanstore/cyan_store.cc index 77c9799755d..4ba19f67eff 100644 --- a/src/crimson/os/cyanstore/cyan_store.cc +++ b/src/crimson/os/cyanstore/cyan_store.cc @@ -71,12 +71,12 @@ seastar::future<> CyanStore::umount() ceph_assert(ch); ch->encode(bl); std::string fn = fmt::format("{}/{}", path, col); - return ceph::buffer::write_file(std::move(bl), fn); + return crimson::write_file(std::move(bl), fn); }).then([&collections, this] { ceph::bufferlist bl; ceph::encode(collections, bl); std::string fn = fmt::format("{}/collections", path); - return ceph::buffer::write_file(std::move(bl), fn); + return crimson::write_file(std::move(bl), fn); }); }); } @@ -110,7 +110,7 @@ seastar::future<> CyanStore::mkfs(uuid_d new_osd_fsid) ceph::bufferlist bl; std::set collections; ceph::encode(collections, bl); - return ceph::buffer::write_file(std::move(bl), fn); + return crimson::write_file(std::move(bl), fn); }).then([this] { return write_meta("type", "memstore"); }); diff --git a/src/crimson/osd/main.cc b/src/crimson/osd/main.cc index 743ff43071d..adce07981d3 100644 --- a/src/crimson/osd/main.cc +++ b/src/crimson/osd/main.cc @@ -98,7 +98,7 @@ seastar::future<> make_keyring() keyring.encode_plaintext(bl); const auto permissions = (seastar::file_permissions::user_read | seastar::file_permissions::user_write); - return ceph::buffer::write_file(std::move(bl), path, permissions); + return crimson::write_file(std::move(bl), path, permissions); } }).handle_exception_type([path](const fs::filesystem_error& e) { seastar::fprint(std::cerr, "FATAL: writing new keyring to %s: %s\n", path, e.what()); -- 2.39.5