From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 022ED4400 for ; Sat, 2 Jul 2022 20:44:14 +0000 (UTC) Received: by mail-qt1-f179.google.com with SMTP id z13so4556584qts.12 for ; Sat, 02 Jul 2022 13:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DlqK/gCHCDGy5OSRXAYFxnfYX+I9GxfO75TGVC+FALo=; b=KYrBXP9UYV5NoeyAbdVeawzPP055oU/YPCp4PhRf6nnOZT6ArrIVdgKYCoo6iGYIf+ OkpT7KUF7/gAJJpj8Gndr1tT5ooKoE1Njt/nQZMg5AT/yUvpXboiZ/7YVG5kVzxZiDmN 33edQoG2f8REKt8wyYDVZqC17/vWVi1BSJtXaVZotBUjJeo0oi9t0rl723v/YXS0e8I4 Lm/8Y766tSv3y1tW0SDfNL66UCtAPbt4apAJhXJR5LagbgW6dah2u1jztPJUP5qjESHt gNofLDhtzb34Mw6JCaEQvGQ09YGrqkszp6Jaz3T6qgV/3A+xlFIDrZsvk+nZJb6LBdbT uyBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DlqK/gCHCDGy5OSRXAYFxnfYX+I9GxfO75TGVC+FALo=; b=mh7V/SRpVg0Siz36ugCkCnTUjTfapKmgQSRn52WyCzt2rVYnKlu/QVhodOAyWgKArX SFYPhR7oRfF3gXxZAlMx+4ICdsPh0+bARO5uAn1LvqGfG+nyYVxLMJtESoBHqibTOvgZ NR958zB8Vu8WgGgRR6GIFdefOXTyl/3GXLv54Lr2+berO96Yd3mV8D8DYVTd5BYK70mJ CaX25Oiraq1mrMPfV9PHwFXkhi+ZEUx9fJUZJnHEb+8pYo+f/i1inPMMA6om+P1zkp11 sfXYGD2ucXpFl9YggD8t3ELB2Z6XZjvcXxUb6ADGiPm0J88+/P9hzoCE63vgPkESMZad ohpA== X-Gm-Message-State: AJIora+gmikO1VNDpyzv3oVy3X4vub2PPIkkgKYGgU6GUx5ID3ihJ6pM w9J+tiCwbhLc3rXyhjuH0A8= X-Google-Smtp-Source: AGRyM1v9Om7l6fke9TMJ9NBQOtPQriWNRvL7GNoiNXCdxK+C+aPoOgahYt70QVZO5kMXfNiYT220JQ== X-Received: by 2002:a05:6214:e83:b0:470:54c3:e18e with SMTP id hf3-20020a0562140e8300b0047054c3e18emr22253839qvb.3.1656794653736; Sat, 02 Jul 2022 13:44:13 -0700 (PDT) Received: from localhost ([2601:4c1:c100:1230:e838:b1c2:b125:986a]) by smtp.gmail.com with ESMTPSA id c19-20020a05622a059300b00304edcfa109sm18513614qtb.33.2022.07.02.13.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 13:44:13 -0700 (PDT) Date: Sat, 2 Jul 2022 13:44:12 -0700 From: Yury Norov To: Christophe JAILLET Cc: agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, vneethv@linux.ibm.com, oberpar@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, almaz.alexandrovich@paragon-software.com, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, linux-s390@vger.kernel.org, ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 0/4] Introduce bitmap_size() Message-ID: References: Precedence: bulk X-Mailing-List: ntfs3@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Jul 02, 2022 at 08:28:53PM +0200, Christophe JAILLET wrote: > This serie introduces bitmap_size() which returns the size, in bytes, of a > bitmap. Such a function is useful to simplify some drivers that use vmalloc() or > other functions to allocate some butmaps. This generally looks like a step in a wrong direction. Bitmap is by definition an array of bits. If someone has a reason to handle bitmap on a per-byte basis, the guy is probably doing something wrong. We already have quite comprehensive list of functions that help to allocate, fill, clear, copy etc bitmap without considering it as an array of bytes or words. > ... some drivers that use vmalloc() ... If a driver needs vmalloc() for a bitmap, we should introduce bitmap_vmalloc(), not bitmap_size(). > It also hides some implementation details about how bitmaps are stored (array of > longs) Sorry, I don't understand that. How bitmap_size() helps to hide a fact that bitmap is an array of unsigned longs? (Except that it makes an impression that it's an array of bytes.) > Before introducing this function in patch 3, patch 1 and 2 rename some functions > with the same name but with different meaning. > > Finaly, patch 4 makes use of the new function in bitmap.h. You mentioned, you need bitmap_size() to use with vmalloc(), but in patch 4, there's no such code. > Other follow-up patches to simplify some drivers will be proposed later if/when > this serie is merged. This series doesn't show an example of how you're going to use new API, and therefore it's hard to judge, do we really need bitmap_size(), or we just need more helpers around. As I already said, bitmaps are evolving in 2nd direction, which is the right approach, I think. Thanks, Yury > Christophe JAILLET (4): > s390/cio: Rename bitmap_size() as idset_bitmap_size() > fs/ntfs3: Rename bitmap_size() as ntfs3_bitmap_size() > bitmap: Introduce bitmap_size() > bitmap: Use bitmap_size() > > drivers/md/dm-clone-metadata.c | 5 ----- > drivers/s390/cio/idset.c | 8 ++++---- > fs/ntfs3/bitmap.c | 4 ++-- > fs/ntfs3/fsntfs.c | 2 +- > fs/ntfs3/index.c | 6 +++--- > fs/ntfs3/ntfs_fs.h | 2 +- > fs/ntfs3/super.c | 2 +- > include/linux/bitmap.h | 15 +++++++++------ > lib/math/prime_numbers.c | 2 -- > 9 files changed, 21 insertions(+), 25 deletions(-) > > -- > 2.34.1