From: Sage Weil Date: Sat, 7 Apr 2018 02:30:18 +0000 (-0500) Subject: Merge PR #20516 into wip-sage-testing-20180407.023003 X-Git-Tag: v13.1.0~386 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5d0c06d5fef6f241cb65ede0ee4509cc036ff1c3;p=ceph.git Merge PR #20516 into wip-sage-testing-20180407.023003 * refs/pull/20516/head: os/filestore: advertise vdo in filestore metadata os/filestore: implement thin provisioning utilization stats for VDO os/bluestore/KernelDevice: advertise vdo and physical_size in metadata os/bluestore/KernelDevice: implement thin utilization stats for VDO os/bluestore: hook to expose utilization of thinly-provisioned device common/blkdev: identify VDO devices beneath LVM common/blkdev: implement VDO helper functions Reviewed-by: Josh Durgin --- 5d0c06d5fef6f241cb65ede0ee4509cc036ff1c3 diff --cc src/os/bluestore/KernelDevice.cc index 9bae23ce5bf5,c1213a5fd6fb..76556a979b5b --- a/src/os/bluestore/KernelDevice.cc +++ b/src/os/bluestore/KernelDevice.cc @@@ -190,8 -189,16 +192,13 @@@ void KernelDevice::close( { dout(1) << __func__ << dendl; _aio_stop(); - - assert(fs); - delete fs; - fs = NULL; + _discard_stop(); + if (vdo_fd >= 0) { + VOID_TEMP_FAILURE_RETRY(::close(vdo_fd)); + vdo_fd = -1; + } + assert(fd_direct >= 0); VOID_TEMP_FAILURE_RETRY(::close(fd_direct)); fd_direct = -1; diff --cc src/os/bluestore/KernelDevice.h index a753e7be2385,2fa40a9b781c..9f461ac06302 --- a/src/os/bluestore/KernelDevice.h +++ b/src/os/bluestore/KernelDevice.h @@@ -28,8 -26,12 +28,11 @@@ class KernelDevice : public BlockDevice { int fd_direct, fd_buffered; std::string path; - FS *fs; bool aio, dio; + int vdo_fd = -1; ///< fd for vdo sysfs directory + string vdo_name; + std::string devname; ///< kernel dev name (/sys/block/$devname), if any Mutex debug_lock; @@@ -98,11 -75,12 +101,13 @@@ void debug_aio_link(aio_t& aio); void debug_aio_unlink(aio_t& aio); + void _detect_vdo(); + public: - KernelDevice(CephContext* cct, aio_callback_t cb, void *cbpriv); + KernelDevice(CephContext* cct, aio_callback_t cb, void *cbpriv, aio_callback_t d_cb, void *d_cbpriv); void aio_submit(IOContext *ioc) override; + void discard_drain() override; int collect_metadata(const std::string& prefix, map *pm) const override; int get_devname(std::string *s) override {