diff options
Diffstat (limited to 'fs/btrfs/dir-item.c')
-rw-r--r-- | fs/btrfs/dir-item.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index 949c4e526798..4d8083d92fa0 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c | |||
@@ -1,7 +1,4 @@ | |||
1 | #include <stdio.h> | 1 | #include <linux/module.h> |
2 | #include <stdlib.h> | ||
3 | #include "kerncompat.h" | ||
4 | #include "radix-tree.h" | ||
5 | #include "ctree.h" | 2 | #include "ctree.h" |
6 | #include "disk-io.h" | 3 | #include "disk-io.h" |
7 | #include "hash.h" | 4 | #include "hash.h" |
@@ -21,7 +18,12 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | |||
21 | key.objectid = dir; | 18 | key.objectid = dir; |
22 | key.flags = 0; | 19 | key.flags = 0; |
23 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); | 20 | btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); |
24 | ret = btrfs_name_hash(name, name_len, &key.offset); | 21 | if (name_len == 1 && *name == '.') |
22 | key.offset = 1; | ||
23 | else if (name_len == 2 && name[0] == '.' && name[1] == '.') | ||
24 | key.offset = 2; | ||
25 | else | ||
26 | ret = btrfs_name_hash(name, name_len, &key.offset); | ||
25 | BUG_ON(ret); | 27 | BUG_ON(ret); |
26 | btrfs_init_path(&path); | 28 | btrfs_init_path(&path); |
27 | data_size = sizeof(*dir_item) + name_len; | 29 | data_size = sizeof(*dir_item) + name_len; |