lkml.org 
[lkml]   [2002]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kdev_t_to_struct_blockdevice?
At 09:14 03/05/02, Pavel Machek wrote:
>Hi!
>
>How do I do (above)?

include/linux/fs.h declares:

extern struct block_device *bdget(dev_t).

(you of course need to bdput(struct block_device *) when finished with it)

Along the way you may also need include/linux/kdev_t.h defining:

static inline int kdev_t_to_nr(kdev_t dev)
{
return MKDEV(major(dev), minor(dev));
}

static inline kdev_t to_kdev_t(int dev)
{
return mk_kdev(MAJOR(dev),MINOR(dev));
}

Hope this helps.

Best regards,

Anton


>[I really need it for resume; user pases resume=hda3 on command line
>and I need to access that device...]
> Pavel
>--
>(about SSSCA) "I don't say this lightly. However, I really think that the
>U.S.
>no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/

--
"I've not lost my mind. It's backed up on tape somewhere." - Unknown
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.035 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site