a few trivial bdevname() removals
Subsystems (4)
Hi Jens,
this series contains a few trivial conversion from bdevname to the %pg format specifier.
Diffstat:
block/bdev.c | 8 +++----- block/blk-lib.c | 6 ++---- drivers/block/drbd/drbd_req.c | 6 ++---- drivers/block/pktcdvd.c | 10 +++------- security/loadpin/loadpin.c | 5 +---- 5 files changed, 11 insertions(+), 24 deletions(-)
PATCH 1/5 block: stop using bdevname in bdev_write_inode
Use the %pg format specifier to save on stack consuption and code size.
--- block/bdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
block/bdev.c +3 -5
@@ -54,12 +54,10 @@ static void bdev_write_inode(struct block_device *bdev)while (inode->i_state &I_DIRTY ) {spin_unlock (&inode->i_lock); ret =write_inode_now (inode, true); -if (ret) { -char name[BDEVNAME_SIZE ]; +if (ret)pr_warn_ratelimited ("VFS: Dirty inode writeback failed " -"for block device %s (err=%d).\n" , -bdevname (bdev, name), ret); - } +"for block device %pg (err=%d).\n" , + bdev, ret);spin_lock (&inode->i_lock); }spin_unlock (&inode->i_lock);
Signature · 1 line
2.30.2
Re: [PATCH 1/5] block: stop using bdevname in bdev_write_inode
Looks good,
PATCH 2/5 block: stop using bdevname in __blkdev_issue_discard
In reply to Christoph HellwigUse the %pg format specifier to save on stack consuption and code size.
--- block/blk-lib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
block/blk-lib.c +2 -4
@@ -34,10 +34,8 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,/* In case the discard granularity isn't set by buggy device driver */ if (WARN_ON_ONCE (!q->limits.discard_granularity)) { -char dev_name[BDEVNAME_SIZE ]; - -bdevname (bdev, dev_name); -pr_err_ratelimited ("%s: Error: discard_granularity is 0.\n" , dev_name); +pr_err_ratelimited ("%pg: Error: discard_granularity is 0.\n" , + bdev);return -EOPNOTSUPP ; }
Signature · 1 line
2.30.2
Re: [PATCH 2/5] block: stop using bdevname in __blkdev_issue_discard
Looks good,
PATCH 3/5 block: stop using bdevname in drbd_report_io_error
In reply to Christoph HellwigUse the %pg format specifier to save on stack consuption and code size.
--- drivers/block/drbd/drbd_req.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/block/drbd/drbd_req.c +2 -4
@@ -511,16 +511,14 @@ static void mod_rq_state(struct drbd_request *req, struct bio_and_error *m,static void drbd_report_io_error (struct drbd_device *device,struct drbd_request *req) { -char b[BDEVNAME_SIZE ]; -if (!__ratelimit (&drbd_ratelimit_state))return ; -drbd_warn (device,"local %s IO error sector %llu+%u on %s\n" , +drbd_warn (device,"local %s IO error sector %llu+%u on %pg\n" , (req->rq_state &RQ_WRITE ) ?"WRITE" :"READ" , (unsigned long long )req->i.sector, req->i.size >>9 , -bdevname (device->ldev->backing_bdev, b)); + device->ldev->backing_bdev); }/* Helper for HANDED_OVER_TO_NETWORK.
Signature · 1 line
2.30.2
Re: [PATCH 3/5] block: stop using bdevname in drbd_report_io_error
Looks good,
PATCH 4/5 pktcdvd: stop using bdevname
In reply to Christoph HellwigUse the %pg format specifier to save on stack consuption and code size.
--- drivers/block/pktcdvd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/block/pktcdvd.c +3 -7
@@ -2471,11 +2471,9 @@ static int pkt_seq_show(struct seq_file *m, void *p) {struct pktcdvd_device *pd = m->private;char *msg; -char bdev_buf[BDEVNAME_SIZE ];int states[PACKET_NUM_STATES ]; -seq_printf (m,"Writer %s mapped to %s:\n" , pd->name, -bdevname (pd->bdev, bdev_buf)); +seq_printf (m,"Writer %s mapped to %pg:\n" , pd->name, pd->bdev);seq_printf (m,"\nSettings:\n" );seq_printf (m,"\tpacket size:\t\t%dkB\n" , pd->settings.size /2 );
@@ -2532,7 +2530,6 @@ static int pkt_seq_show(struct seq_file *m, void *p)static int pkt_new_dev (struct pktcdvd_device *pd,dev_t dev) {int i; -char b[BDEVNAME_SIZE ];struct block_device *bdev;struct scsi_device *sdev;
@@ -2545,8 +2542,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)if (!pd2)continue ;if (pd2->bdev->bd_dev == dev) { -pkt_err (pd,"%s already setup\n" , -bdevname (pd2->bdev, b)); +pkt_err (pd,"%pg already setup\n" , pd2->bdev);return -EBUSY ; }if (pd2->pkt_dev == dev) {
@@ -2581,7 +2577,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) }proc_create_single_data (pd->name,0 , pkt_proc, pkt_seq_show, pd); -pkt_dbg (1 , pd,"writer mapped to %s\n" ,bdevname (bdev, b)); +pkt_dbg (1 , pd,"writer mapped to %pg\n" , bdev);return 0 ; out_mem:
Signature · 1 line
2.30.2
Re: [PATCH 4/5] pktcdvd: stop using bdevname
Looks good,
PATCH 5/5 loadpin: stop using bdevname
In reply to Christoph HellwigUse the %pg format specifier to save on stack consuption and code size.
--- security/loadpin/loadpin.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
security/loadpin/loadpin.c +1 -4
@@ -78,11 +78,8 @@ static void check_pinning_enforcement(struct super_block *mnt_sb)* device, allow sysctl to change modes for testing. */ if (mnt_sb->s_bdev) { -char bdev[BDEVNAME_SIZE ]; - ro =bdev_read_only (mnt_sb->s_bdev); -bdevname (mnt_sb->s_bdev, bdev); -pr_info ("%s (%u:%u): %s\n" , bdev, +pr_info ("%pg (%u:%u): %s\n" , mnt_sb->s_bdev,MAJOR (mnt_sb->s_bdev->bd_dev),MINOR (mnt_sb->s_bdev->bd_dev), ro ?"read-only" :"writable" );
Signature · 1 line
2.30.2
Re: [PATCH 5/5] loadpin: stop using bdevname
Looks good,
Re: [PATCH 5/5] loadpin: stop using bdevname
In reply to Christoph HellwigQuoted 3 lines · Christoph Hellwig
Use the %pg format specifier to save on stack consuption and code size.
Signed-off-by Christoph Hellwig <[email protected]>
Signature · 1 line
Kees Cook