* [PATCH] blkdev: make struct block_device_operations.devnode() take a const *
@ 2022-11-09 14:48 Greg Kroah-Hartman
2022-11-09 19:41 ` Jens Axboe
2022-11-15 9:13 ` Christoph Hellwig
0 siblings, 2 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-09 14:48 UTC (permalink / raw)
To: axboe; +Cc: linux-kernel, Greg Kroah-Hartman, linux-block
The devnode() callback in struct block_device_operations should not be
modifying the device that is passed into it, so mark it as a const * and
propagate the function signature changes out into the one subsystem that
actually uses this callback.
Cc: linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Jens, I have some dependent kobject/driver core changes that require
this change in the works. Can I take this through the driver core tree
for 6.2-rc1?
drivers/block/pktcdvd.c | 2 +-
include/linux/blkdev.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 4cea3b08087e..8dc15be95962 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2632,7 +2632,7 @@ static unsigned int pkt_check_events(struct gendisk *disk,
return attached_disk->fops->check_events(attached_disk, clearing);
}
-static char *pkt_devnode(struct gendisk *disk, umode_t *mode)
+static char *pkt_devnode(const struct gendisk *disk, umode_t *mode)
{
return kasprintf(GFP_KERNEL, "pktcdvd/%s", disk->disk_name);
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 50e358a19d98..2a455793462b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1413,7 +1413,7 @@ struct block_device_operations {
void (*swap_slot_free_notify) (struct block_device *, unsigned long);
int (*report_zones)(struct gendisk *, sector_t sector,
unsigned int nr_zones, report_zones_cb cb, void *data);
- char *(*devnode)(struct gendisk *disk, umode_t *mode);
+ char *(*devnode)(const struct gendisk *disk, umode_t *mode);
/* returns the length of the identifier or a negative errno: */
int (*get_unique_id)(struct gendisk *disk, u8 id[16],
enum blk_unique_id id_type);
--
2.38.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] blkdev: make struct block_device_operations.devnode() take a const *
2022-11-09 14:48 [PATCH] blkdev: make struct block_device_operations.devnode() take a const * Greg Kroah-Hartman
@ 2022-11-09 19:41 ` Jens Axboe
2022-11-10 17:23 ` Greg Kroah-Hartman
2022-11-15 9:13 ` Christoph Hellwig
1 sibling, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2022-11-09 19:41 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, linux-block
On 11/9/22 7:48 AM, Greg Kroah-Hartman wrote:
> The devnode() callback in struct block_device_operations should not be
> modifying the device that is passed into it, so mark it as a const * and
> propagate the function signature changes out into the one subsystem that
> actually uses this callback.
>
> Cc: linux-block@vger.kernel.org
> Cc: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>
> Jens, I have some dependent kobject/driver core changes that require
> this change in the works. Can I take this through the driver core tree
> for 6.2-rc1?
Yeah go ahead, you can add my:
Acked-by: Jens Axboe <axboe@kernel.dk>
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] blkdev: make struct block_device_operations.devnode() take a const *
2022-11-09 19:41 ` Jens Axboe
@ 2022-11-10 17:23 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-10 17:23 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel, linux-block
On Wed, Nov 09, 2022 at 12:41:09PM -0700, Jens Axboe wrote:
> On 11/9/22 7:48 AM, Greg Kroah-Hartman wrote:
> > The devnode() callback in struct block_device_operations should not be
> > modifying the device that is passed into it, so mark it as a const * and
> > propagate the function signature changes out into the one subsystem that
> > actually uses this callback.
> >
> > Cc: linux-block@vger.kernel.org
> > Cc: Jens Axboe <axboe@kernel.dk>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >
> > Jens, I have some dependent kobject/driver core changes that require
> > this change in the works. Can I take this through the driver core tree
> > for 6.2-rc1?
>
> Yeah go ahead, you can add my:
>
> Acked-by: Jens Axboe <axboe@kernel.dk>
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] blkdev: make struct block_device_operations.devnode() take a const *
2022-11-09 14:48 [PATCH] blkdev: make struct block_device_operations.devnode() take a const * Greg Kroah-Hartman
2022-11-09 19:41 ` Jens Axboe
@ 2022-11-15 9:13 ` Christoph Hellwig
2022-11-15 10:30 ` Greg Kroah-Hartman
2022-12-02 18:28 ` Greg Kroah-Hartman
1 sibling, 2 replies; 6+ messages in thread
From: Christoph Hellwig @ 2022-11-15 9:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: axboe, linux-kernel, linux-block
On Wed, Nov 09, 2022 at 03:48:43PM +0100, Greg Kroah-Hartman wrote:
> The devnode() callback in struct block_device_operations should not be
> modifying the device that is passed into it, so mark it as a const * and
> propagate the function signature changes out into the one subsystem that
> actually uses this callback.
Yes. In fact it really shouldn't exist at all. I wonder if we can
do another attempt at dropping pktcdvd?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] blkdev: make struct block_device_operations.devnode() take a const *
2022-11-15 9:13 ` Christoph Hellwig
@ 2022-11-15 10:30 ` Greg Kroah-Hartman
2022-12-02 18:28 ` Greg Kroah-Hartman
1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-15 10:30 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: axboe, linux-kernel, linux-block
On Tue, Nov 15, 2022 at 01:13:07AM -0800, Christoph Hellwig wrote:
> On Wed, Nov 09, 2022 at 03:48:43PM +0100, Greg Kroah-Hartman wrote:
> > The devnode() callback in struct block_device_operations should not be
> > modifying the device that is passed into it, so mark it as a const * and
> > propagate the function signature changes out into the one subsystem that
> > actually uses this callback.
>
> Yes. In fact it really shouldn't exist at all. I wonder if we can
> do another attempt at dropping pktcdvd?
I'll gladly send a patch to delete it. Who objected last time? Let me
dig in the archives...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] blkdev: make struct block_device_operations.devnode() take a const *
2022-11-15 9:13 ` Christoph Hellwig
2022-11-15 10:30 ` Greg Kroah-Hartman
@ 2022-12-02 18:28 ` Greg Kroah-Hartman
1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2022-12-02 18:28 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: axboe, linux-kernel, linux-block
On Tue, Nov 15, 2022 at 01:13:07AM -0800, Christoph Hellwig wrote:
> On Wed, Nov 09, 2022 at 03:48:43PM +0100, Greg Kroah-Hartman wrote:
> > The devnode() callback in struct block_device_operations should not be
> > modifying the device that is passed into it, so mark it as a const * and
> > propagate the function signature changes out into the one subsystem that
> > actually uses this callback.
>
> Yes. In fact it really shouldn't exist at all. I wonder if we can
> do another attempt at dropping pktcdvd?
>
Patch removing it now sent.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-12-02 18:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-09 14:48 [PATCH] blkdev: make struct block_device_operations.devnode() take a const * Greg Kroah-Hartman
2022-11-09 19:41 ` Jens Axboe
2022-11-10 17:23 ` Greg Kroah-Hartman
2022-11-15 9:13 ` Christoph Hellwig
2022-11-15 10:30 ` Greg Kroah-Hartman
2022-12-02 18:28 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox