diff options
author | Namjae Jeon <linkinjeon@gmail.com> | 2012-12-18 01:02:56 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-18 02:15:22 +0100 |
commit | f562146a3daf6aa0bbf2a1bc4b6b7da031ed5dcd (patch) | |
tree | 18a0b65b13f86a5cf464459fb81744c1431a9c6b /fs/fat/inode.c | |
parent | rtc: DA9055 RTC driver (diff) | |
download | linux-f562146a3daf6aa0bbf2a1bc4b6b7da031ed5dcd.tar.xz linux-f562146a3daf6aa0bbf2a1bc4b6b7da031ed5dcd.zip |
fat: notify when discard is not supported
Change fatfs so that a warning is emitted when an attempt is made to mount
a filesystem with the unsupported `discard' option.
ext4 aready does this: http://patchwork.ozlabs.org/patch/192668/
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Amit Sahrawat <amit.sahrawat83@gmail.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 5bafaad00530..7b186a5d51b1 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -26,6 +26,7 @@ #include <linux/writeback.h> #include <linux/log2.h> #include <linux/hash.h> +#include <linux/blkdev.h> #include <asm/unaligned.h> #include "fat.h" @@ -1431,6 +1432,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, goto out_fail; } + if (sbi->options.discard) { + struct request_queue *q = bdev_get_queue(sb->s_bdev); + if (!blk_queue_discard(q)) + fat_msg(sb, KERN_WARNING, + "mounting with \"discard\" option, but " + "the device does not support discard"); + } + return 0; out_invalid: |