diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-21 11:13:29 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-21 11:13:29 -0400 |
commit | 8a2c8123c5ee5b09f3b8265e5e6db2e687d29e99 (patch) | |
tree | 4e608f93d52d4df45d20e3482ac8acaf02244118 /dir-item.c | |
parent | b55672a2a1694d27b73f8233efcc1d986bfc797a (diff) | |
download | btrfs-progs-8a2c8123c5ee5b09f3b8265e5e6db2e687d29e99.tar.gz |
create a root dir in mkfs
Diffstat (limited to 'dir-item.c')
-rw-r--r-- | dir-item.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -21,7 +21,12 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root key.objectid = dir; key.flags = 0; btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); - ret = btrfs_name_hash(name, name_len, &key.offset); + if (name_len == 1 && *name == '.') + key.offset = 1; + else if (name_len == 2 && name[0] == '.' && name[1] == '.') + key.offset = 2; + else + ret = btrfs_name_hash(name, name_len, &key.offset); BUG_ON(ret); btrfs_init_path(&path); data_size = sizeof(*dir_item) + name_len; |