diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2016-02-13 17:12:34 -0500 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2016-02-13 23:59:26 +0100 |
commit | 6edf2d7cdecac6031e4ecfcc2b14ba5bed7c02a1 (patch) | |
tree | 56fc5fdc00a0cf64ca1dcd8a816296bbc91c6994 /ftpfs/ftpfs.h | |
parent | 028dfd979c1098f213d3bf9f0fc039ec55da2483 (diff) | |
download | hurd-6edf2d7cdecac6031e4ecfcc2b14ba5bed7c02a1.tar.gz hurd-6edf2d7cdecac6031e4ecfcc2b14ba5bed7c02a1.tar.bz2 hurd-6edf2d7cdecac6031e4ecfcc2b14ba5bed7c02a1.zip |
Use libihash to store directory entries in ftpfs.
* 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.
Diffstat (limited to 'ftpfs/ftpfs.h')
-rw-r--r-- | ftpfs/ftpfs.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/ftpfs/ftpfs.h b/ftpfs/ftpfs.h index 206726f1..a067bfe4 100644 --- a/ftpfs/ftpfs.h +++ b/ftpfs/ftpfs.h @@ -35,7 +35,6 @@ struct ftpfs_conn; struct ftpfs_dir_entry { char *name; /* Name of this entry */ - size_t hv; /* Hash value of NAME (before mod'ing) */ /* The active node referred to by this name (may be 0). NETFS_NODE_REFCNT_LOCK should be held while frobbing this. */ @@ -48,11 +47,6 @@ struct ftpfs_dir_entry /* The directory to which this entry belongs. */ struct ftpfs_dir *dir; - /* Link to next entry in hash bucket, and address of previous entry's (or - hash table's) pointer to this entry. If the SELF_P field is 0, then - this is a deleted entry, awaiting final disposal. */ - struct ftpfs_dir_entry *next, **self_p; - /* Next entry in `directory order', or 0 if none known. */ struct ftpfs_dir_entry *ordered_next, **ordered_self_p; @@ -61,24 +55,23 @@ struct ftpfs_dir_entry hurd_ihash_locp_t inode_locp; /* Used for removing this entry */ + hurd_ihash_locp_t dir_locp; /* Position in the directory table. */ + int noent : 1; /* A negative lookup result. */ int valid : 1; /* Marker for GC'ing. */ + int deleted : 1; /* Indicates a deleted entry. */ }; /* A directory. */ struct ftpfs_dir { - /* Number of entries in HTABLE. */ - size_t num_entries; + /* Hash table mapping names to children nodes. */ + struct hurd_ihash htable; /* The number of entries that have nodes attached. We keep an additional reference to our node if there are any, to prevent it from going away. */ size_t num_live_entries; - /* Hash table of entries. */ - struct ftpfs_dir_entry **htable; - size_t htable_len; /* # of elements in HTABLE (not bytes). */ - /* List of dir entries in `directory order', in a linked list using the ORDERED_NEXT and ORDERED_SELF_P fields in each entry. Not all entries in HTABLE need be in this list. */ |