selinux: update filenametr_hash() to use full_name_hash()
Using full_name_hash() instead of partial_name_hash() should result in cleaner and better performing code. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
@@ -409,16 +409,9 @@ out:
|
||||
static u32 filenametr_hash(const void *k)
|
||||
{
|
||||
const struct filename_trans_key *ft = k;
|
||||
unsigned long hash;
|
||||
unsigned int byte_num;
|
||||
unsigned char focus;
|
||||
unsigned long salt = ft->ttype ^ ft->tclass;
|
||||
|
||||
hash = ft->ttype ^ ft->tclass;
|
||||
|
||||
byte_num = 0;
|
||||
while ((focus = ft->name[byte_num++]))
|
||||
hash = partial_name_hash(focus, hash);
|
||||
return hash;
|
||||
return full_name_hash((void *)salt, ft->name, strlen(ft->name));
|
||||
}
|
||||
|
||||
static int filenametr_cmp(const void *k1, const void *k2)
|
||||
|
||||
Reference in New Issue
Block a user