Hi,
在 2024/01/05 14:10, Christoph Hellwig 写道:
On Thu, Jan 04, 2024 at 12:28:55PM +0100, Jan Kara wrote:
What do you think? Because when we are working with the folios it is rather
natural to use their mapping for dirty balancing?
The real problem is that block2mtd pokes way to deep into
Hi, Jan!
在 2024/01/04 20:02, Jan Kara 写道:
On Thu 21-12-23 16:58:26, Yu Kuai wrote:
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_device.
Signed-off-by: Yu Kuai
I'm not erofs maintainer but IMO this is quite ugly and grows erofs_buf
unnecessarily
Hi,
在 2024/01/04 19:28, Jan Kara 写道:
On Thu 21-12-23 16:56:59, Yu Kuai wrote:
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
...
+ for (p = folio_address(folio); p
Hi, Jan!
在 2024/01/04 19:06, Jan Kara 写道:
On Thu 21-12-23 16:56:57, Yu Kuai wrote:
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/block/xen-blkback/xenbus.c | 3 +--
1 file changed, 1 insertion(+), 2
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_device.
Signed-off-by: Yu Kuai
Reviewed-by: Jan Kara
---
fs/ext4/dir.c | 6 ++
fs/ext4/ext4_jbd2.c | 6 +++---
fs/ext4/super.c | 3 +--
3 files changed, 6 insertions(+), 9 deletions(-)
diff
From: Yu Kuai
block_device_ejected() is added by commit bdfe0cbd746a ("Revert
"ext4: remove block_device_ejected"") in 2015. At that time 'bdi->wb'
is destroyed synchronized from del_gendisk(), hence if ext4 is still
mounted, and then mark_buffer_dirty() will reference
From: Yu Kuai
Unlike __bread_gfp(), ext4 has special handing while reading sb block:
1) __GFP_NOFAIL is not set, and memory allocation can fail;
2) If buffer write failed before, set buffer uptodate and don't read
block from disk;
3) REQ_META is set for all IO, and REQ_PRIO is set
From: Yu Kuai
Remove __ext4_sb_bread_gfp() and ext4_buffer_uptodate() that is defined
by ext4, and convert to use common helper __bread_gfp2() and
buffer_uptodate_or_error().
Signed-off-by: Yu Kuai
Reviewed-by: Jan Kara
---
fs/ext4/ext4.h| 13 -
fs/ext4/inode.c | 8
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_device.
Signed-off-by: Yu Kuai
---
fs/jbd2/journal.c | 3 +--
fs/jbd2/recovery.c | 6 ++
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_device.
Signed-off-by: Yu Kuai
---
fs/nilfs2/segment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 55e31cc903d1..a1130e384937 100644
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_device.
Signed-off-by: Yu Kuai
---
fs/erofs/data.c | 18 --
fs/erofs/internal.h | 2 ++
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
fs/btrfs/disk-io.c | 71 +-
fs/btrfs/volumes.c | 17 ++-
fs/btrfs/zoned.c | 15
From: Yu Kuai
Currently btrfs is using __bio_add_page() in write_dev_supers(). In order
to convert to use folio for bdev in btrfs, export bio_add_folio_nofail()
so that it can replace __bio_add_page().
Signed-off-by: Yu Kuai
---
block/bio.c | 1 +
1 file changed, 1 insertion(+)
diff --git
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/scsi/scsicam.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index e2c7d8ef205f
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
drivers/md/bcache/super.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/md/bcache/super.c b
From: Yu Kuai
Those apis will be used for other modules, so that bd_inode won't be
accessed directly from other modules.
Signed-off-by: Yu Kuai
---
block/bdev.c | 148 +
block/blk.h| 2 -
include/linux/blkdev.h | 17 +
3
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Also do some cleanup that there is no need for two for loop, and remove
local array pages.
Signed-off-by: Yu Kuai
---
fs/cramfs/inode.c | 36
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/s390/block/dasd_ioctl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
From: Yu Kuai
bdev_sectors() is not used hence remove it.
Signed-off-by: Yu Kuai
---
fs/bcachefs/util.h | 5 -
1 file changed, 5 deletions(-)
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 2984b57b2958..22a0acc1704f 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
From: Yu Kuai
Changes in v3:
- remove bdev_associated_mapping() and patch 12 from v1;
- add kerneldoc comments for new bdev apis;
- rename __bdev_get_folio() to bdev_get_folio;
- fix a problem in erofs that erofs_init_metabuf() is not always
called.
- add reviewed-by tag for patch 15-17
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
drivers/mtd/devices/block2mtd.c | 81 +++--
1 file changed, 36 insertions(+), 45 deletions(-)
diff --git
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/block/xen-blkback/xenbus.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkback/xenbus.c
b/drivers/block/xen-blkback
Hi,
在 2023/12/12 21:14, Christoph Hellwig 写道:
On Mon, Dec 11, 2023 at 05:52:17PM +0100, Jan Kara wrote:
+void bdev_associated_mapping(struct block_device *bdev,
+struct address_space *mapping)
+{
+ mapping->host = bdev->bd_inode;
+}
Here I'm not sure - is
Hi,
在 2023/12/12 21:16, Christoph Hellwig 写道:
+void invalidate_bdev_range(struct block_device *bdev, pgoff_t start,
+ pgoff_t end)
+{
+ invalidate_mapping_pages(bdev->bd_inode->i_mapping, start, end);
+}
+EXPORT_SYMBOL_GPL(invalidate_bdev_range);
Can we have
Hi,
在 2023/12/12 14:35, Gao Xiang 写道:
On 2023/12/11 22:07, Yu Kuai wrote:
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/erofs/data.c | 18 --
fs/erofs/internal.h | 2 ++
2 files
Hi,
在 2023/12/12 1:27, Jan Kara 写道:
On Mon 11-12-23 22:07:53, Yu Kuai wrote:
From: Yu Kuai
Unlike __bread_gfp(), ext4 has special handing while reading sb block:
1) __GFP_NOFAIL is not set, and memory allocation can fail;
2) If buffer write failed before, set buffer uptodate and don't read
Hi,
在 2023/12/12 0:52, Jan Kara 写道:
On Mon 11-12-23 22:05:35, Yu Kuai wrote:
From: Yu Kuai
Those apis will be used for other modules, so that bd_inode won't be
accessed directly from other modules.
Signed-off-by: Yu Kuai
...
+void bdev_associated_mapping(struct block_device *bdev
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/ext4/dir.c | 6 ++
fs/ext4/ext4_jbd2.c | 6 +++---
fs/ext4/super.c | 3 +--
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/fs/ext4/dir.c b
From: Yu Kuai
block_device_ejected() is added by commit bdfe0cbd746a ("Revert
"ext4: remove block_device_ejected"") in 2015. At that time 'bdi->wb'
is destroyed synchronized from del_gendisk(), hence if ext4 is still
mounted, and then mark_buffer_dirty() will reference
From: Yu Kuai
Remove __ext4_sb_bread_gfp() and ext4_buffer_uptodate() that is defined
by ext4, and convert to use common helper __bread_gfp2() and
buffer_uptodate_or_error().
Signed-off-by: Yu Kuai
---
fs/ext4/ext4.h| 13 -
fs/ext4/inode.c | 8
fs/ext4/super.c
From: Yu Kuai
Unlike __bread_gfp(), ext4 has special handing while reading sb block:
1) __GFP_NOFAIL is not set, and memory allocation can fail;
2) If buffer write failed before, set buffer uptodate and don't read
block from disk;
3) REQ_META is set for all IO, and REQ_PRIO is set
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/jbd2/journal.c | 3 +--
fs/jbd2/recovery.c | 6 ++
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/gfs2/glock.c | 2 +-
fs/gfs2/ops_fstype.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/nilfs2/segment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 55e31cc903d1..a1130e384937 100644
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/erofs/data.c | 18 --
fs/erofs/internal.h | 2 ++
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
fs/btrfs/disk-io.c | 71 +-
fs/btrfs/volumes.c | 17 ++-
fs/btrfs/zoned.c | 15
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
drivers/md/bcache/super.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/md/bcache/super.c b
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/s390/block/dasd_ioctl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Also do some cleanup that there is no need for two for loop, and remove
local array pages.
Signed-off-by: Yu Kuai
---
fs/cramfs/inode.c | 36
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/block/xen-blkback/xenbus.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkback/xenbus.c
b/drivers/block/xen-blkback
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/scsi/scsicam.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index e2c7d8ef205f
From: Yu Kuai
Currently btrfs is using __bio_add_page() in write_dev_supers(). In order
to convert to use folio for bdev in btrfs, export bio_add_folio_nofail()
so that it can replace __bio_add_page().
Signed-off-by: Yu Kuai
---
block/bio.c | 1 +
1 file changed, 1 insertion(+)
diff --git
From: Yu Kuai
Those apis will be used for other modules, so that bd_inode won't be
accessed directly from other modules.
Signed-off-by: Yu Kuai
---
block/bdev.c | 70 ++
block/blk.h| 2 --
include/linux/blkdev.h | 17 ++
3
From: Yu Kuai
bdev_sectors() is not used hence remove it.
Signed-off-by: Yu Kuai
---
fs/bcachefs/util.h | 5 -
1 file changed, 5 deletions(-)
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 2984b57b2958..22a0acc1704f 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
From: Yu Kuai
Changes in v2:
- remove some bdev apis that is not necessary;
- pass in offset for bdev_read_folio() and __bdev_get_folio();
- remove bdev_gfp_constraint() and add a new helper in fs/buffer.c to
prevent access bd_indoe() directly from mapping_gfp_constraint() in
ext4.(patch 15
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
drivers/mtd/devices/block2mtd.c | 81 +++--
1 file changed, 36 insertions(+), 45 deletions(-)
diff --git
Hi,
在 2023/12/06 22:58, Matthew Wilcox 写道:
On Tue, Dec 05, 2023 at 08:37:15PM +0800, Yu Kuai wrote:
+struct folio *bdev_read_folio(struct block_device *bdev, pgoff_t index)
+{
+ return read_mapping_folio(bdev->bd_inode->i_mapping, index, NULL);
+}
+EXPORT_SYMBOL_GPL(bdev_read
Hi,
在 2023/12/06 13:55, Christoph Hellwig 写道:
On Tue, Dec 05, 2023 at 08:37:16PM +0800, Yu Kuai wrote:
diff --git a/drivers/block/xen-blkback/xenbus.c
b/drivers/block/xen-blkback/xenbus.c
index e34219ea2b05..e645afa4af57 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen
Hi,
在 2023/12/06 14:14, Christoph Hellwig 写道:
+void invalidate_bdev_range(struct block_device *bdev, pgoff_t start,
+ pgoff_t end)
+{
+ invalidate_mapping_pages(bdev->bd_inode->i_mapping, start, end);
+}
+EXPORT_SYMBOL_GPL(invalidate_bdev_range);
All these could
Hi,
在 2023/12/06 13:54, Christoph Hellwig 写道:
On Tue, Dec 05, 2023 at 08:37:14PM +0800, Yu Kuai wrote:
From: Yu Kuai
Patch 1 add some bdev apis, then follow up patches will use these apis
to avoid access bd_inode directly, and hopefully the field bd_inode can
be removed eventually(after
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/jbd2/journal.c | 3 +--
fs/jbd2/recovery.c | 6 ++
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/nilfs2/segment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 52995838f2de..be47a1d21889 100644
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/gfs2/glock.c | 2 +-
fs/gfs2/ops_fstype.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
fs/btrfs/disk-io.c | 68 --
fs/btrfs/volumes.c | 17 ++--
fs/btrfs/zoned.c | 12
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/scsi/scsicam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index e2c7d8ef205f
From: Yu Kuai
Patch 1 add some bdev apis, then follow up patches will use these apis
to avoid access bd_inode directly, and hopefully the field bd_inode can
be removed eventually(after figure out a way for fs/buffer.c).
Yu Kuai (14):
block: add some bdev apis
xen/blkback: use bdev api
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
drivers/mtd/devices/block2mtd.c | 80 +++--
1 file changed, 35 insertions(+), 45 deletions(-)
diff --git
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/ext4/dir.c | 6 ++
fs/ext4/ext4_jbd2.c | 6 +++---
fs/ext4/super.c | 27 ---
include/linux/buffer_head.h
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Signed-off-by: Yu Kuai
---
drivers/md/bcache/super.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/md/bcache/super.c b
From: Yu Kuai
On the one hand covert to use folio while reading bdev inode, on the
other hand prevent to access bd_inode directly.
Also do some cleanup that there is no need for two for loop, and remove
local array pages.
Signed-off-by: Yu Kuai
---
fs/cramfs/inode.c | 35
From: Yu Kuai
bdev_sectors() is not used hence remove it.
Signed-off-by: Yu Kuai
---
fs/bcachefs/util.h | 5 -
1 file changed, 5 deletions(-)
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index b93d5f481c7e..932ca6f7a37b 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
fs/erofs/data.c | 17 +++--
fs/erofs/internal.h | 1 +
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/s390/block/dasd_ioctl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
From: Yu Kuai
Those apis will be used for other modules, so that bd_inode won't be
accessed directly from other modules.
Signed-off-by: Yu Kuai
---
block/bdev.c | 116 +
block/bio.c| 1 +
block/blk.h| 2 -
include
From: Yu Kuai
Avoid to access bd_inode directly, prepare to remove bd_inode from
block_devcie.
Signed-off-by: Yu Kuai
---
drivers/block/xen-blkback/xenbus.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkback/xenbus.c
b/drivers/block/xen-blkback
Hi,
在 2023/11/28 0:32, Christoph Hellwig 写道:
On Mon, Nov 27, 2023 at 09:07:22PM +0800, Yu Kuai wrote:
1) Is't okay to add a new helper to pass in bdev for following apis?
For some we already have them (e.g. bdev_nr_bytes to read the bdev)
size, for some we need to add them. The big thing
Hi,
在 2023/11/27 15:21, Christoph Hellwig 写道:
On Mon, Nov 27, 2023 at 02:21:01PM +0800, Yu Kuai wrote:
From: Yu Kuai
block_devcie is allocated from bdev_alloc() by bdev_alloc_inode(), and
currently block_device contains a pointer that point to the address of
inode, while such inode
Hi,
在 2023/11/27 15:24, Kent Overstreet 写道:
On Mon, Nov 27, 2023 at 04:09:47PM +0900, Damien Le Moal wrote:
On 11/27/23 15:21, Yu Kuai wrote:
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/bcachefs
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/gfs2/glock.c | 2 +-
fs/gfs2/ops_fstype.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/nilfs2/segment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 55e31cc903d1
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/erofs/data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 029c761670bf..85d490b3b53d 100644
From: Yu Kuai
Which is more efficiency, and also remove the field 'bd_inode' since it's
not used anymore.
Signed-off-by: Yu Kuai
---
block/bdev.c | 39 ++-
block/blk-zoned.c | 4 ++--
block/fops.c | 4 ++--
block/genhd.c
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/jbd2/journal.c | 3 ++-
fs/jbd2/recovery.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
drivers/s390/block/dasd_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/buffer.c | 8
include/linux/buffer_head.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/buffer.c b/fs
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/ext4/dir.c | 2 +-
fs/ext4/ext4_jbd2.c | 2 +-
fs/ext4/super.c | 8
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
drivers/block/xen-blkback/xenbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/xen-blkback/xenbus.c
b/drivers/block/xen
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/bcachefs/util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 2984b57b2958..fe7ccb3a3517
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/cramfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 60dbfa0f8805..e9ed1e24c9e4
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
drivers/md/bcache/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
fs/btrfs/disk-io.c | 6 +++---
fs/btrfs/volumes.c | 4 ++--
fs/btrfs/zoned.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
drivers/mtd/devices/block2mtd.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd
From: Yu Kuai
Which is more efficiency, and also prepare to remove the field
'bd_inode' from block_device.
Signed-off-by: Yu Kuai
---
drivers/scsi/scsicam.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index e2c7d8ef205f
From: Yu Kuai
Changes in v2:
- split different portions into different patches, as greg k-h
suggested.
- use container_of() instead of "bdev + 1" to get the address of
bd_inode in the new helper, as grep k-h suggested.
Yu Kuai (16):
block: add a new helper to get inode from bl
From: Yu Kuai
block_devcie is allocated from bdev_alloc() by bdev_alloc_inode(), and
currently block_device contains a pointer that point to the address of
inode, while such inode is allocated together:
bdev_alloc
inode = new_inode()
// inode is _inode->vfs_inode
bdev = I_BDEV(in
Hi,
在 2023/11/25 22:32, Greg KH 写道:
On Sat, Nov 25, 2023 at 05:39:12PM +0800, Yu Kuai wrote:
From: Yu Kuai
block_devcie is allocated from bdev_alloc() by bdev_alloc_inode(), and
currently block_device contains a pointer that point to the address of
inode, while such inode is allocated
From: Yu Kuai
block_devcie is allocated from bdev_alloc() by bdev_alloc_inode(), and
currently block_device contains a pointer that point to the address of
inode, while such inode is allocated together:
bdev_alloc
inode = new_inode()
// inode is _inode->vfs_inode
bdev = I_BDEV(in
87 matches
Mail list logo