public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kdev_t_to_struct_blockdevice?
@ 2002-05-03  8:14 Pavel Machek
  2002-05-03  9:29 ` kdev_t_to_struct_blockdevice? Anton Altaparmakov
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2002-05-03  8:14 UTC (permalink / raw)
  To: kernel list

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
-- 
(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

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

* Re: kdev_t_to_struct_blockdevice?
  2002-05-03  8:14 kdev_t_to_struct_blockdevice? Pavel Machek
@ 2002-05-03  9:29 ` Anton Altaparmakov
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Altaparmakov @ 2002-05-03  9:29 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list

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/


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

end of thread, other threads:[~2002-05-03  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-03  8:14 kdev_t_to_struct_blockdevice? Pavel Machek
2002-05-03  9:29 ` kdev_t_to_struct_blockdevice? Anton Altaparmakov

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