diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-08-02 10:56:40 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-08-24 10:16:14 -0700 |
commit | 3e025740b976c409820a789f8dabc4ec2c50a950 (patch) | |
tree | faf2106cecd92efa0bad1e2c29e99d01303817e1 /fs/f2fs/f2fs.h | |
parent | bb413d6acd4e1c361daebf8486efc3923f429792 (diff) |
f2fs: do not use discard_map for hard disks
We don't need to keep discard_map, if disk does not support discard command.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 14f5fe2b841e..f478cb6ec378 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1072,6 +1072,13 @@ static inline void clear_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) cp->ckpt_flags = cpu_to_le32(ckpt_flags); } +static inline bool f2fs_discard_en(struct f2fs_sb_info *sbi) +{ + struct request_queue *q = bdev_get_queue(sbi->sb->s_bdev); + + return blk_queue_discard(q); +} + static inline void f2fs_lock_op(struct f2fs_sb_info *sbi) { down_read(&sbi->cp_rwsem); |