Message ID | 1398556834-31913-7-git-send-email-tytso@mit.edu |
---|---|
State | Accepted, archived |
Headers | show |
On Sat, 26 Apr 2014, Theodore Ts'o wrote: > Date: Sat, 26 Apr 2014 20:00:34 -0400 > From: Theodore Ts'o <tytso@mit.edu> > To: Ext4 Developers List <linux-ext4@vger.kernel.org> > Cc: Theodore Ts'o <tytso@mit.edu> > Subject: [PATCH 7/7] mke2fs: only print the low-level file system stats in > verbose mode While I kind of like this, because mke2fs is really quite verbose as it is. However I am afraid that this will break scripts for people. Also there are actually some useful information in that output like block size, size of the file system and file system label if specified. Also maybe having UUID in there will be also useful. Thanks! -Lukas > > Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> > --- > misc/mke2fs.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/misc/mke2fs.c b/misc/mke2fs.c > index 3694ce5..b274165 100644 > --- a/misc/mke2fs.c > +++ b/misc/mke2fs.c > @@ -618,6 +618,9 @@ static void show_stats(ext2_filsys fs) > dgrp_t i; > int need, col_left; > > + if (!verbose) > + goto skip_details; > + > if (ext2fs_blocks_count(&fs_param) != ext2fs_blocks_count(s)) > fprintf(stderr, _("warning: %llu blocks unused.\n\n"), > ext2fs_blocks_count(&fs_param) - ext2fs_blocks_count(s)); > @@ -666,6 +669,7 @@ static void show_stats(ext2_filsys fs) > s->s_blocks_per_group, s->s_clusters_per_group); > printf(_("%u inodes per group\n"), s->s_inodes_per_group); > > +skip_details: > if (fs->group_desc_count == 1) { > printf("\n"); > return; > -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 30, 2014 at 01:22:52PM +0200, Lukáš Czerner wrote: > On Sat, 26 Apr 2014, Theodore Ts'o wrote: > > > Date: Sat, 26 Apr 2014 20:00:34 -0400 > > From: Theodore Ts'o <tytso@mit.edu> > > To: Ext4 Developers List <linux-ext4@vger.kernel.org> > > Cc: Theodore Ts'o <tytso@mit.edu> > > Subject: [PATCH 7/7] mke2fs: only print the low-level file system stats in > > verbose mode > > While I kind of like this, because mke2fs is really quite verbose as > it is. However I am afraid that this will break scripts for people. Are there scripts that are really trying to parse the output of mke2fs? The output hasn't really been _that_ stable. I'm sure we've added stuff in the past, althoughg admittedly the this is the first time that we would be removing stuff. > Also there are actually some useful information in that output like > block size, size of the file system and file system label if > specified. Also maybe having UUID in there will be also useful. The block sizs is pretty much always 4k, and the file system label is only there if the user specified one on the command line. I can see how the size and UUID might be useful, though. How about if we just print the size and UUID? - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, 30 Apr 2014, Theodore Ts'o wrote: > Date: Wed, 30 Apr 2014 10:01:50 -0400 > From: Theodore Ts'o <tytso@mit.edu> > To: Lukáš Czerner <lczerner@redhat.com> > Cc: Ext4 Developers List <linux-ext4@vger.kernel.org> > Subject: Re: [PATCH 7/7] mke2fs: only print the low-level file system stats in > verbose mode > > On Wed, Apr 30, 2014 at 01:22:52PM +0200, Lukáš Czerner wrote: > > On Sat, 26 Apr 2014, Theodore Ts'o wrote: > > > > > Date: Sat, 26 Apr 2014 20:00:34 -0400 > > > From: Theodore Ts'o <tytso@mit.edu> > > > To: Ext4 Developers List <linux-ext4@vger.kernel.org> > > > Cc: Theodore Ts'o <tytso@mit.edu> > > > Subject: [PATCH 7/7] mke2fs: only print the low-level file system stats in > > > verbose mode > > > > While I kind of like this, because mke2fs is really quite verbose as > > it is. However I am afraid that this will break scripts for people. > > Are there scripts that are really trying to parse the output of > mke2fs? The output hasn't really been _that_ stable. I'm sure we've > added stuff in the past, althoughg admittedly the this is the first > time that we would be removing stuff. Yes, that's what I worry about. Addition would most likely not break grep, but removal will surely do. I am sure that there are admins doing that. It also does not help that other file systems are printing out various "low level" information. Despite the fact that parsing mkfs output is not the best thing to do I am on the fence whether we want to break it or not. > > > Also there are actually some useful information in that output like > > block size, size of the file system and file system label if > > specified. Also maybe having UUID in there will be also useful. > > The block sizs is pretty much always 4k, and the file system label is > only there if the user specified one on the command line. I can see > how the size and UUID might be useful, though. > > How about if we just print the size and UUID? Sounds good to me. -Lukas > > - Ted >
diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 3694ce5..b274165 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -618,6 +618,9 @@ static void show_stats(ext2_filsys fs) dgrp_t i; int need, col_left; + if (!verbose) + goto skip_details; + if (ext2fs_blocks_count(&fs_param) != ext2fs_blocks_count(s)) fprintf(stderr, _("warning: %llu blocks unused.\n\n"), ext2fs_blocks_count(&fs_param) - ext2fs_blocks_count(s)); @@ -666,6 +669,7 @@ static void show_stats(ext2_filsys fs) s->s_blocks_per_group, s->s_clusters_per_group); printf(_("%u inodes per group\n"), s->s_inodes_per_group); +skip_details: if (fs->group_desc_count == 1) { printf("\n"); return;
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> --- misc/mke2fs.c | 4 ++++ 1 file changed, 4 insertions(+)