mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
c20cfc27a4
commit
ee472d835c
8 changed files with 35 additions and 31 deletions
|
|
@ -2105,7 +2105,7 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start,
|
|||
case FALLOC_FL_ZERO_RANGE:
|
||||
case FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE:
|
||||
error = blkdev_issue_zeroout(bdev, start >> 9, len >> 9,
|
||||
GFP_KERNEL, false);
|
||||
GFP_KERNEL, BLKDEV_ZERO_NOUNMAP);
|
||||
break;
|
||||
case FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE:
|
||||
/* Only punch if the device can do zeroing discard. */
|
||||
|
|
|
|||
2
fs/dax.c
2
fs/dax.c
|
|
@ -982,7 +982,7 @@ int __dax_zero_page_range(struct block_device *bdev, sector_t sector,
|
|||
sector_t start_sector = dax.sector + (offset >> 9);
|
||||
|
||||
return blkdev_issue_zeroout(bdev, start_sector,
|
||||
length >> 9, GFP_NOFS, true);
|
||||
length >> 9, GFP_NOFS, 0);
|
||||
} else {
|
||||
if (dax_map_atomic(bdev, &dax) < 0)
|
||||
return PTR_ERR(dax.addr);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ xfs_zero_extent(
|
|||
return blkdev_issue_zeroout(xfs_find_bdev_for_inode(VFS_I(ip)),
|
||||
block << (mp->m_super->s_blocksize_bits - 9),
|
||||
count_fsb << (mp->m_super->s_blocksize_bits - 9),
|
||||
GFP_NOFS, true);
|
||||
GFP_NOFS, 0);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Reference in a new issue