Lines Matching refs:fbl
17 #include <fbl/algorithm.h>
18 #include <fbl/array.h>
19 #include <fbl/auto_call.h>
20 #include <fbl/macros.h>
21 #include <fbl/new.h>
22 #include <fbl/unique_ptr.h>
118 digest::Digest* out_digest, fbl::Array<uint8_t>* out_merkle) {
121 auto merkle_tree = fbl::unique_ptr<uint8_t[]>(new uint8_t[merkle_size]);
134 digest::Digest digest, fbl::Array<uint8_t> merkle) {
136 size_t data_blocks = fbl::round_up(length, kBlobfsBlockSize) / kBlobfsBlockSize;
139 auto compressed_data = fbl::unique_ptr<uint8_t[]>(new uint8_t[max]);
147 data_blocks = fbl::round_up(compressor.Size(), kBlobfsBlockSize) / kBlobfsBlockSize;
155 fbl::unique_ptr<InodeBlock> inode_block;
178 } else if ((status = bs->WriteNode(fbl::move(inode_block))) != ZX_OK) {
189 zx_status_t blobfs_create(fbl::unique_ptr<Blobfs>* out, fbl::unique_fd fd) {
205 fbl::AllocChecker ac;
206 fbl::Array<size_t> extent_lengths(new (&ac) size_t[EXTENT_COUNT], EXTENT_COUNT);
216 if ((status = Blobfs::Create(fbl::move(fd), 0, info_block, extent_lengths, out)) != ZX_OK) {
224 zx_status_t blobfs_create_sparse(fbl::unique_ptr<Blobfs>* out, fbl::unique_fd fd, off_t start,
225 off_t end, const fbl::Vector<size_t>& extent_vector) {
255 fbl::AllocChecker ac;
256 fbl::Array<size_t> extent_lengths(new (&ac) size_t[EXTENT_COUNT], EXTENT_COUNT);
266 if ((status = Blobfs::Create(fbl::move(fd), start, info_block, extent_lengths, out)) != ZX_OK) {
275 fbl::Array<uint8_t>* out_merkle) {
293 fbl::Array<uint8_t> merkle_tree;
301 fbl::move(digest),
302 fbl::move(merkle_tree));
306 digest::Digest digest, fbl::Array<uint8_t> merkle) {
314 fbl::move(digest), fbl::move(merkle));
317 zx_status_t blobfs_fsck(fbl::unique_fd fd, off_t start, off_t end,
318 const fbl::Vector<size_t>& extent_lengths) {
319 fbl::unique_ptr<Blobfs> blob;
321 if ((status = blobfs_create_sparse(&blob, fbl::move(fd), start, end, extent_lengths)) != ZX_OK) {
323 } else if ((status = blobfs_check(fbl::move(blob))) != ZX_OK) {
329 Blobfs::Blobfs(fbl::unique_fd fd, off_t offset, const info_block_t& info_block,
330 const fbl::Array<size_t>& extent_lengths)
331 : blockfd_(fbl::move(fd)),
345 zx_status_t Blobfs::Create(fbl::unique_fd blockfd_, off_t offset, const info_block_t& info_block,
346 const fbl::Array<size_t>& extent_lengths,
347 fbl::unique_ptr<Blobfs>* out) {
362 auto fs = fbl::unique_ptr<Blobfs>(new Blobfs(fbl::move(blockfd_), offset,
370 *out = fbl::move(fs);
397 zx_status_t Blobfs::NewBlob(const Digest& digest, fbl::unique_ptr<InodeBlock>* out) {
432 fbl::AllocChecker ac;
435 fbl::unique_ptr<InodeBlock> ino_block(
444 *out = fbl::move(ino_block);
462 uint64_t bbm_end_block = fbl::round_up(start_block + nblocks, kBlobfsBlockBits) / kBlobfsBlockBits;
476 zx_status_t Blobfs::WriteNode(fbl::unique_ptr<InodeBlock> ino_block) {
585 fbl::unique_ptr<uint8_t[]> data(new uint8_t[target_size]);
603 fbl::unique_ptr<uint8_t[]> compressed_data(new uint8_t[compressed_size]);