public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Lukáš Czerner" <lczerner@redhat.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 2/3] mke2fs: print extra information about existing ext2/3/4 file systems
Date: Mon, 5 May 2014 15:45:17 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1405051541080.2223@localhost.localdomain> (raw)
In-Reply-To: <1399295044-24489-2-git-send-email-tytso@mit.edu>

On Mon, 5 May 2014, Theodore Ts'o wrote:

> Date: Mon,  5 May 2014 09:04:03 -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 2/3] mke2fs: print extra information about existing ext2/3/4
>     file systems

Description missing.

> 
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> ---
>  misc/util.c | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/misc/util.c b/misc/util.c
> index 15b4ce5..d63e21b 100644
> --- a/misc/util.c
> +++ b/misc/util.c
> @@ -105,6 +105,41 @@ void proceed_question(int delay)
>  	signal(SIGALRM, SIG_IGN);
>  }
>  
> +static void print_ext2_info(const char *device)
> +
> +{
> +	struct ext2_super_block	*sb;
> +	ext2_filsys		fs;
> +	errcode_t		retval;
> +	time_t 			tm;
> +	char			buf[80];
> +
> +	retval = ext2fs_open2(device, 0, 0, 0, 0, unix_io_manager, &fs);
> +	if (retval)
> +		return;
> +	sb = fs->super;
> +
> +	if (sb->s_mtime) {
> +		tm = sb->s_mtime;
> +		if (sb->s_last_mounted[0]) {
> +			memset(buf, 0, sizeof(buf));
> +			strncpy(buf, sb->s_last_mounted,
> +				sizeof(sb->s_last_mounted));
> +			printf(_("\tlast mounted on %s on %s"), buf,
> +			       ctime(&tm));
> +		} else
> +			printf(_("\tlast mounted on %s"), ctime(&tm));
> +	} else if (sb->s_mkfs_time) {
> +		tm = sb->s_mkfs_time;
> +		printf(_("\tcreated on %s"), ctime(&tm));
> +	} else if (sb->s_mkfs_time) {
> +		tm = sb->s_mtime;
> +		printf(_("\tlast modified on %s"), ctime(&tm));
> +	}
> +	ext2fs_close(fs);
> +}
> +
> +
>  /*
>   * return 1 if the device looks plausible, creating the file if necessary
>   */
> @@ -168,6 +203,8 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev)
>  		else
>  			printf(_("%s contains a %s file system\n"), device,
>  			       fs_type);
> +		if (strncmp(fs_type, "ext", 3) == 0)
> +			print_ext2_info(device);

Now I am actually confused, sorry. Which patches do I need to get this
context? I do not see this in the next branch.

Thanks!
-Lukas

>  		free(fs_type);
>  		free(fs_label);
>  		return 0;
> 

  reply	other threads:[~2014-05-05 13:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 13:04 [PATCH 1/3] mke2fs: print a message when creating a regular file Theodore Ts'o
2014-05-05 13:04 ` [PATCH 2/3] mke2fs: print extra information about existing ext2/3/4 file systems Theodore Ts'o
2014-05-05 13:45   ` Lukáš Czerner [this message]
2014-05-05 14:04     ` Theodore Ts'o
2014-05-05 14:17       ` Lukáš Czerner
2014-05-05 14:28       ` Theodore Ts'o
2014-05-05 14:38         ` Lukáš Czerner
2014-05-05 14:44           ` Theodore Ts'o
2014-05-05 14:51             ` Lukáš Czerner
2014-05-05 14:57               ` Theodore Ts'o
2014-05-05 16:25                 ` Andreas Dilger
2014-05-05 17:50               ` Karel Zak
2014-05-05 18:32                 ` Theodore Ts'o
2014-05-06  7:44                   ` Karel Zak
2014-05-05 16:30             ` Andreas Dilger
2014-05-05 13:04 ` [PATCH 3/3] mke2fs: check for a partition table and warn if present Theodore Ts'o
2014-05-05 13:52   ` Lukáš Czerner
2014-05-05 13:58     ` Theodore Ts'o
2014-05-05 14:11       ` Lukáš Czerner
2014-05-05 14:20         ` Theodore Ts'o
2014-05-06 12:20           ` Karel Zak
2014-05-06 12:52             ` Lukáš Czerner
2014-05-05 13:41 ` [PATCH 1/3] mke2fs: print a message when creating a regular file Lukáš Czerner
2014-05-05 13:52   ` Theodore Ts'o
2014-05-05 14:04     ` Lukáš Czerner
2014-05-05 14:46     ` Eric Sandeen
2014-05-05 14:49       ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.1405051541080.2223@localhost.localdomain \
    --to=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox