All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Katz <katzj@redhat.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>
Subject: Re: [PATCH] remove use of get_gendisk in blkfront
Date: Tue, 08 Nov 2005 22:53:42 -0500	[thread overview]
Message-ID: <1131508423.3533.41.camel@bree.local.net> (raw)
In-Reply-To: <43180D2D.8000503@intel.com>

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

On Fri, 2005-09-02 at 16:28 +0800, Xiaofeng Ling wrote:
> 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>

This looks correct to me and helps in building blkfront as a module.
Any chance of getting it committed?  I've gone ahead and rediffed
against the current tip and cleaned up the warnings.  Attached here.

Signed-off-by: Jeremy Katz <katzj@redhat.com>

Jeremy

[-- Attachment #2: xen-get-gendisk.patch --]
[-- Type: text/x-patch, Size: 1704 bytes --]

diff -r abbe3df33774 linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Nov  8 17:39:58 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Tue Nov  8 22:49:53 2005
@@ -641,6 +641,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 abbe3df33774 linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Tue Nov  8 17:39:58 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Tue Nov  8 22:49:53 2005
@@ -116,6 +116,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 abbe3df33774 linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Tue Nov  8 17:39:58 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Tue Nov  8 22:49:53 2005
@@ -259,6 +259,7 @@
 		gd->flags |= GENHD_FL_CD;
 
 	add_disk(gd);
+	info->gd = gd;
 
 	return 0;
 
@@ -292,22 +293,19 @@
 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)
 		return;
 
-	gd = get_gendisk(info->dev, &unused);
-	rq = gd->queue;
-
-	del_gendisk(gd);
-	put_disk(gd);
+	if (info->gd == NULL)
+		return;
+
+	del_gendisk(info->gd);
+	put_disk(info->gd);
 	xlbd_put_major_info(info->mi);
 	info->mi = NULL;
-	blk_cleanup_queue(rq);
+	blk_cleanup_queue(info->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-11-09  3:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02  8:28 [PATCH] remove use of get_gendisk in blkfront Xiaofeng Ling
2005-11-09  3:53 ` Jeremy Katz [this message]
  -- 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=1131508423.3533.41.camel@bree.local.net \
    --to=katzj@redhat.com \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --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.