[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable


  • To: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>, Joe Perches <joe@xxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, sstabellini@xxxxxxxxxx, roger.pau@xxxxxxxxxx, axboe@xxxxxxxxx
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Mon, 6 Dec 2021 08:31:33 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7aS3u+2gf4pMCXS+tFHbbmOSTXhOTTvkvURD2k6C/+k=; b=CxcrunJeFh1xWaZDzXyYBAH4UCq6Oyow/gmvq/9fKZPto/+oax/se3q82LWkrMLzz/BW893lOBKerSAAIkIao2bsaThbZFZbG/y75aF/knPFUiH2qvnL5UZY5kFkxRhkWqKAcsU/L6vtUmD6QcfAtF0oNP412t1wIHVVwuhyBOPYNpuuYFn58IO2WHepSJWTl5d05Z/EPFL1hJ1/c5L4Q/snRXvn+Bd67jmIRtewcwZCs1ARtmE5ysSrQnXqJ4cfNZfi53LidaYw/QbKQuYF7sXIN2VLn+vwGDfdlCzm/n3b/Yrqdu9VsTfmhSpiqyn42SF4CJi+GONfn5y7KahPSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ngtOog1yQCVqKfbrxzx+flPg2D+F6PazUqyRadj9tuzzzIoLUT45jKArz0zmPPKk9qPEgoxGBXgsmVZsOO7d4b6eGHrtxgzkaiy1XRypz+FpoesD3KxTn2J9nDFVPYvin1EwDeB75vGAZdvzTwDEqy71h8BTjLeZ4JqZ1ZrYvVuel5kwBHTJJaAJae1qXjU822IPUbAp4SVSSzipgx0KNP+zrX6cvAK3V+cQ+g0G0dChonMOephOD287gW32Tb1dS8iwHKmMggE1PSDE6hdqKp1rkozCBXAQUzBR2lFbAlLEWq4soJFpNUpvyExTKNPU8bg06kdhO3u01WtNm0D3Qg==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, kernel-janitors@xxxxxxxxxxxxxxx
  • Delivery-date: Mon, 06 Dec 2021 13:32:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 12/4/21 1:57 AM, Christophe JAILLET wrote:

So, maybe adding an "official" 'bitmap_size()' (which is already existing and 
duplicated in a few places) would ease things.

It would replace the 'nr_minors = BITS_TO_LONGS(end) * BITS_PER_LONG;' and hide 
the implementation details of the bitmap API.

Something like:
static __always_inline size_t bitmap_size(unsigned long nr_bits)
{
    return BITS_TO_LONGS(nr_bits) * sizeof(long);
}


Yes, I think this would be a useful helper. Should be sizeof(unsigned long) 
though to keep things consistent.


-boris




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.