I just noticed this bit in trove-dbpf/dbpf.h.  The code carefully
builds ((<collid> << 24) | <handleid>) then does a modulo against
a power of 2, effectively stripping off all but the low bits of
the handleid.

The collid is not used in the hash at all.  Just in case anybody
thought this was important.  I've ever only used one collection per
server.

                -- Pete

/*
  for more efficient host filesystem accesses, we have a simple
  *_MAX_NUM_BUCKETS define that can be thought of more or less as
  buckets for storing bstreams based on a simple hash of the unique
  handle/coll_id combination.

  in practice, this means we spread all bstreams into
  *_MAX_NUM_BUCKETS directories instead of keeping all bstream entries
  in a flat bstream directory on the host filesystem.
*/
#define DBPF_KEYVAL_MAX_NUM_BUCKETS   32
#define DBPF_BSTREAM_MAX_NUM_BUCKETS  64

#define DBPF_KEYVAL_GET_BUCKET(__handle, __id)                           \
(((__id << ((sizeof(__id) - 1) * 8)) | __handle) %                       \
   DBPF_KEYVAL_MAX_NUM_BUCKETS)

#define DBPF_BSTREAM_GET_BUCKET(__handle, __id)                          \
(((__id << ((sizeof(__id) - 1) * 8)) | __handle) %                       \
   DBPF_BSTREAM_MAX_NUM_BUCKETS)


_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to