public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* rescan_partitions() in SCSI disk driver
@ 2006-07-13  3:27 Kokachev Oleksiy
  2006-07-13 11:06 ` Erik Mouw
  0 siblings, 1 reply; 2+ messages in thread
From: Kokachev Oleksiy @ 2006-07-13  3:27 UTC (permalink / raw)
  To: linux-scsi

Dear all.
I'm trying to make some modifications to SCSI driver to correctly sync
/proc/partitions when new disk is inserted.
To revalidate disk I used sd_revalidate_disk(), but this function revalidate
only disk info, but do not rescan partition table. How can I tell the driver
to correctly rescan part/ table? I've tried to use rescan_partitions()
function like below, but failed:
	struct scsi_disk *sdkp;
      bdev = bdget_disk(sdkp->disk, 0);
	rescan_partitions(sdkp->disk, bdev);
But in this case bdev->bd_disk is NULL. Why? What did I do not correct?
Thank for help.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rescan_partitions() in SCSI disk driver
  2006-07-13  3:27 rescan_partitions() in SCSI disk driver Kokachev Oleksiy
@ 2006-07-13 11:06 ` Erik Mouw
  0 siblings, 0 replies; 2+ messages in thread
From: Erik Mouw @ 2006-07-13 11:06 UTC (permalink / raw)
  To: Kokachev Oleksiy; +Cc: linux-scsi

On Thu, Jul 13, 2006 at 12:27:51PM +0900, Kokachev Oleksiy wrote:
> I'm trying to make some modifications to SCSI driver to correctly sync
> /proc/partitions when new disk is inserted.
> To revalidate disk I used sd_revalidate_disk(), but this function revalidate
> only disk info, but do not rescan partition table. How can I tell the driver
> to correctly rescan part/ table? I've tried to use rescan_partitions()
> function like below, but failed:
> 	struct scsi_disk *sdkp;
>       bdev = bdget_disk(sdkp->disk, 0);
> 	rescan_partitions(sdkp->disk, bdev);
> But in this case bdev->bd_disk is NULL. Why? What did I do not correct?

Can be done from userland: blockdev --rereadpt /dev/whatever .


Erik

-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-13 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-13  3:27 rescan_partitions() in SCSI disk driver Kokachev Oleksiy
2006-07-13 11:06 ` Erik Mouw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox