Skip to contentSkip to conversation

fs: btrfs: Shuffle preprocessor macros

PATCH New Sankar P 1 participant 1 message Dec 2, 2010 Btrfs file system

lore
Share & tools
lore

Sankar P

author
#0 lore raw

PATCH 1/1 fs: btrfs: Shuffle preprocessor macros

The function btree_migratepage will be extended from the baseclass only when CONFIG_MIGRATION option is enabled. So, it's useful to define/build this function only when that config option is enabled.

Fixes an "unused function" compiler warning when CONFIG_MIGRATION is not enabled and also removes an return -ENOSYS statement, whose scenario will not happen.

---
 fs/btrfs/disk-io.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
fs/btrfs/disk-io.c +2 -4
index c547cca..7199239 100644
@@ -696,6 +696,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
 				   __btree_submit_bio_done);
 }
 
+#ifdef CONFIG_MIGRATION
 static int btree_migratepage(struct address_space *mapping,
 			struct page *newpage, struct page *page)
 {
@@ -712,12 +713,9 @@ static int btree_migratepage(struct address_space *mapping,
 	if (page_has_private(page) &&
 	    !try_to_release_page(page, GFP_KERNEL))
 		return -EAGAIN;
-#ifdef CONFIG_MIGRATION
 	return migrate_page(mapping, newpage, page);
-#else
-	return -ENOSYS;
-#endif
 }
+#endif
 
 static int btree_writepage(struct page *page, struct writeback_control *wbc)
 {
Signature · 1 line
1.7.1