lkml.org 
[lkml]   [2005]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][FAT] FAT dirent scan with hin take #3
Pekka Enberg wrote:
> On 8/31/05, Machida, Hiroyuki <machida@sm.sony.co.jp> wrote:
>
>>+inline
>>+static int hint_index_body(const unsigned char *name, int name_len, int check_null)
>>+{
>>+ int i;
>>+ int val = 0;
>>+ unsigned char *p = (unsigned char *) name;
>>+ int id = current->pid;
>>+
>>+ for (i=0; i<name_len; i++) {
>>+ if (check_null && !*p) break;
>>+ val = ((val << 1) & 0xfe) | ((val & 0x80) ? 1 : 0);
>>+ val ^= *p;
>>+ p ++;
>>+ }
>>+ id = ((id >> 8) & 0xf) ^ (id & 0xf);
>>+ val = (val << 1) | (id & 1);
>>+ return val & (FAT_SCAN_NWAY-1);
>
>
> Couldn't you use jhash() from <linux/jhash.h> here?
>
> Pekka
Thanks, I'll replace it with functions in jhash.h, then
check performance again.

--
Hiroyuki Machida machida@sm.sony.co.jp

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-31 15:29    [W:0.127 / U:9.364 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site