mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Alexander Viro <viro@math.psu.edu>
Cc: Andrew Morton <akpm@zip.com.au>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Reading page from given block device
Date: Thu, 9 May 2002 23:36:24 +0200	[thread overview]
Message-ID: <20020509213624.GF1988@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20020508225603.GA11842@atrey.karlin.mff.cuni.cz> <Pine.GSO.4.21.0205090039060.12789-100000@weyl.math.psu.edu>

Hi!

> > Well, I'm doing it during boot, and this is swap partition; it should
> > not have been accessed previously.
> > 
> > > >         bdev = bdget(kdev_t_to_nr(dev));
> > > >         if (!bdev) {
> > > >                 printk("No block device for %s\n", __bdevname(dev));
> > > >                 BUG();
> > > >         }
> > > >         printk("C");
> 
> blkdev_open(bdev, FMODE_READ, O_RDONLY, BDEV_RAW)

blkdev_open is 

fs.h:extern int blkdev_open(struct inode *, struct file *);

... I can't see how to use it in this context.

> > > >         if (!bh || (!bh->b_data)) {
> > > >                 return -1;
> 
> However, I would really suggest to open the bugger once, do all IO and
> then close it.  See how raw.c and friends deal with these problems.

Performance should not matter here.
								Pavel

-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.

  reply	other threads:[~2002-05-09 21:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-08 20:48 Pavel Machek
2002-05-08 21:21 ` Andrew Morton
2002-05-08 21:30   ` Andrew Morton
2002-05-08 22:56   ` Pavel Machek
     [not found]     ` <3CD9AE15.114D13E3@zip.com.au>
2002-05-08 23:15       ` Pavel Machek
2002-05-09  0:07         ` Andrew Morton
2002-05-09  4:42     ` Alexander Viro
2002-05-09 21:36       ` Pavel Machek [this message]
2002-05-09 21:45         ` Alexander Viro
2002-05-08 22:59   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020509213624.GF1988@atrey.karlin.mff.cuni.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®