From 31641a8d86d6917d7ffe0eab3b5f91b5e52aa22d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 12 Aug 2006 19:01:02 +0200 Subject: [GCC4] fix build error in drivers/block/nbd.c This patch fixes this error with gcc 4 : nbd.c:73: error: static declaration of 'requests_in' follows non-static declaration /usr/src/git/linux-2.4/include/linux/nbd.h:33: error: previous declaration of 'requests_in' was here nbd.c:74: error: static declaration of 'requests_out' follows non-static declaration /usr/src/git/linux-2.4/include/linux/nbd.h:34: error: previous declaration of 'requests_out' was here --- drivers/block/nbd.c | 23 +++++++++++++++++++++++ include/linux/nbd.h | 28 ---------------------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 21f1d03..c79ba85 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -74,6 +74,29 @@ static int requests_in; static int requests_out; #endif +static void +nbd_end_request(struct request *req) +{ + struct buffer_head *bh; + unsigned nsect; + unsigned long flags; + int uptodate = (req->errors == 0) ? 1 : 0; + +#ifdef PARANOIA + requests_out++; +#endif + spin_lock_irqsave(&io_request_lock, flags); + while((bh = req->bh) != NULL) { + nsect = bh->b_size >> 9; + blk_finished_io(nsect); + req->bh = bh->b_reqnext; + bh->b_reqnext = NULL; + bh->b_end_io(bh, uptodate); + } + blkdev_release_request(req); + spin_unlock_irqrestore(&io_request_lock, flags); +} + static int nbd_open(struct inode *inode, struct file *file) { int dev; diff --git a/include/linux/nbd.h b/include/linux/nbd.h index bf276f3..c24f302 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -29,34 +29,6 @@ #define LOCAL_END_REQUEST #include -#ifdef PARANOIA -extern int requests_in; -extern int requests_out; -#endif - -static void -nbd_end_request(struct request *req) -{ - struct buffer_head *bh; - unsigned nsect; - unsigned long flags; - int uptodate = (req->errors == 0) ? 1 : 0; - -#ifdef PARANOIA - requests_out++; -#endif - spin_lock_irqsave(&io_request_lock, flags); - while((bh = req->bh) != NULL) { - nsect = bh->b_size >> 9; - blk_finished_io(nsect); - req->bh = bh->b_reqnext; - bh->b_reqnext = NULL; - bh->b_end_io(bh, uptodate); - } - blkdev_release_request(req); - spin_unlock_irqrestore(&io_request_lock, flags); -} - #define MAX_NBD 128 struct nbd_device { -- 1.4.2