Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348148
b: refs/heads/master
c: 38e0abd
h: refs/heads/master
v: v3
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Dec 26, 2012
1 parent 51f7bfa commit 978597d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1362b5e347e27102ea0fa99c9932bca1ecde330f
refs/heads/master: 38e0abdcfb5e69aa61a1e9b474d434afc1c177a9
4 changes: 2 additions & 2 deletions trunk/fs/f2fs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,13 @@ int f2fs_make_empty(struct inode *inode, struct inode *parent)

de = &dentry_blk->dentry[0];
de->name_len = cpu_to_le16(1);
de->hash_code = 0;
de->hash_code = f2fs_dentry_hash(".", 1);
de->ino = cpu_to_le32(inode->i_ino);
memcpy(dentry_blk->filename[0], ".", 1);
set_de_type(de, inode);

de = &dentry_blk->dentry[1];
de->hash_code = 0;
de->hash_code = f2fs_dentry_hash("..", 2);
de->name_len = cpu_to_le16(2);
de->ino = cpu_to_le32(parent->i_ino);
memcpy(dentry_blk->filename[1], "..", 2);
Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/f2fs/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ f2fs_hash_t f2fs_dentry_hash(const char *name, int len)
const char *p;
__u32 in[8], buf[4];

if ((len <= 2) && (name[0] == '.') &&
(name[1] == '.' || name[1] == '\0'))
return 0;

/* Initialize the default seed for the hash checksum functions */
buf[0] = 0x67452301;
buf[1] = 0xefcdab89;
Expand Down

0 comments on commit 978597d

Please sign in to comment.