code seems to require that the caller perform the locking?
The GFP_KERNEL means that the locking _has_ to be via a sleeping lock
rather than a spinlock, and interrupt-time insertions are not possible.
Would be better to pass in the gfp_flags.
Comparing the complexity (size) of this code with the q-n-d hash tables
which are currently used one does wonder how useful it all will be. The
additional indirections are not needed with q-n-d hashes.
But if it doesn't significantly add to the overall selinux patch then I
guess it makes sense.
A slab cache for hashtab_nodes would probably save a bit of space.
otoh: It would be faster and more space-efficient to require that the
clients of ths code embed a hastab_node inside their structures and just
pass the address of that hastab_node into here. When they do a lookup they
retreive their original struct with container_of. That fixes the GFP_KERNEL
thing too.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/