diff options
author | Christoph Hellwig <hch@lst.de> | 2017-04-05 13:21:08 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-08 13:25:38 -0400 |
commit | ee472d835c264a4cb77f8cf878603e1e40f3559e (patch) | |
tree | 923d051ac77e50e2871eefc7c6f7da43da3538c9 /fs | |
parent | c20cfc27a47307e811346f85959cf3cc07ae42f9 (diff) |
block: add a flags argument to (__)blkdev_issue_zeroout
Turn the existing discard flag into a new BLKDEV_ZERO_UNMAP flag with
similar semantics, but without referring to diѕcard.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 2 | ||||
-rw-r--r-- | fs/dax.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_bmap_util.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index f2d59f143ef4..2f704c3a816f 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -2105,7 +2105,7 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start, | |||
2105 | case FALLOC_FL_ZERO_RANGE: | 2105 | case FALLOC_FL_ZERO_RANGE: |
2106 | case FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE: | 2106 | case FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE: |
2107 | error = blkdev_issue_zeroout(bdev, start >> 9, len >> 9, | 2107 | error = blkdev_issue_zeroout(bdev, start >> 9, len >> 9, |
2108 | GFP_KERNEL, false); | 2108 | GFP_KERNEL, BLKDEV_ZERO_NOUNMAP); |
2109 | break; | 2109 | break; |
2110 | case FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE: | 2110 | case FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE: |
2111 | /* Only punch if the device can do zeroing discard. */ | 2111 | /* Only punch if the device can do zeroing discard. */ |
@@ -982,7 +982,7 @@ int __dax_zero_page_range(struct block_device *bdev, sector_t sector, | |||
982 | sector_t start_sector = dax.sector + (offset >> 9); | 982 | sector_t start_sector = dax.sector + (offset >> 9); |
983 | 983 | ||
984 | return blkdev_issue_zeroout(bdev, start_sector, | 984 | return blkdev_issue_zeroout(bdev, start_sector, |
985 | length >> 9, GFP_NOFS, true); | 985 | length >> 9, GFP_NOFS, 0); |
986 | } else { | 986 | } else { |
987 | if (dax_map_atomic(bdev, &dax) < 0) | 987 | if (dax_map_atomic(bdev, &dax) < 0) |
988 | return PTR_ERR(dax.addr); | 988 | return PTR_ERR(dax.addr); |
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 8b75dcea5966..142bbbe06114 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c | |||
@@ -81,7 +81,7 @@ xfs_zero_extent( | |||
81 | return blkdev_issue_zeroout(xfs_find_bdev_for_inode(VFS_I(ip)), | 81 | return blkdev_issue_zeroout(xfs_find_bdev_for_inode(VFS_I(ip)), |
82 | block << (mp->m_super->s_blocksize_bits - 9), | 82 | block << (mp->m_super->s_blocksize_bits - 9), |
83 | count_fsb << (mp->m_super->s_blocksize_bits - 9), | 83 | count_fsb << (mp->m_super->s_blocksize_bits - 9), |
84 | GFP_NOFS, true); | 84 | GFP_NOFS, 0); |
85 | } | 85 | } |
86 | 86 | ||
87 | int | 87 | int |