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
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
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
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
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)
> -
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
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