Christoph Hellwig
2007-Sep-02 08:02 UTC
[Btrfs-devel] [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: Christoph Hellwig <hch@lst.de> Index: btrfs-9cb5f0f5c713/extent_map.c ==================================================================--- btrfs-9cb5f0f5c713.orig/extent_map.c 2007-09-02 02:24:10.000000000 +0200 +++ btrfs-9cb5f0f5c713/extent_map.c 2007-09-02 02:25:19.000000000 +0200 @@ -1603,7 +1603,12 @@ int extent_write_full_page(struct extent 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 {