35#pragma clang diagnostic ignored "-Wc++98-compat"
51#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
52 trace::printf (
"block_device_partition::%s(\"%s\")=@%p\n", __func__,
59#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
60 trace::printf (
"block_device_partition::%s() @%p %s\n", __func__,
this,
70#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
71 trace::printf (
"block_device_partition::%s(%u,%u) @%p\n", __func__,
72 offset, nblocks,
this);
84#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
85 trace::printf (
"block_device_partition_impl::%s()=@%p\n", __func__,
this);
91#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
92 trace::printf (
"block_device_partition_impl::%s() @%p\n", __func__,
this);
98#pragma GCC diagnostic push
99#pragma GCC diagnostic ignored "-Wunused-parameter"
108#pragma GCC diagnostic pop
113#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
114 trace::printf (
"block_device_partition_impl::%s(%u,%u) @%p\n", __func__,
118 partition_offset_blocks_ =
offset;
120 num_blocks_ = nblocks;
123 block_logical_size_bytes_ = parent_.block_logical_size_bytes ();
124 block_physical_size_bytes_ = parent_.block_physical_size_bytes ();
131#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
132 trace::printf (
"block_device_partition_impl::%s(%d) @%p\n", __func__,
136 return parent_.vopen (path, oflag, args);
143#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
144 trace::printf (
"block_device_partition_impl::%s(0x%X, %u, %u) @%p\n",
145 __func__, buf, blknum, nblocks,
this);
148 return parent_.read_block (buf, blknum + partition_offset_blocks_,
157#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
158 trace::printf (
"block_device_partition_impl::%s(0x%X, %u, %u) @%p\n",
159 __func__, buf, blknum, nblocks,
this);
162 return parent_.write_block (buf, blknum + partition_offset_blocks_,
169#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
170 trace::printf (
"block_device_partition_impl::%s() @%p\n", __func__,
this);
173 return parent_.sync ();
179#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
180 trace::printf (
"block_device_partition_impl::%s() @%p\n", __func__,
this);
183 return parent_.close ();
block_device::blknum_t blknum_t
virtual int do_vopen(const char *path, int oflag, std::va_list args) override
virtual int do_close(void) override
virtual ~block_device_partition_impl() override
virtual void do_sync(void) override
virtual int do_vioctl(int request, std::va_list args) override
block_device_partition_impl(block_device &parent)
virtual ssize_t do_write_block(const void *buf, blknum_t blknum, std::size_t nblocks) override
void configure(blknum_t offset, blknum_t nblocks)
virtual ssize_t do_read_block(void *buf, blknum_t blknum, std::size_t nblocks) override
block_device_partition_impl & impl(void) const
block_device_partition(block_device_impl &impl, const char *name)
virtual ~block_device_partition() override
void configure(blknum_t offset, blknum_t nblocks)
const char * name(void) const
int printf(const char *format,...)
Write a formatted string to the trace device.