ffs_dirpref() calculates dirsize = (fs->fs_avgfilesize * fs->fs_avgfpdir).
However, these two paramters can be set by the sysop such that they easily
overflow a 32 bit integer. Use 64 bit arithmatic to prevent the overflow
and special-case values > 0x7fffffff to simply set maxcontigdirs to 1 rather
then waste time doing further 64 bit arithmatic.
Note that NetBSD also changed 'cgsize' to a 64 bit integer, but fails to
properly cast at least one of the arguments in both the dirsize and cgsize
multiplication which means that the overflow bug in NetBSD has not actually
been fixed.
This patch does not change the cgsize calculation yet, it requires more
review.
Source: NetBSD ffs_alloc.c/1.74 from Barry Bouwsma of Tiengen.