On 4/21/23 4:30?PM, Luis Chamberlain wrote:
> On Fri, Apr 21, 2023 at 04:24:57PM -0600, Jens Axboe wrote:
>> On 4/21/23 4:02?PM, Luis Chamberlain wrote:
>>> On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote:
On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
>
On Fri, Apr 21, 2023 at 03:02:30PM -0700, Luis Chamberlain wrote:
> On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote:
> > On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
> > > Just use the PAGE_SECTORS generic define. This produces no functional
> > > changes. While
On Fri, Apr 21, 2023 at 04:24:57PM -0600, Jens Axboe wrote:
> On 4/21/23 4:02 PM, Luis Chamberlain wrote:
> > On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote:
> >> On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
> >>> Just use the PAGE_SECTORS generic define. This
On 4/21/23 4:02 PM, Luis Chamberlain wrote:
> On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote:
>> On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
>>> Just use the PAGE_SECTORS generic define. This produces no functional
>>> changes. While at it use left shift to
On Fri, Apr 21, 2023 at 09:14:00PM +0100, Matthew Wilcox wrote:
> On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
> > Just use the PAGE_SECTORS generic define. This produces no functional
> > changes. While at it use left shift to simplify this even further.
>
> How is FOO << 2
Just use the PAGE_SECTORS generic define. This produces no functional
changes. While at it use left shift to simplify this even further.
Signed-off-by: Luis Chamberlain
---
fs/iomap/buffered-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/iomap/buffered-io.c
Instead of re-defining the already existing constants use the provided ones:
So replace:
o SECTORS_PER_PAGE_SHIFT with PAGE_SECTORS_SHIFT
o SECTORS_PER_PAGE with PAGE_SECTORS
This produces no functional changes.
Signed-off-by: Luis Chamberlain
---
drivers/block/zram/zram_drv.c | 12
The PAGE_SHIFT - SECTOR_SHIFT constant be replaced with PAGE_SECTORS_SHIFT
defined in linux/blt_types.h, which is included by linux/blkdev.h.
This produces no functional changes.
Signed-off-by: Luis Chamberlain
---
drivers/md/dm-bufio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The PAGE_SHIFT - SECTOR_SHIFT constant be replaced with PAGE_SECTORS_SHIFT
defined in linux/blt_types.h, which is included by linux/blkdev.h.
This produces no functional changes.
Signed-off-by: Luis Chamberlain
---
drivers/md/dm-integrity.c | 10 +-
1 file changed, 5 insertions(+), 5
A bit of block drivers have their own incantations with
PAGE_SHIFT - SECTOR_SHIFT. Just simplfy and use PAGE_SECTORS_SHIFT
all over.
Based on linux-next next-20230421.
Luis Chamberlain (5):
dm integrity: simplify by using PAGE_SECTORS_SHIFT
drbd: use PAGE_SECTORS_SHIFT and PAGE_SECTORS
Replace common constants with generic versions.
This produces no functional changes.
Signed-off-by: Luis Chamberlain
---
drivers/block/drbd/drbd_bitmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
On Fri, Apr 21, 2023 at 12:58:03PM -0700, Luis Chamberlain wrote:
> - *pl_index = sector >> (PAGE_SHIFT - SECTOR_SHIFT);
> + *pl_index = sector >> (PAGE_SECTORS_SHIFT);
You could/should remove the () around PAGE_SECTORS_SHIFT
(throughout)
--
dm-devel mailing list
dm-devel@redhat.com
On Fri, Apr 21, 2023 at 12:58:05PM -0700, Luis Chamberlain wrote:
> Just use the PAGE_SECTORS generic define. This produces no functional
> changes. While at it use left shift to simplify this even further.
How is FOO << 2 simpler than FOO * 4?
> - return bioset_init(_ioend_bioset, 4 *
From: Johannes Thumshirn
The GFS2 superblock reading code uses bio_add_page() to add a page to a
newly created bio. bio_add_page() can fail, but the return value is never
checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a
From: Johannes Thumshirn
The drbd code only adds a single page to a newly created bio. So use
__bio_add_page() to add the page which is guaranteed to succeed in this
case.
This brings us closer to marking bio_add_page() as __must_check.
Signed-off-by: Johannes Thumshirn
Reviewed-by: Damien Le
From: Johannes Thumshirn
Now that all users of bio_add_page check for the return value, mark
bio_add_page as __must_check.
Signed-off-by: Johannes Thumshirn
Reviewed-by: Damien Le Moal
---
include/linux/bio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
From: Johannes Thumshirn
The zram writeback code uses bio_add_page() to add a page to a newly
created bio. bio_add_page() can fail, but the return value is never
checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a step closer
On 19/04/2023 17:19, Andreas Gruenbacher wrote:
On Wed, Apr 19, 2023 at 4:10 PM Johannes Thumshirn wrote:
From: Johannes Thumshirn
The GFS superblock reading code uses bio_add_page() to add a page to a
newly created bio. bio_add_page() can fail, but the return value is never
checked.
It's
From: Johannes Thumshirn
When the iomap buffered-io code can't add a folio to a bio, it allocates a
new bio and adds the folio to that one. This is done using bio_add_folio(),
but doesn't check for errors.
As adding a folio to a newly created bio can't fail, use the newly
introduced
From: Johannes Thumshirn
Check if adding pages to clone bio fails and if it does retry with
reclaim. This mirrors the behaviour of page allocation in
crypt_alloc_buffer().
This way we can mark bio_add_pages as __must_check.
Signed-off-by: Johannes Thumshirn
Reviewed-by: Damien Le Moal
---
From: Johannes Thumshirn
Now that all callers of bio_add_folio() check the return value, mark it as
__must_check.
Signed-off-by: Johannes Thumshirn
---
include/linux/bio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index
From: Johannes Thumshirn
The JFS IO code uses bio_add_page() to add a page to a newly created bio.
bio_add_page() can fail, but the return value is never checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a step closer to
From: Johannes Thumshirn
The btrfs repair bio submission code uses bio_add_page() to add a page to
a newly created bio. bio_add_page() can fail, but the return value is
never checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a
From: Johannes Thumshirn
The md-raid superblock writing code uses bio_add_page() to add a page to a
newly created bio. bio_add_page() can fail, but the return value is never
checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a
From: Johannes Thumshirn
The raid5-ppl submission code uses bio_add_page() to add a page to a
newly created bio. bio_add_page() can fail, but the return value is never
checked. For adding consecutive pages, the return is actually checked and
a new bio is allocated if adding the page fails.
Use
From: Johannes Thumshirn
The floppy code uses bio_add_page() to add a page to a newly created bio.
bio_add_page() can fail, but the return value is never checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a step closer to
From: Johannes Thumshirn
dm-zoned uses bio_add_page() for adding a single page to a freshly created
metadata bio.
Use __bio_add_page() instead as adding a single page to a new bio is
always guaranteed to succeed.
This brings us a step closer to marking bio_add_page() __must_check
From: Johannes Thumshirn
The raid5 log metadata submission code uses bio_add_page() to add a page
to a newly created bio. bio_add_page() can fail, but the return value is
never checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us
We have two functions for adding a page to a bio, __bio_add_page() which is
used to add a single page to a freshly created bio and bio_add_page() which is
used to add a page to an existing bio.
While __bio_add_page() is expected to succeed, bio_add_page() can fail.
This series converts the
From: Johannes Thumshirn
Check if adding pages to resync bio fails and if bail out.
As the comment above suggests this cannot happen, WARN if it actually
happens.
This way we can mark bio_add_pages as __must_check.
Signed-off-by: Johannes Thumshirn
Reviewed-by: Damien Le Moal
Acked-by: Song
From: Johannes Thumshirn
The sync request code uses bio_add_page() to add a page to a newly created bio.
bio_add_page() can fail, but the return value is never checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a step closer to
From: Johannes Thumshirn
The buffer_head submission code uses bio_add_page() to add a page to a
newly created bio. bio_add_page() can fail, but the return value is never
checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a step
From: Johannes Thumshirn
alloc_behind_master_bio() can possibly add multiple pages to a bio, but it
is not checking for the return value of bio_add_page() if adding really
succeeded.
Check if the page adding succeeded and if not bail out.
Signed-off-by: Johannes Thumshirn
Reviewed-by: Damien
From: Johannes Thumshirn
The swap code only adds a single page to a newly created bio. So use
__bio_add_page() to add the page which is guaranteed to succeed in this
case.
This brings us closer to marking bio_add_page() as __must_check.
Signed-off-by: Johannes Thumshirn
Reviewed-by: Damien Le
From: Johannes Thumshirn
The zonefs superblock reading code uses bio_add_page() to add a page to a
newly created bio. bio_add_page() can fail, but the return value is
never checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings us a
From: Johannes Thumshirn
Just like for bio_add_pages() add a no-fail variant for bio_add_folio().
Signed-off-by: Johannes Thumshirn
---
block/bio.c | 8
include/linux/bio.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/block/bio.c b/block/bio.c
index
From: Johannes Thumshirn
The btrfs raid58 sector submission code uses bio_add_page() to add a page
to a newly created bio. bio_add_page() can fail, but the return value is
never checked.
Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.
This brings
37 matches
Mail list logo