Date: Sat, 19 Jun 2010 18:48:22 +0300 From: Jaakko Heinonen <jh@FreeBSD.org> To: freebsd-hackers@FreeBSD.org Cc: phk@FreeBSD.org Subject: [patch] extending alloc_unr(9) to allocate specific unit numbers Message-ID: <20100619154822.GA1166@a91-153-117-195.elisa-laajakaista.fi>
next in thread | raw e-mail | index | archive | help
Hi, I wrote a patch to extend the kernel unit number allocator for allocating specific unit numbers. The patch adds a new function alloc_unr_specific() which returns the requested unit number if it is free and -1 if the number is already allocated or out of the range. Unlike alloc_unr(), alloc_unr_specific() may allocate memory and thus sleep. The patch is here: http://people.freebsd.org/~jh/patches/alloc_unr_specific.diff I think that this functionality has been requested by some people. Reviews/comments? As an example here is md(4) converted to use alloc_unr() / alloc_unr_specific(): http://people.freebsd.org/~jh/patches/md-alloc_unr.diff -- Jaakko
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100619154822.GA1166>