writeback: fix problem with !CONFIG_BLOCK compilation
authorJens Axboe <jens.axboe@oracle.com>
Thu, 20 May 2010 07:18:47 +0000 (09:18 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 21 May 2010 18:01:03 +0000 (20:01 +0200)
When CONFIG_BLOCK isn't enabled:

mm/page-writeback.c: In function 'laptop_mode_timer_fn':
mm/page-writeback.c:708: error: dereferencing pointer to incomplete type
mm/page-writeback.c:709: error: dereferencing pointer to incomplete type

Fix this by essentially eliminating the laptop sync handlers when
CONFIG_BLOCK isn't set, as most are only used from the block layer code.
The exception is laptop_sync_completion() which is used from sys_sync(),
make that an empty declaration in that case.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/super.c
include/linux/writeback.h
mm/page-writeback.c

index dc72491a19f9cde0a388499faf8453f383b5b6e5..1527e6a0ee358d084a29f542816a91c4418f5ef6 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/kobject.h>
 #include <linux/mutex.h>
 #include <linux/file.h>
+#include <linux/backing-dev.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
index 47e1c686cb020ad8c39cd92ac718a6df1572d2d9..cc97d6caf2b32af24505ebbc73d7f98265efbde1 100644 (file)
@@ -106,10 +106,14 @@ static inline void inode_sync_wait(struct inode *inode)
 /*
  * mm/page-writeback.c
  */
+#ifdef CONFIG_BLOCK
 void laptop_io_completion(struct backing_dev_info *info);
 void laptop_sync_completion(void);
 void laptop_mode_sync(struct work_struct *work);
 void laptop_mode_timer_fn(unsigned long data);
+#else
+static inline void laptop_sync_completion(void) { }
+#endif
 void throttle_vm_writeout(gfp_t gfp_mask);
 
 /* These are exported to sysctl. */
index 0d7bbe859550786970845fc55f7700c385386539..9886424e18649cfd054fb8097b0c44db9a380c8c 100644 (file)
@@ -694,6 +694,7 @@ int dirty_writeback_centisecs_handler(ctl_table *table, int write,
        return 0;
 }
 
+#ifdef CONFIG_BLOCK
 void laptop_mode_timer_fn(unsigned long data)
 {
        struct request_queue *q = (struct request_queue *)data;
@@ -735,6 +736,7 @@ void laptop_sync_completion(void)
 
        rcu_read_unlock();
 }
+#endif
 
 /*
  * If ratelimit_pages is too high then we can get into dirty-data overload