summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_map.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-09-10 20:02:32 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-09-10 20:02:32 -0400
commitb06355f0fe04a62d08238438654ec453e05304ba (patch)
tree03256315e789dc21d2721fb5484ef50b199c9b17 /fs/btrfs/extent_map.c
parentd396c6f554d182b7bce4e2bb2acb47f80430c05f (diff)
downloadlinux-stable-b06355f0fe04a62d08238438654ec453e05304ba.tar.gz
linux-stable-b06355f0fe04a62d08238438654ec453e05304ba.tar.bz2
linux-stable-b06355f0fe04a62d08238438654ec453e05304ba.zip
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: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r--fs/btrfs/extent_map.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index ff2b1dd25bf9..162766773a32 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -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 {