Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2015 23:31:03 +0000
From:      Raviprakash Darbha <rdarbha@juniper.net>
To:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Cc:        Steve Kiernan <stevek@juniper.net>, Simon Gerraty <sjg@juniper.net>
Subject:   getting a disk structure given a device name
Message-ID:  <F8ED1BDC-D8DA-458B-A652-B125183F27CB@juniper.net>

next in thread | raw e-mail | index | archive | help
Hello All=20

I am trying to write a filter driver for the ata block on freebsd 6.2 to si=
mulate failed reads and writes. For this i would like to know if there is a=
 call to convert a given device path (ex /dev/ad0)  to a disk structure (ad=
p->disk) which has the strategy function so that i could modify that and po=
int it to my filter.=20
There is a similar function in linux kernel blk_get_by_path and would like =
to know if there is something similar on freebsd too.
The other option is to write  a function to traverse through the list of de=
vs and return the disk which has the disk->d_name as the given device path.=
This is a bit laborious but not sure if thats the only option.=20

Any help is appreciated.=20

Thanks
Ravi=20
 =



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F8ED1BDC-D8DA-458B-A652-B125183F27CB>