* [PATCH 1/3][RFC] ext2: add a message in mount/remount/umount for ext2
@ 2009-09-15 6:22 Toshiyuki Okajima
0 siblings, 0 replies; only message in thread
From: Toshiyuki Okajima @ 2009-09-15 6:22 UTC (permalink / raw)
To: tytso, akpm; +Cc: sct, adilger, linux-ext4
From: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
ext2 doesn't log a record of having mounted, remounted and unmounted the
filesystem. Therefore in the system log, we cannot judge whether or not at
the certain time this filesystem user touches it.
For enterprise users, they often want to know when a certain filesystem is
mounted/remounted/unmounted.
So, we output the message to the system log when the filesystem is
mounted/remounted/unmounted.
Signed-off-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
---
fs/ext2/super.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff -Nurp linux-2.6.31.orig/fs/ext2/super.c linux-2.6.31/fs/ext2/super.c
--- linux-2.6.31.orig/fs/ext2/super.c 2009-09-10 07:13:59.000000000 +0900
+++ linux-2.6.31/fs/ext2/super.c 2009-09-11 17:08:53.907463826 +0900
@@ -109,6 +109,19 @@ void ext2_update_dynamic_rev(struct supe
*/
}
+static void ext2_print_mount_message(struct super_block *sb,
+ int is_remount)
+{
+ printk(KERN_INFO "EXT2 FS %s on %s\n",
+ is_remount? "remounted": "mounted", sb->s_id);
+}
+
+static void ext2_print_umount_message(struct super_block *sb)
+{
+ printk(KERN_INFO "EXT2 FS unmounted from %s\n", sb->s_id);
+}
+
+
static void ext2_put_super (struct super_block * sb)
{
int db_count;
@@ -140,6 +153,7 @@ static void ext2_put_super (struct super
sb->s_fs_info = NULL;
kfree(sbi->s_blockgroup_lock);
kfree(sbi);
+ ext2_print_umount_message(sb);
unlock_kernel();
}
@@ -1063,6 +1077,7 @@ static int ext2_fill_super(struct super_
ext2_warning(sb, __func__,
"mounting ext3 filesystem as ext2");
ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY);
+ ext2_print_mount_message(sb, 0);
return 0;
cantfind_ext2:
@@ -1232,6 +1247,7 @@ static int ext2_remount (struct super_bl
sb->s_flags &= ~MS_RDONLY;
}
ext2_sync_super(sb, es);
+ ext2_print_mount_message(sb, 1);
unlock_kernel();
return 0;
restore_opts:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-15 6:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-15 6:22 [PATCH 1/3][RFC] ext2: add a message in mount/remount/umount for ext2 Toshiyuki Okajima
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.