提交 b06355f0 编写于 作者: C Christoph Hellwig 提交者: David Woodhouse

Btrfs: [PATCH] extent_map: make the writepage_io hook optional

The writepage_io is not mandatory, e.g. my port of xfs to the extent_map
code does not have one for now.  So handle a NULL pointer gracefully
here.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 d396c6f5
......@@ -1607,7 +1607,12 @@ int extent_write_full_page(struct extent_map_tree *tree, struct page *page,
continue;
}
clear_extent_dirty(tree, cur, cur + iosize - 1, GFP_NOFS);
ret = tree->ops->writepage_io_hook(page, cur, cur + iosize - 1);
if (tree->ops && tree->ops->writepage_io_hook) {
ret = tree->ops->writepage_io_hook(page, cur,
cur + iosize - 1);
} else {
ret = 0;
}
if (ret)
SetPageError(page);
else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册