diff options
author | Tomas Richter <krik3t@gmail.com> | 2009-02-18 13:33:27 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-02-18 13:33:27 -0500 |
commit | 4cacc965afc4fb03a465ffcc6cb3078aeadc3818 (patch) | |
tree | 59f99682f299fbc6d0a877c484d6fde4a11528cb /support/include/exportfs.h | |
parent | 35001db4aaafa8a17e13b8c13cf74508d4a93f2f (diff) | |
download | nfs-utils-4cacc965afc4fb03a465ffcc6cb3078aeadc3818.tar.gz nfs-utils-4cacc965afc4fb03a465ffcc6cb3078aeadc3818.tar.xz nfs-utils-4cacc965afc4fb03a465ffcc6cb3078aeadc3818.zip |
Exportfs and rpc.mountd optimalization
There were some problems with exportfs and rpc.mountd for long export
lists - see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76643
I do optimalization as my bachelors thesis (Facuulty of informatics,
Masaryk's university Brno, Czech Republic), under lead of Yenya
Kasprzak.
Both exportfs and rpc.mount build linked list of exports (shared
functions in export.c). Every time they are inserting new export into
list, they search for same export in list.
I replaced linked list by hash table and functions export_add and
export_lookup by functions hash_export_add and hash_export_lookup
(export.c).
Because some other functions required exportlist as linked list, hash
table has some implementation modification im comparison with ordinary
hash table. It also keeps exports in linked list and has pointer to
head of the list. So there's no need of implementation function
<for_all_in_hash_table>.
Signed-off-by: Tomas Richter <krik3t@gmail.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/include/exportfs.h')
-rw-r--r-- | support/include/exportfs.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/support/include/exportfs.h b/support/include/exportfs.h index c1ba543..a5cf482 100644 --- a/support/include/exportfs.h +++ b/support/include/exportfs.h @@ -52,8 +52,21 @@ typedef struct mexport { * matching one client */ } nfs_export; +#define HASH_TABLE_SIZE 1021 + +typedef struct _exp_hash_entry { + nfs_export * p_first; + nfs_export * p_last; +} exp_hash_entry; + +typedef struct _exp_hash_table { + nfs_export * p_head; + exp_hash_entry entries[HASH_TABLE_SIZE]; +} exp_hash_table; + +extern exp_hash_table exportlist[MCL_MAXTYPES]; + extern nfs_client * clientlist[MCL_MAXTYPES]; -extern nfs_export * exportlist[MCL_MAXTYPES]; nfs_client * client_lookup(char *hname, int canonical); nfs_client * client_find(struct hostent *); @@ -69,7 +82,7 @@ struct hostent * client_resolve(struct in_addr addr); int client_member(char *client, char *name); int export_read(char *fname); -void export_add(nfs_export *); +void export_add(nfs_export *); void export_reset(nfs_export *); nfs_export * export_lookup(char *hname, char *path, int caconical); nfs_export * export_find(struct hostent *, char *path); |