* [PATCH 1/5] f2fs: notify when discard is not supported
@ 2013-03-17 8:26 Namjae Jeon
0 siblings, 0 replies; only message in thread
From: Namjae Jeon @ 2013-03-17 8:26 UTC (permalink / raw)
To: jaegeuk.kim
Cc: linux-f2fs-devel, linux-fsdevel, linux-kernel, Namjae Jeon,
Namjae Jeon, Amit Sahrawat
From: Namjae Jeon <namjae.jeon@samsung.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@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-03-17 8:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-17 8:26 [PATCH 1/5] f2fs: notify when discard is not supported Namjae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).