mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
dax: use sb_issue_zerout instead of calling dax_clear_sectors
dax_clear_sectors() cannot handle poisoned blocks. These must be zeroed using the BIO interface instead. Convert ext2 and XFS to use only sb_issue_zerout(). Reviewed-by: Jeff Moyer <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Matthew Wilcox <[email protected]> [vishal: Also remove the dax_clear_sectors function entirely] Signed-off-by: Vishal Verma <[email protected]>
This commit is contained in:
parent
0a70bd4305
commit
3dc2916107
4 changed files with 8 additions and 48 deletions
32
fs/dax.c
32
fs/dax.c
|
|
@ -87,38 +87,6 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n)
|
|||
return page;
|
||||
}
|
||||
|
||||
/*
|
||||
* dax_clear_sectors() is called from within transaction context from XFS,
|
||||
* and hence this means the stack from this point must follow GFP_NOFS
|
||||
* semantics for all operations.
|
||||
*/
|
||||
int dax_clear_sectors(struct block_device *bdev, sector_t _sector, long _size)
|
||||
{
|
||||
struct blk_dax_ctl dax = {
|
||||
.sector = _sector,
|
||||
.size = _size,
|
||||
};
|
||||
|
||||
might_sleep();
|
||||
do {
|
||||
long count, sz;
|
||||
|
||||
count = dax_map_atomic(bdev, &dax);
|
||||
if (count < 0)
|
||||
return count;
|
||||
sz = min_t(long, count, SZ_128K);
|
||||
clear_pmem(dax.addr, sz);
|
||||
dax.size -= sz;
|
||||
dax.sector += sz / 512;
|
||||
dax_unmap_atomic(bdev, &dax);
|
||||
cond_resched();
|
||||
} while (dax.size);
|
||||
|
||||
wmb_pmem();
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dax_clear_sectors);
|
||||
|
||||
static bool buffer_written(struct buffer_head *bh)
|
||||
{
|
||||
return buffer_mapped(bh) && !buffer_unwritten(bh);
|
||||
|
|
|
|||
Loading…
Reference in a new issue