diff options
-rw-r--r-- | fs/ext4/mballoc.c | 3 | ||||
-rw-r--r-- | fs/fat/fatent.c | 4 | ||||
-rw-r--r-- | include/linux/blkdev.h | 11 |
3 files changed, 10 insertions, 8 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 4b4ad4b7ce57..df44b345f662 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -2566,7 +2566,8 @@ static inline void ext4_issue_discard(struct super_block *sb, | |||
2566 | discard_block = block + ext4_group_first_block_no(sb, block_group); | 2566 | discard_block = block + ext4_group_first_block_no(sb, block_group); |
2567 | trace_ext4_discard_blocks(sb, | 2567 | trace_ext4_discard_blocks(sb, |
2568 | (unsigned long long) discard_block, count); | 2568 | (unsigned long long) discard_block, count); |
2569 | ret = sb_issue_discard(sb, discard_block, count); | 2569 | ret = sb_issue_discard(sb, discard_block, count, GFP_NOFS, |
2570 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); | ||
2570 | if (ret == EOPNOTSUPP) { | 2571 | if (ret == EOPNOTSUPP) { |
2571 | ext4_warning(sb, "discard not supported, disabling"); | 2572 | ext4_warning(sb, "discard not supported, disabling"); |
2572 | clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD); | 2573 | clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD); |
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index 81184d3b75a3..3a56a82f5658 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c | |||
@@ -577,7 +577,9 @@ int fat_free_clusters(struct inode *inode, int cluster) | |||
577 | 577 | ||
578 | sb_issue_discard(sb, | 578 | sb_issue_discard(sb, |
579 | fat_clus_to_blknr(sbi, first_cl), | 579 | fat_clus_to_blknr(sbi, first_cl), |
580 | nr_clus * sbi->sec_per_clus); | 580 | nr_clus * sbi->sec_per_clus, |
581 | GFP_NOFS, | ||
582 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); | ||
581 | 583 | ||
582 | first_cl = cluster; | 584 | first_cl = cluster; |
583 | } | 585 | } |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8ef705f800ab..6b305eb4a343 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -881,13 +881,12 @@ extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector, | |||
881 | sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); | 881 | sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); |
882 | extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, | 882 | extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, |
883 | sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); | 883 | sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); |
884 | static inline int sb_issue_discard(struct super_block *sb, | 884 | static inline int sb_issue_discard(struct super_block *sb, sector_t block, |
885 | sector_t block, sector_t nr_blocks) | 885 | sector_t nr_blocks, gfp_t gfp_mask, unsigned long flags) |
886 | { | 886 | { |
887 | block <<= (sb->s_blocksize_bits - 9); | 887 | return blkdev_issue_discard(sb->s_bdev, block << (sb->s_blocksize_bits - 9), |
888 | nr_blocks <<= (sb->s_blocksize_bits - 9); | 888 | nr_blocks << (sb->s_blocksize_bits - 9), |
889 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_NOFS, | 889 | gfp_mask, flags); |
890 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); | ||
891 | } | 890 | } |
892 | 891 | ||
893 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | 892 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |