首页 | 公司简介 | 数据恢复 | 成功案例 | 技术中心 | 客户服务 | 服务报价 | 联系我们 | 技术论坛  
 
  北京总部: 4006-505-808
  上 海 部: 021-58358765
  深 圳 部: 0755-83692929
  浙 江 部: 13666673722
  广 州 部: 020-83821091
  重 庆 部: 023-86870422
  福 建 部: 0591-83300680
  哈尔滨部: 13946167430
  其它地区: 4006-505-808

中国联通信息平台-HP-UX数据恢
中国石油管理局-Oracle数据库恢
工商银行山东分行-AIX删除LV数
濮阳市地方税务局-CHKDSK后数据
台湾HD公司-FreeBSD Nas无法启
promise乔鼎硬盘阵列数据恢复成
IBM EXP300 磁盘阵列数据恢复成
NAS 8100无法挂载数据卷

RAID损坏后 对数据的完整备份
LINUX FSCK数据出错灾难应急方
误删除、误格式化数据灾难应急
误GHOST、误一键恢复灾难应急方
磁盘未被格式化,是否格式化数据
raid磁盘阵列OFFLINE后的应急方
硬盘出现异响应急处理
您当前的位置:首页 >> 技术中心 >> 软件数据恢复文栏 >> 正文

The structure of the Reiser file system

static inline int is_key_format_1 (int type) {
    return ( (type == 0 || type == 15) ? 1 : 0);
}

/* old keys (on i386) have k_offset_v2.k_type == 15 (direct and
   indirect) or == 0 (dir items and stat data) */

/* */
int key_format (const struct key * key)
{
    int type;

    type = get_key_type_v2 (key);

    if (is_key_format_1 (type))
        return KEY_FORMAT_1;

    return KEY_FORMAT_2;
}
This actually implies that stat items will always be assumed to have KEY_FORMAT_1, because they, also, have a type of zero in version 2. Key of version 1

Name Size Description
Directory ID 4 the identifier of the directory where the object is located
Object ID 4 the actual identifier of the object ("inode number")
Offset 4 the offset in bytes that this key references
Type 4 the type of item. Possible values are:
Stat: 0
Indirect: 0xfffffffe
Direct: 0xffffffff
Directory: 500
Any: 555

Key of version 2

Name Size Description
Directory ID 4 the identifier of the directory where the object is located
Object ID 4 the actual identifier of the object ("inode number")
Offset 60 bits the offset in bytes that this key references
Type 4 bits the type of item. Possible values are:
Stat: 0
Indirect: 1
Direct: 2
Directory: 3
Any: 15

Only stat items have an offset of 0. Files (direct and indirect items) and directories always start with an offset of 1 so that they are sorted behind the stat item in the leaf nodes. For directory items the "offset" field contains the hash value and generation number of the leftmost directory header of the directory item (see below), not the offset in bytes.

Examples:

The following shows the first two keys of the internal node that is contained in block 8482. The first one is of version 2, the second of version 1.

00000000 02 00 00 00 0e 00 00 00 00 00 00 00 00 00 00 00  ................
Example of a key of version 2

Directory id: 2
Object id: 14
Offset: 0
Type: Stat item (0)

00000000 03 00 00 00 04 00 00 00 01 00 00 00 f4 01 00 00  ............ô...
Example of a key of version 1

Directory id: 3
Object id: 4
Offset: 1
Type: Directory item (500)

Two keys are compared by comparing their directory ids first, and if those are equal, by comparing the object ids, and so on for offset and type. The fact that the Linux reiserfs code generates a warning when the type fields need to be compared for keys stored in memory indicates that the type field does not matter from a structural point of view. The only time the field needs to be compared seems to be during "tail conversion", where a direct item is changed into an indirect one.

Internal nodes

An internal node block consists of the block header, keys, and pointers to child nodes. Other than the figure of the S+-tree above, the internal nodes have all the keys first, which are sorted by the key values. Then following the last key comes the pointers, starting with the pointer to the subtree containing all the keys smaller to the first key.

Internal node layout

The level in the block header should always be larger than 1 for internal nodes. The number of items in the block header denotes the number of keys in the node, not the combined number of keys and pointers. There is always one more pointer than there are keys. The following figure describes the layout of the pointer structure:

本新闻共13页,当前在第04页  
01  02  03  04  05  06  07  08  09  10  
11  12  13  

上一篇:Solaris硬盘分区结构
下一篇:各类unix和linux管理员密码丢失解决方法
返回首页 | 联系我们 | 关于我们 | 招聘信息 | 友情链接 | 网站地图 | 合作伙伴
版权所有 北京北亚数据恢复中心
24小时免费咨询电话:4006-505-808 或 800-810-5880
中关村部:北京市海淀区中关村大街11号E世界A座832B室
皂君庙部:北京市海淀区学院南路68号吉安大厦C座(汇智楼)528室
京ICP备06061795