Skip to content

Commit

Permalink
Btrfs: [PATCH] extent_map: make the writepage_io hook optional
Browse files Browse the repository at this point in the history
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Christoph Hellwig authored and David Woodhouse committed Sep 11, 2007
1 parent d396c6f commit b06355f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/btrfs/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b06355f

Please sign in to comment.