From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [PATCH v0 07/18] btrfs: generic data structure to build unique lists Date: Fri, 7 Oct 2011 17:07:06 +0200 Message-ID: <20111007150706.GC14482@one.firstfloor.org> References: <3a697c3e44dd5955c167f2f548ee4ced1e3dabef.1317915010.git.sensille@gmx.net> <4E8EB462.7000908@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andi Kleen , chris.mason@oracle.com, linux-btrfs@vger.kernel.org To: Arne Jansen Return-path: In-Reply-To: <4E8EB462.7000908@gmx.net> List-ID: > As to the differences to idr: > - as David pointed out, idr works on int, while I always need u64 to > represent btrfs logical addresses. > - as I understand idr (though I never used it), it is designed to manage > small consecutive integers, while ulists hold completely unrelated > numbers, e.g. btrfs logical adresses. For small sets ulists might be > much faster than idr > - ulists as used here are very short lived. I don't know if idr handles > this case well > - the purpose of ulists is to add a specific number, and not to find a > free one. I don't see a direct interface for this in idr. Okay. Fair enough. I would suggest to put it into lib/* and submit it to the mainline kernel and see what happens. -Andi -- ak@linux.intel.com -- Speaking for myself only.