Skip to contentSkip to conversation

kdev_t_to_struct_blockdevice?

DISCUSSION Pavel Machek 2 participants 2 messages May 3, 2002

lore
Share & tools
lore
#0 lore raw

Hi!

How do I do (above)?

[I really need it for resume; user pases resume=hda3 on command line and I need to access that device...]
Pavel

Signature · 2 lines
(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
#1 lore raw
Quoted 3 lines · Pavel Machek

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

Quoted 11 lines

[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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 5 lines
  "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/