Re: [dm-devel] [PATCH 37/44] block: switch partition lookup to use struct block_device

2020-11-27 Thread Jan Kara
On Fri 27-11-20 16:36:15, Christoph Hellwig wrote: > On Fri, Nov 27, 2020 at 01:45:37PM +0100, Jan Kara wrote: > > > At this point the hd_struct is already allocated together with the > > > block_device, and thus only freed after the last block_device reference > > > goes away plus the inode freein

Re: [dm-devel] [PATCH 37/44] block: switch partition lookup to use struct block_device

2020-11-27 Thread Christoph Hellwig
On Fri, Nov 27, 2020 at 01:45:37PM +0100, Jan Kara wrote: > > At this point the hd_struct is already allocated together with the > > block_device, and thus only freed after the last block_device reference > > goes away plus the inode freeing RCU grace period. So the device model > > ref to part is

Re: [dm-devel] [PATCH 37/44] block: switch partition lookup to use struct block_device

2020-11-27 Thread Jan Kara
On Fri 27-11-20 10:48:42, Christoph Hellwig wrote: > On Thu, Nov 26, 2020 at 07:22:19PM +0100, Jan Kara wrote: > > On Thu 26-11-20 14:04:15, Christoph Hellwig wrote: > > > struct hd_struct *disk_get_part(struct gendisk *disk, int partno) > > > { > > > - struct hd_struct *part; > > > + struct bloc

Re: [dm-devel] [PATCH 37/44] block: switch partition lookup to use struct block_device

2020-11-27 Thread Christoph Hellwig
On Thu, Nov 26, 2020 at 07:22:19PM +0100, Jan Kara wrote: > On Thu 26-11-20 14:04:15, Christoph Hellwig wrote: > > struct hd_struct *disk_get_part(struct gendisk *disk, int partno) > > { > > - struct hd_struct *part; > > + struct block_device *part; > > > > rcu_read_lock(); > > part

Re: [dm-devel] [PATCH 37/44] block: switch partition lookup to use struct block_device

2020-11-26 Thread Jan Kara
On Thu 26-11-20 14:04:15, Christoph Hellwig wrote: > struct hd_struct *disk_get_part(struct gendisk *disk, int partno) > { > - struct hd_struct *part; > + struct block_device *part; > > rcu_read_lock(); > part = __disk_get_part(disk, partno); > - if (part) > -

Re: [dm-devel] [PATCH 37/44] block: switch partition lookup to use struct block_device

2020-11-26 Thread Jan Kara
On Thu 26-11-20 14:04:15, Christoph Hellwig wrote: > Use struct block_device to lookup partitions on a disk. This removes > all usage of struct hd_struct from the I/O path, and this allows removing > the percpu refcount in struct hd_struct. Well, you've already removed the percpu refcount... > S

[dm-devel] [PATCH 37/44] block: switch partition lookup to use struct block_device

2020-11-26 Thread Christoph Hellwig
Use struct block_device to lookup partitions on a disk. This removes all usage of struct hd_struct from the I/O path, and this allows removing the percpu refcount in struct hd_struct. Signed-off-by: Christoph Hellwig Acked-by: Coly Li [bcache] Acked-by: Chao Yu