linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: btrfs: Shuffle preprocessor macros
@ 2010-12-02 16:19 Sankar P
  0 siblings, 0 replies; only message in thread
From: Sankar P @ 2010-12-02 16:19 UTC (permalink / raw)
  To: Chris Mason, linux-btrfs, linux-kernel; +Cc: Sankar P

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.

Signed-off-by: Sankar P <sankar.curiosity@gmail.com>
---
 fs/btrfs/disk-io.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c547cca..7199239 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -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)
 {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-02 16:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-02 16:19 [PATCH] fs: btrfs: Shuffle preprocessor macros Sankar P

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).