[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9728a6f4-96be-4f8f-9806-17413e4ffb00@intel.com>
Date: Wed, 11 Oct 2023 09:36:23 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Yury Norov <yury.norov@...il.com>
CC: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Rasmus Villemoes
<linux@...musvillemoes.dk>, Alexander Potapenko <glider@...gle.com>, "Jakub
Kicinski" <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>, David Ahern
<dsahern@...nel.org>, Przemek Kitszel <przemyslaw.kitszel@...el.com>, "Simon
Horman" <simon.horman@...igine.com>, <netdev@...r.kernel.org>,
<linux-btrfs@...r.kernel.org>, <dm-devel@...hat.com>,
<ntfs3@...ts.linux.dev>, <linux-s390@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/14] fs/ntfs3: rename bitmap_size() ->
ntfs3_bitmap_size()
From: Yury Norov <yury.norov@...il.com>
Date: Mon, 9 Oct 2023 09:50:15 -0700
> On Mon, Oct 09, 2023 at 05:10:18PM +0200, Alexander Lobakin wrote:
>> bitmap_size() is a pretty generic name and one may want to use it for
[...]
>> @@ -961,7 +961,7 @@ static inline bool run_is_empty(struct runs_tree *run)
>> }
>>
>> /* NTFS uses quad aligned bitmaps. */
>> -static inline size_t bitmap_size(size_t bits)
>> +static inline size_t ntfs3_bitmap_size(size_t bits)
>> {
>> return ALIGN((bits + 7) >> 3, 8);
>> }
>
> This looks like duplicating BITS_TO_U64(). If so, why not just switch
> to using the macro while you're here?
I thought that this
return BITS_TO_U64(bits) * sizeof(u64);
would give worse optimization, but actually
add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-32 (-32)
Nice, makes sense to do it.
>
>> diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
>> index cfec5e0c7f66..b1fb6efe7084 100644
>> --- a/fs/ntfs3/super.c
>> +++ b/fs/ntfs3/super.c
>> @@ -1285,7 +1285,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
>>
>> /* Check bitmap boundary. */
>> tt = sbi->used.bitmap.nbits;
>> - if (inode->i_size < bitmap_size(tt)) {
>> + if (inode->i_size < ntfs3_bitmap_size(tt)) {
>> ntfs_err(sb, "$Bitmap is corrupted.");
>> err = -EINVAL;
>> goto put_inode_out;
>> --
>> 2.41.0
Thanks,
Olek
Powered by blists - more mailing lists