[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Use libihash to store directory entries in ftpfs.
From: |
Justus Winter |
Subject: |
Re: [PATCH] Use libihash to store directory entries in ftpfs. |
Date: |
Mon, 08 Feb 2016 10:38:43 +0100 |
User-agent: |
alot/0.3.8.dev |
Quoting Flavio Cruz (2016-02-07 15:03:10)
> * ftpfs/ftpfs.h: Add dir_locp for each directory entry and replace the table
> with a libihash table.
> * ftpfs/dir.c: Modify the code to use libihash. Remove several functions such
> as rehash and insert.
Cool!
> -/* Calculate NAME's hash value. */
> -static size_t
> -hash (const char *name)
> +/* Calculate NAME_PTR's hash value. */
> +static hurd_ihash_key_t
> +ihash_hash (const void *name_ptr)
> {
> + const char *name = (const char *) name_ptr;
> size_t hv = 0;
> while (*name)
> hv = ((hv << 5) + *name++) & 0xFFFFFF;
> return hv;
> }
While you are at it, please replace this with hurd_ihash_hash32.
Justus