All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to open and write to a block driver within a character driver?
Date: Thu, 6 Oct 2011 20:09:26 -0700	[thread overview]
Message-ID: <20111007030926.GB25556@kroah.com> (raw)
In-Reply-To: <SNT143-W33F6DC519B4D17A8ABDF17CEF90@phx.gbl>

On Thu, Oct 06, 2011 at 03:43:08PM -0700, Yang Xiang wrote:
> Hi Greg,
> 
> Let me rephrase my question then.
> 
> If I am in kernel space and in another device driver and I need to write a log
> entry of some sort to another block device, do I just perform an "open" and
> "write" as if I am in user space?

No, you never do that, no device driver ever opens a file and writes to
it.  It's that simple.

Please see the kernelnewbies.org site for more details about why this is
so.

greg k-h

      parent reply	other threads:[~2011-10-07  3:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 17:42 How to open and write to a block driver within a character driver? Yang Xiang
2011-10-04 17:46 ` Greg KH
2011-10-04 17:52   ` Yang Xiang
2011-10-04 18:04     ` Greg KH
2011-10-06 22:43       ` Yang Xiang
2011-10-06 23:03         ` Greg Freemyer
2011-10-07  3:09         ` Greg KH [this message]

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=20111007030926.GB25556@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.