"[QUESTION]使用HLFS初始化函数的问题"

6 views
Skip to first unread message

Zhen Ren

unread,
Jun 8, 2013, 5:01:02 AM6/8/13
to Harry Wei, clo...@googlegroups.com
下面是一段小程序:
############
 #include <stdio.h>
 #include "hlfs.h"

11 int main(int arg, char *argv[])
12 {
13     struct hlfs_ctrl *ctrl;
14     struct hlfs_stat stat;
15
16    // ctrl = init_hlfs_by_config("hlfs.config");
17       ctrl = init_hlfs("local:///tmp/testenv/testfs");
18     hlfs_stat(ctrl, &stat);
19
20     printf("hlfs name: %s.\n", stat.fsname);
21
22     return 0;
23 }
############
Q1:init_hlfs和init_hlfs_by_config是两种独立的方式吗?

Q2:当入16行使用init_hlfs_by_config的时候,出现错误:
############
$ ./test_initbyconfig 
parse config file error
param error
############

配置文件hlfs.config来自trunk/hlfs/output/conf,如下:
###########
  1 [STORAGE]                                                                                           
  2 storage_uri=local:///tmp/testenv/testfs
  3 #storage_uri=dfs://localhoast/tmp/testenv/testfs
  4 seg_clean_check_period = 10
  5 seg_copy_waterlevel = 128
  6 is_start_clean = TRUE
  7 [CACHE]
  8 is_enable_cache=0
  9 block_size=8192
 10 cache_size=1024
 11 #second
 12 flush_interval=1
 13 #0..100
 14 flush_trigger_level=80
 15 #block
 16 flush_once_size=64
 17 [ICACHE]
 18 is_enable_icache=1
 19 iblock_size=8192
 20 icache_size=1024
 21 invalidate_trigger_level=80
 22 #block
 23 invalidate_once_size=64
###########

Q3:若换成init_hlfs来初始化,出现如下错误:
##########
enter func init_storage_handler
loc [fs:testfs], 
uri:local:///tmp/testenv/testfs, head:local, dir:/tmp/testenv, fsname:testfs, hostname:default,port:0, user:kanghua
leave func init_storage_handler
enter func init_from_superblock
local -- enter func build_local_path, dir:/tmp/testenv, fs:testfs, path:superblock
superblock file can not be accessable
read superblock keyfile error 
##########


我不知道哪里使用错了.
thanks!
--
Ren Zhen

Zhen Ren

unread,
Jun 8, 2013, 5:04:48 AM6/8/13
to Harry Wei, clo...@googlegroups.com

harryxiyou

unread,
Jun 9, 2013, 1:14:43 AM6/9/13
to Zhen Ren, clo...@googlegroups.com
On Sat, Jun 8, 2013 at 5:01 PM, Zhen Ren <renzh...@gmail.com> wrote:
> 下面是一段小程序:
> ############
> #include <stdio.h>
> #include "hlfs.h"
>
> 11 int main(int arg, char *argv[])
> 12 {
> 13 struct hlfs_ctrl *ctrl;
> 14 struct hlfs_stat stat;
> 15
> 16 // ctrl = init_hlfs_by_config("hlfs.config");
> 17 ctrl = init_hlfs("local:///tmp/testenv/testfs");
> 18 hlfs_stat(ctrl, &stat);
> 19
> 20 printf("hlfs name: %s.\n", stat.fsname);
> 21
> 22 return 0;
> 23 }
> ############
> Q1:init_hlfs和init_hlfs_by_config是两种独立的方式吗?

先用init_hlfs吧,init_hlfs_by_config还没好好测试过。

>
> Q2:当入16行使用init_hlfs_by_config的时候,出现错误:
> ############
> $ ./test_initbyconfig
> parse config file error
> param error
> ############
>

同上,你可看看如何解决问题。
格式化hlfs了吗?


--
Thanks
Harry Wei
Reply all
Reply to author
Forward
0 new messages