VirtualBox

Changeset 1794 in kBuild


Ignore:
Timestamp:
Sep 19, 2008 11:49:42 PM (17 years ago)
Author:
bird
Message:

kmk: Change the directory hash size to prevent /usr/bin from causing 3 rehashings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/dir.c

    r1450 r1794  
    219219# else
    220220#define DIRECTORY_BUCKETS 199
    221 # endif 
     221# endif
    222222#endif
    223223
     
    565565              else
    566566                {
     567#ifdef KMK
     568                  int buckets = st.st_nlink * 2;
     569                  if (buckets < DIRFILE_BUCKETS)
     570                    buckets = DIRFILE_BUCKETS;
     571                  hash_init (&dc->dirfiles, buckets,
     572                             dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
     573#else
    567574                  hash_init (&dc->dirfiles, DIRFILE_BUCKETS,
    568575                             dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
     576#endif
    569577                  /* Keep track of how many directories are open.  */
    570578                  ++open_directories;
     
    688696      if (d == 0)
    689697        {
    690 /* bird: Workaround for smbfs mounts returning EBADF at the end of the search. 
     698/* bird: Workaround for smbfs mounts returning EBADF at the end of the search.
    691699         To exactly determin the cause here, I should probably do some smbfs
    692          tracing, but for now just ignoring the EBADF on seems to work. 
     700         tracing, but for now just ignoring the EBADF on seems to work.
    693701         (The smb server is 64-bit vista, btw.) */
    694702#if defined (__FreeBSD__)
     
    701709           && !strcmp(stfs.f_fstypename, "smbfs"))
    702710            {
    703               /*fprintf (stderr, "EBADF on remote fs! dirfd=%d errno=%d\n", 
     711              /*fprintf (stderr, "EBADF on remote fs! dirfd=%d errno=%d\n",
    704712                       dirfd (dir->dirstream), errno);*/
    705713              saved_errno = 0;
     
    11091117              hash_print_stats (&dir->contents->dirfiles, stdout);
    11101118              fputs ("\n", stdout);
    1111 #endif 
     1119#endif
    11121120            }
    11131121        }
     
    11311139  hash_print_stats (&directory_contents, stdout);
    11321140  fputs ("\n", stdout);
    1133 #endif 
     1141#endif
    11341142}
    11351143
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette