[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1363508774-2818-1-git-send-email-linkinjeon@gmail.com>
Date: Sun, 17 Mar 2013 17:26:14 +0900
From: Namjae Jeon <linkinjeon@...il.com>
To: jaegeuk.kim@...sung.com
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Namjae Jeon <linkinjeon@...il.com>,
Namjae Jeon <namjae.jeon@...sung.com>,
Amit Sahrawat <a.sahrawat@...sung.com>
Subject: [PATCH 1/5] f2fs: notify when discard is not supported
From: Namjae Jeon <namjae.jeon@...sung.com>
Change f2fs so that a warning is emitted when an attempt is made to
mount a filesystem with the unsupported discard option.
Signed-off-by: Namjae Jeon <namjae.jeon@...sung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@...sung.com>
---
fs/f2fs/super.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index ae75536..2bb6951 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -21,6 +21,7 @@
#include <linux/seq_file.h>
#include <linux/random.h>
#include <linux/exportfs.h>
+#include <linux/blkdev.h>
#include <linux/f2fs_fs.h>
#include "f2fs.h"
@@ -649,6 +650,14 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
err = f2fs_build_stats(sbi);
if (err)
goto fail;
+
+ if (test_opt(sbi, DISCARD)) {
+ struct request_queue *q = bdev_get_queue(sb->s_bdev);
+ if (!blk_queue_discard(q))
+ f2fs_msg(sb, KERN_WARNING,
+ "mounting with \"discard\" option, but "
+ "the device does not support discard");
+ }
return 0;
fail:
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists