#include <block-device.h>
Inheritance diagram for os::posix::block_device_lockable< T, L >:Public Types | |
| using | blknum_t = std::size_t |
| using | lockable_type = L |
| using | value_type = T |
Types & Constants | |
| enum class | type : type_t { unknown = 0 , not_set = 1 << 0 , char_device = 1 << 1 , block_device = 1 << 2 , tty = 1 << 3 , file = 1 << 4 , socket = 1 << 5 } |
| using | type_t = unsigned int |
Public Member Functions | |
Constructors & Destructor | |
| template<typename... Args> | |
| block_device_lockable (const char *name, lockable_type &locker, Args &&... args) | |
| virtual | ~block_device_lockable () override |
Public Member Functions | |
| virtual int | close (void) override |
| virtual ssize_t | read (void *buf, std::size_t nbyte) override |
| virtual ssize_t | write (const void *buf, std::size_t nbyte) override |
| virtual ssize_t | writev (const iovec *iov, int iovcnt) override |
| virtual int | vfcntl (int cmd, std::va_list args) override |
| virtual int | vioctl (int request, std::va_list args) override |
| virtual off_t | lseek (off_t offset, int whence) override |
| virtual ssize_t | read_block (void *buf, blknum_t blknum, std::size_t nblocks=1) override |
| virtual ssize_t | write_block (const void *buf, blknum_t blknum, std::size_t nblocks=1) override |
| virtual void | sync (void) override |
| value_type & | impl (void) const |
Public Member Functions | |
| blknum_t | blocks (void) |
| std::size_t | block_logical_size_bytes (void) |
| std::size_t | block_physical_size_bytes (void) |
Public Member Functions | |
| int | fcntl (int cmd,...) |
| int | isatty (void) |
| virtual int | fstat (struct stat *buf) |
| type_t | get_type (void) const |
| file_descriptor_t | file_descriptor (void) const |
| bool | is_opened (void) |
Protected Member Functions | |
Private Member Functions | |
| void | file_descriptor (file_descriptor_t fildes) |
| void | clear_file_descriptor (void) |
| io * | alloc_file_descriptor (void) |
Public Member Functions | |
| int | open (const char *path=nullptr, int oflag=0,...) |
| int | vopen (const char *path, int oflag, std::va_list args) |
| int | ioctl (int request,...) |
| virtual bool | match_name (const char *name) const |
| const char * | name (void) const |
| static const char * | device_prefix (void) |
Definition at line 334 of file block-device.h.
|
inherited |
Definition at line 65 of file block-device.h.
| using os::posix::block_device_lockable< T, L >::lockable_type = L |
Definition at line 340 of file block-device.h.
|
inherited |
| using os::posix::block_device_lockable< T, L >::value_type = T |
Definition at line 339 of file block-device.h.
|
stronginherited |
| Enumerator | |
|---|---|
| unknown | |
| not_set | |
| char_device | |
| block_device | |
| tty | |
| file | |
| socket | |
Definition at line 126 of file io.h.
| os::posix::block_device_lockable< T, L >::block_device_lockable | ( | const char * | name, |
| lockable_type & | locker, | ||
| Args &&... | args | ||
| ) |
Definition at line 519 of file block-device.h.
References os::trace::printf().
|
overridevirtual |
Definition at line 533 of file block-device.h.
References os::trace::printf().
|
protectedinherited |
Definition at line 189 of file io.cpp.
References os::posix::file_descriptors_manager::allocate(), os::posix::io::clear_file_descriptor(), os::posix::io_impl::do_close(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::socket::accept(), os::posix::socket(), os::posix::device::vopen(), and os::posix::file_system::vopen().
|
inlineinherited |
Definition at line 461 of file block-device.h.
References os::posix::block_device::impl().
|
inlineinherited |
Definition at line 467 of file block-device.h.
References os::posix::block_device::impl().
|
inlineinherited |
Definition at line 455 of file block-device.h.
References os::posix::block_device::impl().
|
inlineprotectedinherited |
Definition at line 446 of file io.h.
References os::posix::no_file_descriptor.
Referenced by os::posix::io::alloc_file_descriptor().
|
overridevirtual |
Reimplemented from os::posix::device.
Definition at line 545 of file block-device.h.
References os::posix::device::close(), and os::trace::printf().
|
inlinestaticinherited |
|
inherited |
Definition at line 363 of file io.cpp.
References os::posix::io::vfcntl().
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 452 of file io.h.
Referenced by os::posix::file_descriptors_manager::allocate(), os::posix::file_descriptors_manager::assign(), os::posix::device::vopen(), and os::posix::vopen().
|
virtualinherited |
Reimplemented in os::posix::file_lockable< T, L >.
Definition at line 416 of file io.cpp.
References os::posix::io_impl::do_fstat(), os::posix::io::impl(), and os::trace::printf().
Referenced by os::posix::file_lockable< T, L >::fstat().
|
inlineinherited |
Definition at line 434 of file io.h.
Referenced by os::posix::file_descriptors_manager::socket().
| block_device_lockable< T, L >::value_type & os::posix::block_device_lockable< T, L >::impl | ( | void | ) | const |
Definition at line 686 of file block-device.h.
|
inherited |
Definition at line 135 of file device.cpp.
References os::posix::device::vioctl().
|
inlineinherited |
Definition at line 458 of file io.h.
References os::posix::io_impl::do_is_opened(), and os::posix::io::impl().
|
inherited |
Definition at line 406 of file io.cpp.
References os::posix::io_impl::do_isatty(), and os::posix::io::impl().
|
overridevirtual |
Reimplemented from os::posix::io.
Definition at line 629 of file block-device.h.
References os::posix::io::lseek(), and os::trace::printf().
|
virtualinherited |
Definition at line 189 of file device.cpp.
References os::posix::device::name().
|
inlineinherited |
Definition at line 304 of file device.h.
Referenced by os::posix::device_registry< T >::link(), and os::posix::device::match_name().
|
inherited |
| path | May be nullptr. |
| oflag | Output flags |
Definition at line 62 of file device.cpp.
References os::posix::device::vopen().
|
overridevirtual |
Reimplemented from os::posix::io.
Definition at line 558 of file block-device.h.
References os::trace::printf(), and os::posix::io::read().
|
overridevirtual |
Reimplemented from os::posix::block_device.
Definition at line 643 of file block-device.h.
References os::trace::printf(), and os::posix::block_device::read_block().
|
overridevirtual |
Reimplemented from os::posix::device.
Definition at line 673 of file block-device.h.
References os::trace::printf(), and os::posix::device::sync().
|
overridevirtual |
Reimplemented from os::posix::io.
Definition at line 601 of file block-device.h.
References os::trace::printf(), and os::posix::io::vfcntl().
|
overridevirtual |
Reimplemented from os::posix::block_device.
Definition at line 615 of file block-device.h.
References os::trace::printf(), and os::posix::block_device::vioctl().
|
inherited |
| path | May be nullptr. |
| oflag | Output flags |
| args | Arguments |
Definition at line 74 of file device.cpp.
References os::posix::io::alloc_file_descriptor(), os::posix::device_impl::do_vopen(), os::posix::io::file_descriptor(), os::posix::device::impl(), and os::trace::printf().
Referenced by os::posix::device::open().
|
overridevirtual |
Reimplemented from os::posix::io.
Definition at line 572 of file block-device.h.
References os::trace::printf(), and os::posix::io::write().
|
overridevirtual |
Reimplemented from os::posix::block_device.
Definition at line 658 of file block-device.h.
References os::trace::printf(), and os::posix::block_device::write_block().
|
overridevirtual |
Reimplemented from os::posix::io.
Definition at line 586 of file block-device.h.
References os::trace::printf(), and os::posix::io::writev().