mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Merge branch 'salted-string-hash'
This changes the vfs dentry hashing to mix in the parent pointer at the _beginning_ of the hash, rather than at the end. That actually improves both the hash and the code generation, because we can move more of the computation to the "static" part of the dcache setup, and do less at lookup runtime. It turns out that a lot of other hash users also really wanted to mix in a base pointer as a 'salt' for the hash, and so the slightly extended interface ends up working well for other cases too. Users that want a string hash that is purely about the string pass in a 'salt' pointer of NULL. * merge branch 'salted-string-hash': fs/dcache.c: Save one 32-bit multiply in dcache lookup vfs: make the string hashes salt the hash
This commit is contained in:
commit
554828ee0d
39 changed files with 107 additions and 95 deletions
|
|
@ -1525,7 +1525,6 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
|
|||
goto err;
|
||||
fuse_copy_finish(cs);
|
||||
buf[outarg.namelen] = 0;
|
||||
name.hash = full_name_hash(name.name, name.len);
|
||||
|
||||
down_read(&fc->killsb);
|
||||
err = -ENOENT;
|
||||
|
|
@ -1576,7 +1575,6 @@ static int fuse_notify_delete(struct fuse_conn *fc, unsigned int size,
|
|||
goto err;
|
||||
fuse_copy_finish(cs);
|
||||
buf[outarg.namelen] = 0;
|
||||
name.hash = full_name_hash(name.name, name.len);
|
||||
|
||||
down_read(&fc->killsb);
|
||||
err = -ENOENT;
|
||||
|
|
|
|||
|
|
@ -955,6 +955,7 @@ int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
|
|||
if (!dir)
|
||||
goto unlock;
|
||||
|
||||
name->hash = full_name_hash(dir, name->name, name->len);
|
||||
entry = d_lookup(dir, name);
|
||||
dput(dir);
|
||||
if (!entry)
|
||||
|
|
@ -1204,7 +1205,7 @@ static int fuse_direntplus_link(struct file *file,
|
|||
|
||||
fc = get_fuse_conn(dir);
|
||||
|
||||
name.hash = full_name_hash(name.name, name.len);
|
||||
name.hash = full_name_hash(parent, name.name, name.len);
|
||||
dentry = d_lookup(parent, &name);
|
||||
if (!dentry) {
|
||||
retry:
|
||||
|
|
|
|||
Loading…
Reference in a new issue