diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2013-03-17 08:26:14 (GMT) |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-03-20 09:30:14 (GMT) |
commit | d3ee456dfbed1992bcaa0096d9bc76a691b0e700 (patch) | |
tree | 83a3e2554f755ca81d32eed944efa27dd3ce6c87 /fs/f2fs/super.c | |
parent | ae51fb31b8c3eb0cedc223782832be393e53623b (diff) | |
download | linux-d3ee456dfbed1992bcaa0096d9bc76a691b0e700.tar.xz |
f2fs: notify when discard is not supported
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>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 1c7f595..022b32a 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" @@ -650,6 +651,14 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) 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: stop_gc_thread(sbi); |