Signed-off-by: Igor Fedotov <ifedotov@suse.com>
--ioc_reap_count;
}
}
+
+bool BlockDevice::is_valid_io(uint64_t off, uint64_t len) const {
+ bool ret = (off % block_size == 0 &&
+ len % block_size == 0 &&
+ len > 0 &&
+ off < size &&
+ off + len <= size);
+
+ if (!ret) {
+ derr << __func__ << " " << std::hex
+ << off << "~" << len
+ << " block_size " << block_size
+ << " size " << size
+ << std::dec << dendl;
+ }
+ return ret;
+}
virtual void close() = 0;
protected:
- bool is_valid_io(uint64_t off, uint64_t len) const {
- return (off % block_size == 0 &&
- len % block_size == 0 &&
- len > 0 &&
- off < size &&
- off + len <= size);
- }
+ bool is_valid_io(uint64_t off, uint64_t len) const;
};
#endif //CEPH_BLK_BLOCKDEVICE_H