|
Android-cuttlefish cvd tool
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <fcntl.h>#include <time.h>#include <stdbool.h>#include <assert.h>#include <inttypes.h>#include "f2fs_fs.h"
Macros | |
| #define | F_LINUX_SPECIFIC_BASE 1024 |
| #define | F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12) |
| #define | MIN_NUM_CACHE_ENTRY 1024L |
| #define | MAX_MAX_HASH_COLLISION 16 |
| #define | MAX_CHUNK_SIZE (1 * 1024 * 1024 * 1024ULL) |
| #define | MAX_CHUNK_COUNT (MAX_CHUNK_SIZE / F2FS_BLKSIZE) |
Functions | |
| static int | __get_device_fd (__u64 *offset) |
| static void | dcache_print_statistics (void) |
| void | dcache_release (void) |
| static int | dcache_alloc_all (long n) |
| static void | dcache_relocate_init (void) |
| void | dcache_init (void) |
| static char * | dcache_addr (long entry) |
| static long | dcache_relocate (long entry, int n) |
| static long | dcache_find (__u64 blk) |
| static int | dcache_io_read (long entry, __u64 offset, off_t blk) |
| static int | dcache_update_rw (void *buf, __u64 offset, size_t byte_count, bool is_write) |
| int | dcache_update_cache (void *buf, __u64 offset, size_t count) |
| int | dcache_read (void *buf, __u64 offset, size_t count) |
| int | dev_read_version (void *buf, __u64 offset, size_t len) |
| static int | sparse_read_blk (__u64 UNUSED(block), int UNUSED(count), void *UNUSED(buf)) |
| static int | sparse_write_blk (__u64 UNUSED(block), int UNUSED(count), const void *UNUSED(buf)) |
| static int | sparse_write_zeroed_blk (__u64 UNUSED(block), int UNUSED(count)) |
| int | dev_read (void *buf, __u64 offset, size_t len) |
| int | dev_readahead (__u64 offset, size_t UNUSED(len)) |
| enum rw_hint | f2fs_io_type_to_rw_hint (int seg_type) |
| static int | __dev_write (void *buf, __u64 offset, size_t len, enum rw_hint whint) |
| int | dev_write (void *buf, __u64 offset, size_t len, enum rw_hint whint) |
| int | dev_write_block (void *buf, __u64 blk_addr, enum rw_hint whint) |
| int | dev_write_dump (void *buf, __u64 offset, size_t len) |
| int | dev_write_symlink (char *buf, size_t len) |
| int | dev_fill (void *buf, __u64 offset, size_t len, enum rw_hint whint) |
| int | dev_fill_block (void *buf, __u64 blk_addr, enum rw_hint whint) |
| int | dev_read_block (void *buf, __u64 blk_addr) |
| int | dev_reada_block (__u64 blk_addr) |
| int | f2fs_fsync_device (void) |
| int | f2fs_init_sparse_file (void) |
| void | f2fs_release_sparse_resource (void) |
| int | f2fs_finalize_device (void) |
Variables | |
| struct f2fs_configuration | c |
| static bool * | dcache_valid |
| static off_t * | dcache_blk |
| static uint64_t * | dcache_lastused |
| static char * | dcache_buf |
| static uint64_t | dcache_usetick |
| static uint64_t | dcache_raccess |
| static uint64_t | dcache_rhit |
| static uint64_t | dcache_rmiss |
| static uint64_t | dcache_rreplace |
| static bool | dcache_exit_registered = false |
| static dev_cache_config_t | dcache_config = {0, 16, 1} |
| static bool | dcache_initialized = false |
| static long | dcache_relocate_offset0 [] |
| static int | dcache_relocate_offset [16] |
| #define F_LINUX_SPECIFIC_BASE 1024 |
libf2fs.c
Copyright (c) 2013 Samsung Electronics Co., Ltd. http://www.samsung.com/ Copyright (c) 2019 Google Inc. http://www.google.com/ Copyright (c) 2020 Google Inc. Robin Hsu robin.nosp@m.hsu@.nosp@m.googl.nosp@m.e.co.nosp@m.m : add quick-buffer for sload compression support
Dual licensed under the GPL or LGPL version 2 licenses.
| #define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12) |
| #define MAX_CHUNK_COUNT (MAX_CHUNK_SIZE / F2FS_BLKSIZE) |
| #define MAX_CHUNK_SIZE (1 * 1024 * 1024 * 1024ULL) |
| #define MAX_MAX_HASH_COLLISION 16 |
| #define MIN_NUM_CACHE_ENTRY 1024L |
|
static |
|
inlinestatic |
|
static |
|
static |
| void dcache_init | ( | void | ) |
|
static |
|
static |
| int dcache_read | ( | void * | buf, |
| __u64 | offset, | ||
| size_t | count | ||
| ) |
| void dcache_release | ( | void | ) |
|
inlinestatic |
|
static |
| int dcache_update_cache | ( | void * | buf, |
| __u64 | offset, | ||
| size_t | count | ||
| ) |
|
static |
| int dev_read | ( | void * | buf, |
| __u64 | offset, | ||
| size_t | len | ||
| ) |
| int dev_read_block | ( | void * | buf, |
| __u64 | blk_addr | ||
| ) |
| int dev_read_version | ( | void * | buf, |
| __u64 | offset, | ||
| size_t | len | ||
| ) |
| int dev_reada_block | ( | __u64 | blk_addr | ) |
| int dev_readahead | ( | __u64 | offset, |
| size_t | UNUSEDlen | ||
| ) |
| int dev_write_dump | ( | void * | buf, |
| __u64 | offset, | ||
| size_t | len | ||
| ) |
| int dev_write_symlink | ( | char * | buf, |
| size_t | len | ||
| ) |
| int f2fs_finalize_device | ( | void | ) |
| int f2fs_fsync_device | ( | void | ) |
| int f2fs_init_sparse_file | ( | void | ) |
| enum rw_hint f2fs_io_type_to_rw_hint | ( | int | seg_type | ) |
| void f2fs_release_sparse_resource | ( | void | ) |
|
static |
|
static |
|
static |
| struct f2fs_configuration c |
f2fs_format.c
Copyright (c) 2012 Samsung Electronics Co., Ltd. http://www.samsung.com/
Dual licensed under the GPL or LGPL version 2 licenses.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |