Skip to content

Commit

Permalink
Merge pull request #12856 from xiexingguo/xxg-wip-clean-kd
Browse files Browse the repository at this point in the history
os/bluestore/KernelDevice: kill zeros

Reviewed-by: Igor Fedotov <ifedotov@mirantis.com>
  • Loading branch information
liewegas committed Jan 10, 2017
2 parents f70b6fd + 1236628 commit 533311e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
6 changes: 1 addition & 5 deletions src/os/bluestore/KernelDevice.cc
Expand Up @@ -46,8 +46,6 @@ KernelDevice::KernelDevice(CephContext* cct, aio_callback_t cb, void *cbpriv)
aio_thread(this),
injecting_crash(0)
{
zeros = buffer::create_page_aligned(1048576);
zeros.zero();
}

int KernelDevice::_lock()
Expand All @@ -56,8 +54,6 @@ int KernelDevice::_lock()
memset(&l, 0, sizeof(l));
l.l_type = F_WRLCK;
l.l_whence = SEEK_SET;
l.l_start = 0;
l.l_len = 0;
int r = ::fcntl(fd_direct, F_SETLK, &l);
if (r < 0)
return -errno;
Expand All @@ -72,7 +68,7 @@ int KernelDevice::open(string p)

fd_direct = ::open(path.c_str(), O_RDWR | O_DIRECT);
if (fd_direct < 0) {
int r = -errno;
r = -errno;
derr << __func__ << " open got: " << cpp_strerror(r) << dendl;
return r;
}
Expand Down
1 change: 0 additions & 1 deletion src/os/bluestore/KernelDevice.h
Expand Up @@ -29,7 +29,6 @@ class KernelDevice : public BlockDevice {
string path;
FS *fs;
bool aio, dio;
bufferptr zeros;

Mutex debug_lock;
interval_set<uint64_t> debug_inflight;
Expand Down
6 changes: 0 additions & 6 deletions src/os/bluestore/NVMEDevice.cc
Expand Up @@ -182,7 +182,6 @@ class SharedDriverData {
std::set<uint64_t> flush_waiter_seqs;

public:
bool zero_command_support;
std::atomic_ulong completed_op_seq, queue_op_seq;
PerfCounters *logger = nullptr;

Expand All @@ -202,7 +201,6 @@ class SharedDriverData {
sector_size = spdk_nvme_ns_get_sector_size(ns);
block_size = std::max(CEPH_PAGE_SIZE, sector_size);
size = ((uint64_t)sector_size) * spdk_nvme_ns_get_num_sectors(ns);
zero_command_support = spdk_nvme_ns_get_flags(ns) & SPDK_NVME_NS_WRITE_ZEROES_SUPPORTED;
qpair = spdk_nvme_ctrlr_alloc_io_qpair(c, SPDK_NVME_QPRIO_URGENT);

PerfCountersBuilder b(g_ceph_context, string("NVMEDevice-AIOThread-"+stringify(this)),
Expand Down Expand Up @@ -811,10 +809,6 @@ int NVMEDevice::open(string p)
driver->register_device(this);
block_size = driver->get_block_size();
size = driver->get_size();
if (!driver->zero_command_support) {
zeros = buffer::create_page_aligned(1048576);
zeros.zero();
}

//nvme is non-rotational device.
rotational = false;
Expand Down
1 change: 0 additions & 1 deletion src/os/bluestore/NVMEDevice.h
Expand Up @@ -54,7 +54,6 @@ class NVMEDevice : public BlockDevice {
uint64_t block_size;

bool aio_stop;
bufferptr zeros;

struct BufferedExtents {
struct Extent {
Expand Down

0 comments on commit 533311e

Please sign in to comment.