Skip to content

os: let ObjectStore::create() return unique_ptr<> #41520

Merged
tchaikov merged 6 commits intoceph:masterfrom
tchaikov:wip-osd-unique-ptr
May 29, 2021
Merged

os: let ObjectStore::create() return unique_ptr<> #41520
tchaikov merged 6 commits intoceph:masterfrom
tchaikov:wip-osd-unique-ptr

Conversation

@tchaikov
Copy link
Contributor

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@tchaikov tchaikov requested a review from athanatos May 25, 2021 08:00
@tchaikov tchaikov requested a review from rzarzynski May 25, 2021 08:00
@tchaikov tchaikov force-pushed the wip-osd-unique-ptr branch 7 times, most recently from 2568ea0 to bc39a5a Compare May 25, 2021 11:54
@tchaikov tchaikov force-pushed the wip-osd-unique-ptr branch 2 times, most recently from bc4fd9d to 0f0b03f Compare May 27, 2021 03:11
@tchaikov tchaikov requested a review from jdurgin May 27, 2021 03:12
@tchaikov tchaikov force-pushed the wip-osd-unique-ptr branch 6 times, most recently from dfe6156 to 41fe970 Compare May 27, 2021 07:28
tchaikov added 5 commits May 27, 2021 23:07
instead of returning a raw pointer of ObjectStore, let
`ObjectStore::create()` return a `std::unique_ptr<ObjectStore>`.

less error prune this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
less error prune this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
RAII can simplify the clean up logic in OSD::mkfs().

and since `ch` is a smart pointer, so it is able to take care of itself,
as long as we ensure that it is destructed before objectstore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
less error-prone, and it's simpler to manage the resource using RAII

Signed-off-by: Kefu Chai <kchai@redhat.com>
before this change, cot never destructs the created ObjectStore
instances.

after this change, they are destructed upon returning from main().

Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov tchaikov force-pushed the wip-osd-unique-ptr branch from 41fe970 to d5445b8 Compare May 27, 2021 15:15
@tchaikov tchaikov merged commit 2a35c56 into ceph:master May 29, 2021
@tchaikov tchaikov deleted the wip-osd-unique-ptr branch May 29, 2021 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants