]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Btrfs: [PATCH] extent_map: make the writepage_io hook optional
authorChristoph Hellwig <hch@lst.de>
Tue, 11 Sep 2007 00:02:32 +0000 (20:02 -0400)
committerDavid Woodhouse <dwmw2@hera.kernel.org>
Tue, 11 Sep 2007 00:02:32 +0000 (20:02 -0400)
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>
fs/btrfs/extent_map.c

index ff2b1dd25bf92ff0398bbdb810217de45d42867a..162766773a32c0376d99b0c1b60f138271db6095 100644 (file)
@@ -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 {