From patchwork Tue Mar 31 16:01:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Monakhov X-Patchwork-Id: 6132141 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4EF3F9F2EC for ; Tue, 31 Mar 2015 16:35:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DD69201BB for ; Tue, 31 Mar 2015 16:35:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0BE72201CE for ; Tue, 31 Mar 2015 16:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754754AbbCaQfl (ORCPT ); Tue, 31 Mar 2015 12:35:41 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:1461 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752407AbbCaQfk (ORCPT ); Tue, 31 Mar 2015 12:35:40 -0400 X-Greylist: delayed 1814 seconds by postgrey-1.27 at vger.kernel.org; Tue, 31 Mar 2015 12:32:06 EDT Received: from mct2.qa.sw.ru ([10.29.1.63]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id t2VG1U5l011724; Tue, 31 Mar 2015 19:01:36 +0300 (MSK) From: Dmitry Monakhov To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, axboe@kernel.dk, viro@zeniv.linux.org.uk, dm-devel@redhat.com, Dmitry Monakhov Subject: [PATCH 3/7] block: use block_device name vsprintf helper Date: Tue, 31 Mar 2015 20:01:17 +0400 Message-Id: <1427817681-4494-4-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1427817681-4494-1-git-send-email-dmonakhov@openvz.org> References: <1427817681-4494-1-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Dmitry Monakhov --- block/blk-core.c | 30 ++++++++++++------------------ block/blk-settings.c | 9 ++------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 794c3e7..88a4c94 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1694,12 +1694,9 @@ static inline void blk_partition_remap(struct bio *bio) static void handle_bad_sector(struct bio *bio) { - char b[BDEVNAME_SIZE]; - printk(KERN_INFO "attempt to access beyond end of device\n"); - printk(KERN_INFO "%s: rw=%ld, want=%Lu, limit=%Lu\n", - bdevname(bio->bi_bdev, b), - bio->bi_rw, + printk(KERN_INFO "%pg: rw=%ld, want=%Lu, limit=%Lu\n", + bio->bi_bdev,bio->bi_rw, (unsigned long long)bio_end_sector(bio), (long long)(i_size_read(bio->bi_bdev->bd_inode) >> 9)); @@ -1776,7 +1773,6 @@ generic_make_request_checks(struct bio *bio) struct request_queue *q; int nr_sectors = bio_sectors(bio); int err = -EIO; - char b[BDEVNAME_SIZE]; struct hd_struct *part; might_sleep(); @@ -1788,16 +1784,16 @@ generic_make_request_checks(struct bio *bio) if (unlikely(!q)) { printk(KERN_ERR "generic_make_request: Trying to access " - "nonexistent block-device %s (%Lu)\n", - bdevname(bio->bi_bdev, b), - (long long) bio->bi_iter.bi_sector); + "nonexistent block-device %pg (%Lu)\n", + bio->bi_bdev, + (long long) bio->bi_iter.bi_sector); goto end_io; } if (likely(bio_is_rw(bio) && nr_sectors > queue_max_hw_sectors(q))) { - printk(KERN_ERR "bio too big device %s (%u > %u)\n", - bdevname(bio->bi_bdev, b), + printk(KERN_ERR "bio too big device %pg (%u > %u)\n", + bio->bi_bdev, bio_sectors(bio), queue_max_hw_sectors(q)); goto end_io; @@ -1970,13 +1966,11 @@ void submit_bio(int rw, struct bio *bio) } if (unlikely(block_dump)) { - char b[BDEVNAME_SIZE]; - printk(KERN_DEBUG "%s(%d): %s block %Lu on %s (%u sectors)\n", - current->comm, task_pid_nr(current), - (rw & WRITE) ? "WRITE" : "READ", - (unsigned long long)bio->bi_iter.bi_sector, - bdevname(bio->bi_bdev, b), - count); + printk(KERN_DEBUG "%s(%d): %s block %Lu on %pg (%u sectors)\n", + current->comm, task_pid_nr(current), + (rw & WRITE) ? "WRITE" : "READ", + (unsigned long long)bio->bi_iter.bi_sector, + bio->bi_bdev, count); } } diff --git a/block/blk-settings.c b/block/blk-settings.c index 6ed2cbe..45d52cf 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -689,13 +689,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, struct request_queue *t = disk->queue; if (bdev_stack_limits(&t->limits, bdev, offset >> 9) < 0) { - char top[BDEVNAME_SIZE], bottom[BDEVNAME_SIZE]; - - disk_name(disk, 0, top); - bdevname(bdev, bottom); - - printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n", - top, bottom); + printk(KERN_NOTICE "%s: Warning: Device %pg is misaligned\n", + disk->disk_name, bdev); } } EXPORT_SYMBOL(disk_stack_limits);