From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Wait for an IO to complete
Date: Fri, 28 Mar 2014 11:01:38 -0700 [thread overview]
Message-ID: <20140328180138.GA29170@kroah.com> (raw)
In-Reply-To: <CADDndfOTsiuJV4-TQH8op4mfyvib-RtXeU4PFOy5AD=icAnS6Q@mail.gmail.com>
On Fri, Mar 28, 2014 at 11:16:30PM +0530, Rishi Agrawal wrote:
> Hi All,
>
> I want to wait in my code till the IO actually goes to the disk.
That's an issue, as you really don't know what a "disk" is from within
the kernel :)
Back up, what exactly are you trying to do?
> For example
>
> struct buffer_head *bh=sb_bread(sb, 20)
>
> strcpy(bh->b_data, "Some Data");
>
> /* mark and sync */
> mark_buffer_dirty(bh);
> sync_dirty_buffer(bh);
>
> The above code only adds the bh to the request queue and returns.
And that's all you should need. Why do you feel you need more?
thanks,
greg k-h
next prev parent reply other threads:[~2014-03-28 18:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 17:46 Wait for an IO to complete Rishi Agrawal
2014-03-28 18:01 ` Greg KH [this message]
2014-03-29 10:07 ` Rishi Agrawal
2014-03-29 12:47 ` Sankar P
2014-03-30 16:29 ` Valdis.Kletnieks at vt.edu
2014-04-01 17:04 ` Rishi Agrawal
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=20140328180138.GA29170@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).