Index: kern_uuid.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_uuid.c,v retrieving revision 1.3 diff -u -r1.3 kern_uuid.c --- kern_uuid.c 2002/08/22 12:47:22 1.3 +++ kern_uuid.c 2002/10/20 04:29:32 @@ -52,6 +52,17 @@ CTASSERT(sizeof(struct uuid) == 16); +/* + * Set the default number of UUIDs that can be created at any one + * time to 2048 for practicaly reasons, but allow the value to be + * tuned by the sysctl kern.uuidgen_max. + * + * Note: No need to create a seperate tree for one node. + */ +static int uuidgen_max = 2048; +SYSCTL_INT(_kern, OID_AUTO, uuidgen_max, CTLFLAG_RW, &uuidgen_max, 1, + "UUID Maximum Generation Limit"); + /* We use an alternative, more convenient representation in the generator. */ struct uuid_private { union { @@ -144,13 +155,7 @@ uint64_t time; int error; - /* - * Limit the number of UUIDs that can be created at the same time - * to some arbitrary number. This isn't really necessary, but I - * like to have some sort of upper-bound that's less than 2G :-) - * XXX needs to be tunable. - */ - if (uap->count < 1 || uap->count > 2048) + if (uap->count < 1 || uap->count > uuidgen_max) return (EINVAL); /* XXX: pre-validate accessibility to the whole of the UUID store? */