Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Apr 1996 21:38:57 -0700 (PDT)
From:      Bill Paul <wpaul>
To:        CVS-committers, cvs-all, cvs-usrsbin
Subject:   cvs commit:  src/usr.sbin/ypserv mkaliases Makefile Makefile.yp yp_access.c yp_dblookup.c yp_extern.h yp_main.c yp_server.c
Message-ID:  <199604280438.VAA04204@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
wpaul       96/04/27 21:38:56

  Modified:    usr.sbin/ypserv  Makefile Makefile.yp yp_access.c
                        yp_dblookup.c yp_extern.h  yp_main.c yp_server.c
  Added:       usr.sbin/ypserv  mkaliases
  Log:
  Performance enhancements (I hope) and new stuff:
  
  yp_dblookup.c:
  
  - Implement database handle caching. What this means is that instead
    of opening and closing map databases for each request, we open a
    database and save the handle (and, if requested, the key index)
    in an array. This saves a bit of overhead on things like repeated
    YPPROC_NEXT calls, such as you'd get from getpwent(). Normally,
    each YPPROC_NEXT would require open()ing the database, seeking
    to the location supplied by the caller (which is time consuming with
    hash databases as the R_CURSOR flag doesn't work), reading the
    data, close()ing the database and then shipping the data off to
    the caller. The system call overhead is prohibitive, especially
    with very large maps. By caching the handle to an open database,
    we elimitate at least the open()/close() system calls, as well
    as the associated DB setup and tear-down operations, for a large
    percentage of the time. This improves performance substantially at
    the cost of consuming a little more memory than before.
  
    Note that all the caching support is surrounded by #ifdef DB_CACHE
    so that this same source module can still be used by other programs
    that don't need it.
  
  - Make yp_open_db() call yp_validdomain(). Doing it here saves cycles
    when caching is enabled since a hit on the map cache list by
    definition means that the domain being referenced is valid.
  
  - Also make yp_open_db() check for exhaustion of file descriptors,
    just in case.
  
  yp_server.c:
  
  - Reorganize things a little to take advantage of the database
    handle caching. Add a call to yp_flush_all() in ypproc_clear_2_svc().
  
  - Remove calls to yp_validdomain() from some of the service procedures.
    yp_validdomain() is called inside yp_open_db() now, so procedures that
    call into the database package don't need to use yp_validdomain()
    themselves.
  
  - Fix a bogosity in ypproc_maplist_2_svc(): don't summarily initiallize
    the result.maps pointer to NULL. This causes yp_maplist_free()
    to fail and leaks memory.
  
  - Make ypproc_master_2_svc() copy the string it gets from the database
    package into a private static buffer before trying to NUL terminate it.
    This is necessary with the DB handle caching: stuffing a NUL into the
    data returned by DB package will goof it up internally.
  
  yp_main.c:
  
  - Stuff for DB handle caching: call yp_init_dbs() to clear the
    handle array and add call to yp_flush_all() to the SIGHUP
    signal handler.
  
  Makefile.yp:
  
  - Reorganize to deal with database caching. yp_mkdb(8) can now be used
    to send a YPPROC_CLEAR signal to ypserv(8). Call it after each map
    is created to refresh ypserv's cache.
  
  - Add support for mail.alias map.
    Contributed by Mike Murphy (mrm@sceard.com).
  
  - Make default location for the netgroups source file be /var/yp/netgroup
    instead of /etc/netgroup.
  
  mkaliases:
  
  - New file: script to generate mail.alias map.
    Contributed by Mike Murphy (mrm@sceard.com).
  
  Makefile:
  
  - Install Makefile.yp as /var/yp/Makefile.dist and link it to
    /var/yp/Makefile only if /var/yp/Makefile doesn't already exist.
    Suggested by Peter Wemm.
  
  - Install new mkaliases script in /usr/libexec along with mknetid.
  
  - Use somewhat saner approach to generating rpcgen-dependent files
    as suggested by Garrett Wollman.
  
  Revision  Changes    Path
  1.4       +18 -10    src/usr.sbin/ypserv/Makefile
  1.4       +130 -54   src/usr.sbin/ypserv/Makefile.yp
  1.7       +13 -11    src/usr.sbin/ypserv/yp_access.c
  1.5       +292 -31   src/usr.sbin/ypserv/yp_dblookup.c
  1.4       +6 -3      src/usr.sbin/ypserv/yp_extern.h
  1.5       +8 -3      src/usr.sbin/ypserv/yp_main.c
  1.9       +83 -102   src/usr.sbin/ypserv/yp_server.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604280438.VAA04204>