All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaofeng Ling <xiaofeng.ling@intel.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] remove use of get_gendisk in blkfront
Date: Fri, 02 Sep 2005 16:28:29 +0800	[thread overview]
Message-ID: <43180D2D.8000503@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

remove use of get_gendisk in blkfront
gen_gendisk is no long exported by 2.6 kernel. this patch remove the 
call of get_gendisk by saving the gd point in blkfront_info in vbd.c so 
that blkfront can be built as kerenl module.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>


[-- Attachment #2: get_gendisk.patch --]
[-- Type: text/x-patch, Size: 1485 bytes --]

diff -r 864434653dab linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
@@ -660,6 +651,7 @@
 	info->vdevice = vdevice;
 	info->connected = BLKIF_STATE_DISCONNECTED;
 	info->mi = NULL;
+ 	info->gd = NULL;
 	INIT_WORK(&info->work, blkif_restart_queue, (void *)info);
 
 	info->shadow_free = 0;
diff -r 864434653dab linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
@@ -115,6 +115,7 @@
 	/* We watch the backend */
 	struct xenbus_watch watch;
 	dev_t dev;
+ 	struct gendisk *gd;
 	int vdevice;
 	blkif_vdev_t handle;
 	int connected;
diff -r 864434653dab linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
@@ -266,6 +257,7 @@
 		gd->flags |= GENHD_FL_CD;
 
 	add_disk(gd);
+	info->gd = gd;
 
 	return 0;
 
@@ -298,23 +290,19 @@
 void
 xlvbd_del(struct blkfront_info *info)
 {
-	struct block_device *bd;
 	struct gendisk *gd;
 	int unused;
 	request_queue_t *rq;
 
-	bd = bdget(info->dev);
-	if (bd == NULL)
+	gd = info->gd;
+	if (gd == NULL)
 		return;
 
-	gd = get_gendisk(info->dev, &unused);
 	rq = gd->queue;
-
 	del_gendisk(gd);
 	put_disk(gd);
 	xlbd_put_major_info(info->mi);
 	info->mi = NULL;
 	blk_cleanup_queue(rq);
 
-	bdput(bd);
-}
+}

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2005-09-02  8:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02  8:28 Xiaofeng Ling [this message]
2005-11-09  3:53 ` [PATCH] remove use of get_gendisk in blkfront Jeremy Katz
  -- strict thread matches above, loose matches on Subject: below --
2005-11-09 10:48 Ian Pratt
2005-11-09 13:59 ` Josh Boyer
2005-11-10  1:20 Ling, Xiaofeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43180D2D.8000503@intel.com \
    --to=xiaofeng.ling@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.