xfs: simplify xfs_aops_discard_page
authorChristoph Hellwig <hch@lst.de>
Thu, 12 Jul 2018 05:25:57 +0000 (22:25 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Jul 2018 05:25:57 +0000 (22:25 -0700)
commit036257213836e13f08d1b28e528ba99e4ed3fc68
tree68783ff79d5ff7bb9f8f234bd34a3a84840ac9d0
parent8b2e77c1634935aefc9a4e2aacadda9cd30b78d7
xfs: simplify xfs_aops_discard_page

Instead of looking at the buffer heads to see if a block is delalloc just
call xfs_bmap_punch_delalloc_range on the whole page - this will leave
any non-delalloc block intact and handle the iteration for us.  As a side
effect one more place stops caring about buffer heads and we can remove the
xfs_check_page_type function entirely.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_aops.c