linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: John Sanpe <sanpeqf@gmail.com>
Cc: linkinjeon@kernel.org, sj1557.seo@samsung.com,
	linux-fsdevel@vger.kernel.org, Andy.Wu@sony.com,
	Wataru.Aoyama@sony.com, cpgs@samsung.com
Subject: Re: [PATCH] exfat/balloc: using ffs instead of internal logic
Date: Tue, 12 Dec 2023 01:53:29 +0000	[thread overview]
Message-ID: <ZXe9Gd+qHm4dt1Ss@casper.infradead.org> (raw)
In-Reply-To: <20231207234701.566133-1-sanpeqf@gmail.com>

On Fri, Dec 08, 2023 at 07:47:01AM +0800, John Sanpe wrote:
>  	WARN_ON(clu < EXFAT_FIRST_CLUSTER);
> -	ent_idx = CLUSTER_TO_BITMAP_ENT(clu);
> -	clu_base = BITMAP_ENT_TO_CLUSTER(ent_idx & ~(BITS_PER_BYTE_MASK));
> +	ent_idx = ALIGN_DOWN(CLUSTER_TO_BITMAP_ENT(clu), BITS_PER_LONG);
> +	clu_base = BITMAP_ENT_TO_CLUSTER(ent_idx);
>  	clu_mask = IGNORED_BITS_REMAINED(clu, clu_base);
>  
>  	map_i = BITMAP_OFFSET_SECTOR_INDEX(sb, ent_idx);
>  	map_b = BITMAP_OFFSET_BYTE_IN_SECTOR(sb, ent_idx);
>  
>  	for (i = EXFAT_FIRST_CLUSTER; i < sbi->num_clusters;
> -	     i += BITS_PER_BYTE) {
> -		k = *(sbi->vol_amap[map_i]->b_data + map_b);
> +	     i += BITS_PER_LONG) {
> +		bitval = *(__le_long *)(sbi->vol_amap[map_i]->b_data + map_b);

Is this guaranteed to be word-aligned, or might we end up doing
misaligned loads here?


  parent reply	other threads:[~2023-12-12  1:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20231209203819epcas1p469c0aecdc6a27fff7895a93ed5f3c4ec@epcas1p4.samsung.com>
2023-12-07 23:47 ` [PATCH] exfat/balloc: using ffs instead of internal logic John Sanpe
2023-12-12  1:15   ` Sungjong Seo
2023-12-12  1:53   ` Matthew Wilcox [this message]
2023-12-12 16:10     ` Fredrik Anderson
2023-12-13 13:29   ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZXe9Gd+qHm4dt1Ss@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=Andy.Wu@sony.com \
    --cc=Wataru.Aoyama@sony.com \
    --cc=cpgs@samsung.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sanpeqf@gmail.com \
    --cc=sj1557.seo@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).