Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1266234ybz; Wed, 29 Apr 2020 18:28:09 -0700 (PDT) X-Google-Smtp-Source: APiQypKH52MYJIezK2EhBsP/rEC3bPnATnz67TKBe37ZhsiDxDb53E0TCnOUNN/xYXSnqnxwF9Qp X-Received: by 2002:a17:906:1d4c:: with SMTP id o12mr496531ejh.357.1588210089213; Wed, 29 Apr 2020 18:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588210089; cv=none; d=google.com; s=arc-20160816; b=KIaC+k6xIGNvoAhq8ofQ5s2Co7r735ntbc6x++nRfVGtljKYTAy5RScIP1A93xhMaR zORCMdllECbZIWkK7cZhfhoOUuiLJTXcDMJPZAByQjUGM8ijG2f2m6yY11S1o9fQ/xyV K232EhPS14emDAo8EDB2W+qAhlgxBvkdVIbA0KM7KL0q6Tp1lPDaQCy5Qh05JNgPok8g trpJxy8V74osPRcy9NtLDzt0pG7D0EeMlppqt3CJwESlN3q/EpwEpfmBCYvAsaag3t5P voQeb6KmZGWnI8vdYYsdyvlgvKxLzZkcFQ1YzFqnNy04GqI9jwX7JCMOzKXTQmwnkmZC CzKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=21hAksTDotqpkMDq5xLuGQkVLpud8HtePplRE81B5jU=; b=sg31pZcvKEJQHmFLWWLUVTGk2hI0Z12Jfc3bYVQ8nNPlKB+r+KmncDs+UzpLewf6kj kyK6AVqcaokVaA5CoonqOcYUi7CMNQ2P752iMrVlRZ/2NT/+HJc/hp6osVjvLbvdUBDX J5OAvku9ZyUaE/fLfesZ6vz7BotTKu3cPcJd75Htdqf1hAmoV8tDBh7RQPxZSBqIsg/4 IE2Hza5Xz6A8xFtgx1yMLbzD0fzIo6LfKRyH02H5AOZfFR6IIP/lT8dIZMNNxLUH6iZN BiJwaG9zx7NYfw1hVqc8zSyE85RnC0nHFLQElIru5cWRWuAcv/Jn4yK9+E0lokq5kQjg oRWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MNt0W47d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cn25si4409672edb.589.2020.04.29.18.27.43; Wed, 29 Apr 2020 18:28:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MNt0W47d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726431AbgD3B0G (ORCPT + 99 others); Wed, 29 Apr 2020 21:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbgD3B0G (ORCPT ); Wed, 29 Apr 2020 21:26:06 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9D4AC035494; Wed, 29 Apr 2020 18:26:03 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id w14so2933582lfk.3; Wed, 29 Apr 2020 18:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=21hAksTDotqpkMDq5xLuGQkVLpud8HtePplRE81B5jU=; b=MNt0W47dVdSty8zvvSAY7gxbeSx7TmcNfNDTQ/ciWsZi62PSgPSmu1xDYVRGpuHep0 KfH/hNEiutHmu+Rt12Q4i6BLevqW0OLXw7mOVnNxRIDzuaWqn3G7fMwMb/Y+gK/5NGfi TWb2vS/9Q0lcwDjzCj19/P3vlKInVVJxq+PIwTQTWlfaaxakzjYNr6WhmWIMhltCPkIs rD0zsS2PjN+E0POXwnZOHMzT/exL1y8+WkufyFsscNrAYryr8lz0DqyvgJtErcz105Z1 bRtpwSzP2RMFO05gjqaYem4OcODHR/56vtSYJr2qPdOvCiEBxg8cX5Ru+YLRlA0uR75a rOWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=21hAksTDotqpkMDq5xLuGQkVLpud8HtePplRE81B5jU=; b=rNBGLco4vp2SvxofFIM9i+W001/9VVk56h3azjExdtrKZs4dBQ5ljRbODIG1mu6TcT r8iWqapp99D4c2KZoZ5KVoNotQycy2C4rkT0VEe050YsKYSGS8F7uOHLcuORYQvMV0PG aOFbK28/Xx4bbVQQwRMwz3e9P/DXaJwLlH2N/8eVmoTkbBSE/DUaA136/CWOQ49Q+s0v JtDZL6zTiWFb5GnKzUwRsz0WL48UbZKnrdZLJYk9pxB5luKuSCDXzYt7oLiWgwC5rt+b KgwuRoXmR55GnVc660jyvnxLsvvZJM8wzd0S3HSRzanq1UkUd6UdlbP5J6z46QDPwx24 VjwA== X-Gm-Message-State: AGi0PuYGmtpNagDnyVu5G2sYHhfepzXkstE9frXNsvqYRlseGUFUsgh8 bMkWL6XeebxibHmco0ZSu3LmMIorUZZ1YfvFyrIFzXPWHLg= X-Received: by 2002:ac2:58f6:: with SMTP id v22mr383803lfo.146.1588209960084; Wed, 29 Apr 2020 18:26:00 -0700 (PDT) MIME-Version: 1.0 References: <20200426122237.j2ah64uoivp26ioj@debian.debian-2> In-Reply-To: <20200426122237.j2ah64uoivp26ioj@debian.debian-2> From: Bo YU Date: Thu, 30 Apr 2020 09:23:52 +0800 Message-ID: Subject: Re: [PATCH -next] block/genhd: align title and output To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 26, 2020 at 8:22 PM Bo YU wrote: > > Before the patch: > > major minor #blocks name > > 254 0 57671680 vda > 254 1 57670656 vda1 > > After the patch: > > major minor #blocks name > > 254 0 57671680 vda > 254 1 57670656 vda1 > > According to LDD3,major device maximun number is 12 bit,as it has 4 char > placeholders.minor device maximum number is 20 bit(7 char palceholders) > and keeping 10 char palceholders for blocks tag.If want to keep > palceholder's numbers dynamiclly, There is more tricks to do that. So i > keep it simple. > > Signed-off-by: Bo YU > --- > block/genhd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block/genhd.c b/block/genhd.c > index 06b642b23a07..63a483cf76b9 100644 > --- a/block/genhd.c > +++ b/block/genhd.c > @@ -1151,7 +1151,7 @@ static void *show_partition_start(struct seq_file *seqf, loff_t *pos) > > p = disk_seqf_start(seqf, pos); > if (!IS_ERR_OR_NULL(p) && !*pos) > - seq_puts(seqf, "major minor #blocks name\n\n"); > + seq_puts(seqf, "major minor #blocks name\n\n"); > return p; > } > > @@ -1172,7 +1172,7 @@ static int show_partition(struct seq_file *seqf, void *v) > /* show the full disk and all non-0 size partitions of it */ > disk_part_iter_init(&piter, sgp, DISK_PITER_INCL_PART0); > while ((part = disk_part_iter_next(&piter))) > - seq_printf(seqf, "%4d %7d %10llu %s\n", > + seq_printf(seqf, "%-4d %-7d %-10llu %s\n", > MAJOR(part_devt(part)), MINOR(part_devt(part)), > (unsigned long long)part_nr_sects_read(part) >> 1, > disk_name(sgp, part->partno, buf)); > -- > 2.11.0 > Sorry, Ping again