summaryrefslogtreecommitdiffstats
path: root/utils/exportfs
diff options
context:
space:
mode:
authorTomas Richter <krik3t@gmail.com>2009-02-18 13:33:27 -0500
committerSteve Dickson <steved@redhat.com>2009-02-18 13:33:27 -0500
commit4cacc965afc4fb03a465ffcc6cb3078aeadc3818 (patch)
tree59f99682f299fbc6d0a877c484d6fde4a11528cb /utils/exportfs
parent35001db4aaafa8a17e13b8c13cf74508d4a93f2f (diff)
downloadnfs-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 'utils/exportfs')
-rw-r--r--utils/exportfs/exportfs.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index fec2571..593a8eb 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -111,7 +111,6 @@ main(int argc, char **argv)
return 0;
}
}
-
if (f_export && ! f_ignore)
export_read(_PATH_EXPORTS);
if (f_export) {
@@ -193,10 +192,10 @@ exports_update(int verbose)
{
nfs_export *exp;
- for (exp = exportlist[MCL_FQDN]; exp; exp=exp->m_next) {
+ for (exp = exportlist[MCL_FQDN].p_head; exp; exp=exp->m_next) {
exports_update_one(exp, verbose);
}
- for (exp = exportlist[MCL_GSS]; exp; exp=exp->m_next) {
+ for (exp = exportlist[MCL_GSS].p_head; exp; exp=exp->m_next) {
exports_update_one(exp, verbose);
}
}
@@ -212,7 +211,7 @@ export_all(int verbose)
int i;
for (i = 0; i < MCL_MAXTYPES; i++) {
- for (exp = exportlist[i]; exp; exp = exp->m_next) {
+ for (exp = exportlist[i].p_head; exp; exp = exp->m_next) {
if (verbose)
printf("exporting %s:%s\n",
exp->m_client->m_hostname,
@@ -308,7 +307,7 @@ unexportfs(char *arg, int verbose)
}
}
- for (exp = exportlist[htype]; exp; exp = exp->m_next) {
+ for (exp = exportlist[htype].p_head; exp; exp = exp->m_next) {
if (path && strcmp(path, exp->m_export.e_path))
continue;
if (htype != exp->m_client->m_type)
@@ -453,7 +452,7 @@ dump(int verbose)
char *hname, c;
for (htype = 0; htype < MCL_MAXTYPES; htype++) {
- for (exp = exportlist[htype]; exp; exp = exp->m_next) {
+ for (exp = exportlist[htype].p_head; exp; exp = exp->m_next) {
ep = &exp->m_export;
if (!exp->m_xtabent)
continue; /* neilb */