LLFIO v2.00
Loading...
Searching...
No Matches
llfio_v2_xxx::directory_handle::buffers_type Struct Reference

#include "directory_handle.hpp"

Inheritance diagram for llfio_v2_xxx::directory_handle::buffers_type:

Public Types

using _base = span< buffer_type >
 

Public Member Functions

stat_t::want metadata () const noexcept
 
bool done () const noexcept
 Whether the directory was entirely read or not into any buffers supplied.
 
bool is_snapshot () const noexcept
 Whether the enumeration is an atomically consistent snapshot or not.
 
template<class T , typename std::enable_if<(!std::is_same< typename std::decay< T >::type, buffers_type >::value &&std::is_constructible< span< buffer_type >, T >::value), bool >::type = true>
constexpr buffers_type (T &&s, _implict_span_constructor_tag={}) noexcept
 Constructor taking any type acceptable to span.
 
 buffers_type (span< buffer_type > v, buffers_type &&o) noexcept
 Construct from a span, using a kernel buffer from a preceding buffers_type.
 
 buffers_type (buffers_type &&o) noexcept
 Move constructor.
 
 buffers_type (const buffers_type &)=delete
 No copy construction.
 
buffers_typeoperator= (buffers_type &&o) noexcept
 Move assignment.
 
buffers_typeoperator= (const buffers_type &)=delete
 No copy assignment.
 

Friends

class directory_handle
 

Detailed Description

The buffers type used by this handle, which is a contiguous sequence of directory_entry.

Warning
Unless you supply your own kernel buffer, you need to keep this around as long as you use any of the directory entries, as their leafnames are views of the original buffer filled by the kernel and the existence of this keeps that original buffer around.

Constructor & Destructor Documentation

◆ buffers_type() [1/3]

template<class T , typename std::enable_if<(!std::is_same< typename std::decay< T >::type, buffers_type >::value &&std::is_constructible< span< buffer_type >, T >::value), bool >::type = true>
constexpr llfio_v2_xxx::directory_handle::buffers_type::buffers_type ( T &&  s,
_implict_span_constructor_tag  = {} 
)
inlineconstexprnoexcept

Constructor taking any type acceptable to span.

132 {}) noexcept
133 : _base(std::forward<T>(s))
134 {
135 }

◆ buffers_type() [2/3]

llfio_v2_xxx::directory_handle::buffers_type::buffers_type ( span< buffer_type v,
buffers_type &&  o 
)
inlinenoexcept

Construct from a span, using a kernel buffer from a preceding buffers_type.

138 : _base(std::move(v))
139 , _kernel_buffer(std::move(o._kernel_buffer))
140 , _kernel_buffer_size(o._kernel_buffer_size)
141 , _metadata(o._metadata)
142 , _done(o._done)
143 {
144 static_cast<_base &>(o) = {};
145 o._kernel_buffer_size = 0;
146 }

◆ buffers_type() [3/3]

llfio_v2_xxx::directory_handle::buffers_type::buffers_type ( buffers_type &&  o)
inlinenoexcept

Move constructor.

150 : _base(std::move(o))
151 , _kernel_buffer(std::move(o._kernel_buffer))
152 , _kernel_buffer_size(o._kernel_buffer_size)
153 , _metadata(o._metadata)
154 , _done(o._done)
155 {
156 static_cast<_base &>(o) = {};
157 o._kernel_buffer_size = 0;
158 }

Member Function Documentation

◆ done()

bool llfio_v2_xxx::directory_handle::buffers_type::done ( ) const
inlinenoexcept

Whether the directory was entirely read or not into any buffers supplied.

117{ return _done; }

◆ is_snapshot()

bool llfio_v2_xxx::directory_handle::buffers_type::is_snapshot ( ) const
inlinenoexcept

Whether the enumeration is an atomically consistent snapshot or not.

119{ return _snapshot; }

◆ metadata()

stat_t::want llfio_v2_xxx::directory_handle::buffers_type::metadata ( ) const
inlinenoexcept

The list of stat metadata retrieved. Sometimes, due to kernel API design, enumerating a directory retrieves more than the metadata requested in the read request. This indidicates what stat metadata is in the buffers filled.

115{ return _metadata; }

◆ operator=()

buffers_type & llfio_v2_xxx::directory_handle::buffers_type::operator= ( buffers_type &&  o)
inlinenoexcept

Move assignment.

163 {
164 if(this == &o)
165 {
166 return *this;
167 }
168 std::unique_ptr<char[]> kernel_buffer = std::move(_kernel_buffer);
169 size_t kernel_buffer_size = _kernel_buffer_size;
170 this->~buffers_type();
171 new(this) buffers_type(std::move(o));
172 if(kernel_buffer_size > _kernel_buffer_size)
173 {
174 _kernel_buffer.reset();
175 _kernel_buffer = std::move(kernel_buffer);
176 _kernel_buffer_size = kernel_buffer_size;
177 }
178 return *this;
179 }

The documentation for this struct was generated from the following file: