Re: kdev_t_to_struct_blockdevice?

From: Anton Altaparmakov (
Date: Fri May 03 2002 - 04:29:07 EST

At 09:14 03/05/02, Pavel Machek wrote:
>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,


>[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
>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
>More majordomo info at
>Please read the FAQ at

   "I've not lost my mind. It's backed up on tape somewhere." - Unknown
Anton Altaparmakov <aia21 at> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on
WWW: &

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue May 07 2002 - 22:00:19 EST