For directIO requirement, we need check bufferpt whether size aligned
and the address aligned. To do this, we should call is_aligned &&
is_n_align_sized. Every func also list all ptr of bufferlist.
To reduce one list, we add is_aligned_size_and_memroy(align_size,
align_memory) which only need list once.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
return true;
}
+ bool buffer::list::is_aligned_size_and_memory(unsigned align_size,
+ unsigned align_memory) const
+ {
+ for (std::list<ptr>::const_iterator it = _buffers.begin();
+ it != _buffers.end();
+ ++it) {
+ if (!it->is_aligned(align_memory) || !it->is_n_align_sized(align_size))
+ return false;
+ }
+ return true;
+ }
+
bool buffer::list::is_zero() const {
for (std::list<ptr>::const_iterator it = _buffers.begin();
it != _buffers.end();
bool is_page_aligned() const;
bool is_n_align_sized(unsigned align) const;
bool is_n_page_sized() const;
+ bool is_aligned_size_and_memory(unsigned align_size,
+ unsigned align_memory) const;
bool is_zero() const;