diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2016-01-16 20:37:29 +0100 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2016-01-16 20:41:06 +0100 |
| commit | aa77b316bfa03a23028c29655bbb2359bb078833 (patch) | |
| tree | 9c65167a36ab25cb9a13ad2e635e5777b2f5c3b3 | |
| parent | 97a67fc9edb25b48a12ce7306d4defbb2135a8b9 (diff) | |
ext4_bcache: remove EXT4_BCACHE_STATIC_INSTANCE obsolete macro
Cache can't be created in static way anymore
| -rw-r--r-- | fs_test/lwext4_generic.c | 17 | ||||
| -rw-r--r-- | lwext4/ext4.h | 6 | ||||
| -rw-r--r-- | lwext4/ext4_bcache.h | 8 |
3 files changed, 3 insertions, 28 deletions
diff --git a/fs_test/lwext4_generic.c b/fs_test/lwext4_generic.c index 3c319ff..243194e 100644 --- a/fs_test/lwext4_generic.c +++ b/fs_test/lwext4_generic.c @@ -58,9 +58,6 @@ static int rw_count = 10; /**@brief Directory test count*/ static int dir_cnt = 0; -/**@brief Static or dynamic cache mode*/ -static bool cache_mode = true; - /**@brief Cleanup after test.*/ static bool cleanup_flag = false; @@ -79,11 +76,8 @@ static bool verbose = 0; /**@brief Block device handle.*/ static struct ext4_blockdev *bd; -/**@brief Static cache instance*/ -EXT4_BCACHE_STATIC_INSTANCE(_lwext4_cache, CONFIG_BLOCK_DEV_CACHE_SIZE, 1024); - /**@brief Block cache handle.*/ -static struct ext4_bcache *bc = &_lwext4_cache; +static struct ext4_bcache *bc; static const char *usage = " \n\ Welcome in ext4 generic demo. \n\ @@ -92,7 +86,6 @@ Usage: \n\ [-i] --input - input file (default = ext2) \n\ [-w] --rw_size - single R/W size (default = 1024 * 1024) \n\ [-c] --rw_count - R/W count (default = 10) \n\ -[-a] --cache - 0 static, 1 dynamic (default = 1) \n\ [-d] --dirs - directory test count (default = 0) \n\ [-l] --clean - clean up after test \n\ [-b] --bstat - block device stats \n\ @@ -165,7 +158,6 @@ static bool parse_opt(int argc, char **argv) {"input", required_argument, 0, 'i'}, {"rw_size", required_argument, 0, 's'}, {"rw_count", required_argument, 0, 'c'}, - {"cache", required_argument, 0, 'a'}, {"dirs", required_argument, 0, 'd'}, {"clean", no_argument, 0, 'l'}, {"bstat", no_argument, 0, 'b'}, @@ -188,9 +180,6 @@ static bool parse_opt(int argc, char **argv) case 'c': rw_count = atoi(optarg); break; - case 'a': - cache_mode = atoi(optarg); - break; case 'd': dir_cnt = atoi(optarg); break; @@ -231,7 +220,6 @@ int main(int argc, char **argv) printf("\timput name: %s\n", input_name); printf("\trw size: %d\n", rw_szie); printf("\trw count: %d\n", rw_count); - printf("\tcache mode: %s\n", cache_mode ? "dynamic" : "static"); if (!open_filedev()) { printf("open_filedev error\n"); @@ -241,9 +229,6 @@ int main(int argc, char **argv) if (verbose) ext4_dmask_set(DEBUG_ALL); - if (cache_mode) - bc = NULL; - if (!test_lwext4_mount(bd, bc)) return EXIT_FAILURE; diff --git a/lwext4/ext4.h b/lwext4/ext4.h index ed106d7..69cb620 100644 --- a/lwext4/ext4.h +++ b/lwext4/ext4.h @@ -157,11 +157,9 @@ typedef struct ext4_dir { /**@brief Register a block device to a name. * @warning Block device has to be filled by - * @ref EXT4_BLOCKDEV_STATIC_INSTANCE. Block cache may be created - * @ref EXT4_BCACHE_STATIC_INSTANCE. - * Block cache may by created automatically when bc parameter is 0. + * Block cache may by created automatically when bc parameter is NULL. * @param bd block device - * @param bd block device cache (0 = automatic cache mode) + * @param bd block device cache * @param dev_name register name * @param standard error code*/ int ext4_device_register(struct ext4_blockdev *bd, struct ext4_bcache *bc, diff --git a/lwext4/ext4_bcache.h b/lwext4/ext4_bcache.h index 880ec14..61751f7 100644 --- a/lwext4/ext4_bcache.h +++ b/lwext4/ext4_bcache.h @@ -186,14 +186,6 @@ static inline void ext4_bcache_clear_dirty(struct ext4_buf *buf) { /**@brief Decrement reference counter of buf by 1.*/ #define ext4_bcache_dec_ref(buf) ((buf)->refctr--) -/**@brief Static initializer of block cache structure.*/ -#define EXT4_BCACHE_STATIC_INSTANCE(__name, __cnt, __itemsize) \ - static struct ext4_bcache __name = { \ - .cnt = __cnt, \ - .itemsize = __itemsize, \ - .lru_ctr = 0, \ - } - /**@brief Insert buffer to dirty cache list * @param bc block cache descriptor * @param buf buffer descriptor */ |
