From: "bmoon" <bo@anthologysolutions.com>
To: linux-raid@vger.kernel.org
Subject: How do we handle the same but uptodated data to disk cache?
Date: Mon, 26 May 2003 19:41:06 -0700 [thread overview]
Message-ID: <004301c323f9$71916a10$6b01a8c0@bmoon> (raw)
In-Reply-To: Pine.LNX.4.44.0305261738440.19678-100000@q7.q7.com
Hello,
I want to write the data to the fixed sector with the same size frequently
just like MD super block, but I do not want to sync and flush the dev
on each write.
For example, to write md super block in /drivers/md/md.c
we do
fsync_dev(dev);
bh=getblk(dev, block, size);
mark_buffer_uptodate(bh,1);
mark_buffer_dirty(bh);
ll_rw_block(WRITE,1, &bh);
wait_on_buffer(bh);
brelse(bh);
fsync_dev(dev);
Instead, Can I do as follow
bh=getblk(dev, block, size);
if (buffer_uptodate(bh)) { /* still in cache, not flushed yet */
bh->b_data = new SB data;
brelse(bh);
}
else { /* it must be flushed */
same as in above
}
Please provide me your openion or suggestions.
Thanks in advance,
Bo
next prev parent reply other threads:[~2003-05-27 2:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-26 23:59 What is the logic behind 'Device or resource busy' ? Jure Pecar
2003-05-27 0:39 ` Joe Pruett
2003-05-27 2:41 ` bmoon [this message]
2003-05-27 2:47 ` How do we handle the same but uptodated data to disk cache? Neil Brown
2003-05-27 20:47 ` bmoon
2003-05-28 20:29 ` bmoon
2003-05-30 4:07 ` Neil Brown
2003-05-27 2:56 ` What is the logic behind 'Device or resource busy' ? Jure Pecar
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='004301c323f9$71916a10$6b01a8c0@bmoon' \
--to=bo@anthologysolutions.com \
--cc=linux-raid@vger.kernel.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