Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore/KernelDevice: kill zeros #12856

Merged
merged 4 commits into from Jan 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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