diff mbox series

iomap: use SECTOR_SIZE instead of 512 in iomap_page definition

Message ID 123556d7-968c-70a6-1049-38b2f279f5a1@redhat.com (mailing list archive)
State New, archived
Headers show
Series iomap: use SECTOR_SIZE instead of 512 in iomap_page definition | expand

Commit Message

Eric Sandeen Oct. 15, 2019, 3:39 p.m. UTC
iomap_page_create() initializes the uptodate bitmap using the SECTOR_SIZE
macro, so use that in the definition as well, for consistency and safety.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Last time there was a concern about pulling in blkdev.h just for this,
but that's already been done now, so try again.

Comments

Christoph Hellwig Oct. 15, 2019, 3:52 p.m. UTC | #1
On Tue, Oct 15, 2019 at 10:39:36AM -0500, Eric Sandeen wrote:
> iomap_page_create() initializes the uptodate bitmap using the SECTOR_SIZE
> macro, so use that in the definition as well, for consistency and safety.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> Last time there was a concern about pulling in blkdev.h just for this,
> but that's already been done now, so try again.

Note that the iomap writepage series, which is hopefully about to be
merged moves this declaration around.
Matthew Wilcox (Oracle) Oct. 15, 2019, 4:16 p.m. UTC | #2
On Tue, Oct 15, 2019 at 08:52:24AM -0700, Christoph Hellwig wrote:
> On Tue, Oct 15, 2019 at 10:39:36AM -0500, Eric Sandeen wrote:
> > iomap_page_create() initializes the uptodate bitmap using the SECTOR_SIZE
> > macro, so use that in the definition as well, for consistency and safety.
> > 
> > Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> > ---
> > 
> > Last time there was a concern about pulling in blkdev.h just for this,
> > but that's already been done now, so try again.
> 
> Note that the iomap writepage series, which is hopefully about to be
> merged moves this declaration around.

... and the support-multiple-page-sizes patches make it dynamically
allocated ;-)
Eric Sandeen Oct. 15, 2019, 4:19 p.m. UTC | #3
On 10/15/19 11:16 AM, Matthew Wilcox wrote:
> On Tue, Oct 15, 2019 at 08:52:24AM -0700, Christoph Hellwig wrote:
>> On Tue, Oct 15, 2019 at 10:39:36AM -0500, Eric Sandeen wrote:
>>> iomap_page_create() initializes the uptodate bitmap using the SECTOR_SIZE
>>> macro, so use that in the definition as well, for consistency and safety.
>>>
>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>> ---
>>>
>>> Last time there was a concern about pulling in blkdev.h just for this,
>>> but that's already been done now, so try again.
>>
>> Note that the iomap writepage series, which is hopefully about to be
>> merged moves this declaration around.
> 
> ... and the support-multiple-page-sizes patches make it dynamically
> allocated ;-)
> 

*sigh* obviously I'm not keeping up.

Thanks,
-Eric
diff mbox series

Patch

diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 7aa5d6117936..9cd1db007a0d 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -139,7 +139,7 @@  loff_t iomap_apply(struct inode *inode, loff_t pos, loff_t length,
 struct iomap_page {
 	atomic_t		read_count;
 	atomic_t		write_count;
-	DECLARE_BITMAP(uptodate, PAGE_SIZE / 512);
+	DECLARE_BITMAP(uptodate, PAGE_SIZE / SECTOR_SIZE);
 };
 
 static inline struct iomap_page *to_iomap_page(struct page *page)