[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] gnbd kernel build against 2.6.24-git



Hi guys,

please review and queue for when we are ready to bump our kernel depends on
2.6.24-rc1.

Thanks
Fabio
diff --git a/gnbd-kernel/src/gnbd.c b/gnbd-kernel/src/gnbd.c
index 7f4a861..1be2eee 100644
--- a/gnbd-kernel/src/gnbd.c
+++ b/gnbd-kernel/src/gnbd.c
@@ -168,7 +168,7 @@ static ssize_t store_sectors(struct class_device *class_dev,
 	
 	if (down_trylock(&dev->do_it_lock))
 		return -EBUSY;
-	res = sscanf(buf, "%Lu\n", &size);
+	res = sscanf(buf, "%Lu\n", (unsigned long long int *)&size);
 	if (res != 1){
 		up(&dev->do_it_lock);
 		return -EINVAL;
@@ -267,7 +267,7 @@ static const char *gnbdcmd_to_ascii(int cmd)
 static void gnbd_end_request(struct request *req)
 {
 	int uptodate = (req->errors == 0) ? 1 : 0;
-	request_queue_t *q = req->q;
+	struct request_queue *q = req->q;
 	unsigned long flags;
 
 	dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name,
@@ -369,7 +369,7 @@ __gnbd_send_req((dev), (dev)->sock, (req), (can_sig))
 int __gnbd_send_req(struct gnbd_device *dev, struct socket *sock,
 		struct request *req, int can_signal)
 {
-	int result, i, flags;
+	int result, flags;
 	struct gnbd_request request;
 	unsigned long size = req->nr_sectors << 9;
 
@@ -403,28 +403,26 @@ int __gnbd_send_req(struct gnbd_device *dev, struct socket *sock,
 	}
 
 	if (gnbd_cmd(req) == GNBD_CMD_WRITE) {
-		struct bio *bio;
+		struct req_iterator iter;
+		struct bio_vec *bvec;
 		/*
 		 * we are really probing at internals to determine
 		 * whether to set MSG_MORE or not...
 		 */
-		rq_for_each_bio(bio, req) {
-			struct bio_vec *bvec;
-			bio_for_each_segment(bvec, bio, i) {
-				flags = 0;
-				if ((i < (bio->bi_vcnt - 1)) || bio->bi_next)
-					flags = MSG_MORE;
-				dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n",
-						dev->disk->disk_name, req,
-						bvec->bv_len);
-				result = sock_send_bvec(sock, bvec, flags,
-							can_signal);
-				if (result < 0) {
-					printk(KERN_ERR "%s: Send data failed (result %d)\n",
-							dev->disk->disk_name,
-							result);
-					goto error_out;
-				}
+		rq_for_each_segment(bvec, req, iter) {
+			flags = 0;
+			if (!rq_iter_last(req, iter))
+				flags = MSG_MORE;
+			dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n",
+					dev->disk->disk_name, req,
+					bvec->bv_len);
+			result = sock_send_bvec(sock, bvec, flags,
+						can_signal);
+			if (result < 0) {
+				printk(KERN_ERR "%s: Send data failed (result %d)\n",
+						dev->disk->disk_name,
+						result);
+				goto error_out;
 			}
 		}
 	}
@@ -464,21 +462,19 @@ static inline int sock_recv_bvec(struct socket *sock, struct bio_vec *bvec)
 int gnbd_recv_req(struct gnbd_device *dev, struct request *req)
 {
 	int result;
-	int i;
-	struct bio *bio;
-	rq_for_each_bio(bio, req) {
-		struct bio_vec *bvec;
-		bio_for_each_segment(bvec, bio, i) {
-			result = sock_recv_bvec(dev->sock, bvec);
-			if (result < 0) {
-				printk(KERN_ERR "%s: Receive data failed (result %d)\n",
-						dev->disk->disk_name,
-						result);
-				return result;
-			}
-			dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
-					dev->disk->disk_name, req, bvec->bv_len);
+	struct bio_vec *bvec;
+	struct req_iterator iter;
+
+	rq_for_each_segment(bvec, req, iter) {
+		result = sock_recv_bvec(dev->sock, bvec);
+		if (result < 0) {
+			printk(KERN_ERR "%s: Receive data failed (result %d)\n",
+					dev->disk->disk_name,
+					result);
+			return result;
 		}
+		dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
+				dev->disk->disk_name, req, bvec->bv_len);
 	}
 	return 0;
 }
@@ -565,7 +561,7 @@ void gnbd_clear_que(struct gnbd_device *dev)
  *   { printk( "Warning: Ignoring result!\n"); gnbd_end_request( req ); }
  */
 
-static void do_gnbd_request(request_queue_t * q)
+static void do_gnbd_request(struct request_queue *q)
 {
 	int err;
 	struct request *req;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]