Lines Matching refs:fbl
10 #include <fbl/auto_call.h>
11 #include <fbl/function.h>
26 bool (*TestBlockFilter)(const fbl::unique_fd&) = nullptr;
27 bool (*TestSkipBlockFilter)(const fbl::unique_fd&) = nullptr;
31 bool KernelFilterCallback(const gpt_partition_t& part, fbl::StringPiece partition_name) {
54 fbl::unique_ptr<T> WrapUnique(T* ptr) {
55 return fbl::unique_ptr<T>(ptr);
60 fbl::Function<bool(const fbl::unique_fd&)> should_filter_file,
61 zx_duration_t timeout, fbl::unique_fd* out_partition) {
65 fbl::unique_fd* out_partition;
66 fbl::Function<bool(const fbl::unique_fd&)> should_filter_file;
71 .should_filter_file = fbl::move(should_filter_file),
81 fbl::unique_fd devfd(openat(dirfd, filename, O_RDWR));
90 *(info->out_partition) = fbl::move(devfd);
99 const auto closer = fbl::MakeAutoCall([&dir]() { closedir(dir); });
111 zx_duration_t timeout, fbl::unique_fd* out_fd) {
114 auto cb = [&](const fbl::unique_fd& fd) {
140 fbl::unique_fd* out_fd) {
143 auto cb = [&](const fbl::unique_fd& fd) {
171 fbl::unique_fd fd;
208 fbl::unique_ptr<DevicePartitioner> DevicePartitioner::Create() {
209 fbl::unique_ptr<DevicePartitioner> device_partitioner;
213 return fbl::move(device_partitioner);
218 return fbl::move(device_partitioner);
228 bool GptDevicePartitioner::FindTargetGptPath(fbl::String* out) {
234 const auto closer = fbl::MakeAutoCall([&]() { closedir(d); });
238 fbl::unique_fd fd(openat(dirfd(d), de->d_name, O_RDWR));
267 zx_status_t GptDevicePartitioner::InitializeGpt(fbl::unique_ptr<GptDevicePartitioner>* gpt_out) {
268 fbl::String gpt_path;
273 fbl::unique_fd fd(open(gpt_path.c_str(), O_RDWR));
291 auto releaser = fbl::MakeAutoCall([&]() { gpt_device_release(gpt); });
317 *gpt_out = fbl::move(WrapUnique(new GptDevicePartitioner(fbl::move(fd), gpt, block_info)));
415 size_t optional_reserve_bytes, fbl::unique_fd* out_fd) {
437 length = fbl::round_up(minimum_size_bytes, block_info_.block_size) / block_info_.block_size;
456 fbl::unique_fd* out_fd) {
482 fbl::unique_fd* out_fd) const {
542 zx_status_t EfiDevicePartitioner::Initialize(fbl::unique_ptr<DevicePartitioner>* partitioner) {
543 fbl::unique_ptr<GptDevicePartitioner> gpt;
554 *partitioner = fbl::move(WrapUnique(new EfiDevicePartitioner(fbl::move(gpt))));
564 zx_status_t EfiDevicePartitioner::AddPartition(Partition partition_type, fbl::unique_fd* out_fd) {
610 fbl::unique_fd* out_fd) const {
634 zx_status_t EfiDevicePartitioner::WipePartitions(const fbl::Vector<Partition>& partitions) {
648 fbl::Vector<const uint8_t*> partition_list;
697 zx_status_t EfiDevicePartitioner::GetBlockSize(const fbl::unique_fd& device_fd,
711 zx_status_t CrosDevicePartitioner::Initialize(fbl::unique_ptr<DevicePartitioner>* partitioner) {
712 fbl::unique_ptr<GptDevicePartitioner> gpt_partitioner;
736 *partitioner = fbl::move(WrapUnique(new CrosDevicePartitioner(fbl::move(gpt_partitioner))));
745 fbl::unique_fd* out_fd) {
775 fbl::unique_fd* out_fd) const {
857 zx_status_t CrosDevicePartitioner::WipePartitions(const fbl::Vector<Partition>& partitions) {
866 fbl::Vector<const uint8_t*> partition_list;
902 zx_status_t CrosDevicePartitioner::GetBlockSize(const fbl::unique_fd& device_fd,
916 zx_status_t FixedDevicePartitioner::Initialize(fbl::unique_ptr<DevicePartitioner>* partitioner) {
921 *partitioner = fbl::move(WrapUnique(new FixedDevicePartitioner));
926 fbl::unique_fd* out_fd) const {
958 zx_status_t FixedDevicePartitioner::WipePartitions(const fbl::Vector<Partition>& partitions) {
979 zx_status_t FixedDevicePartitioner::GetBlockSize(const fbl::unique_fd& device_fd,
995 fbl::unique_ptr<DevicePartitioner>* partitioner) {
1001 *partitioner = fbl::move(WrapUnique(new SkipBlockDevicePartitioner));
1006 fbl::unique_fd* out_fd) const {
1044 zx_status_t SkipBlockDevicePartitioner::WipePartitions(const fbl::Vector<Partition>& partitions) {
1065 zx_status_t SkipBlockDevicePartitioner::GetBlockSize(const fbl::unique_fd& device_fd,