From: David Woodhouse <dwmw2@infradead.org>
To: Philipp Rumpf <prumpf@uzix.org>
Cc: Finn Hakansson <finn@axis.com>,
"Rogelio M. Serrano Jr." <rogelio@evoserve.com>,
"mtd@infradead.org" <mtd@infradead.org>,
jffs-dev@axis.com
Subject: Re: jffs_file_write
Date: Tue, 25 Jul 2000 16:12:11 +0100 [thread overview]
Message-ID: <6960.964537931@cygnus.co.uk> (raw)
In-Reply-To: <20000725072959.B15029@fruits.uzix.org>
prumpf@uzix.org said:
> I disagree with queueing nodes - just updating a "which byte ranges
> of the file have been modified" list should be both simpler and allow
> more efficient write merging/compression.
OK. As long as we're aware of the possibility that a certain byte range
could be changed _again_ in a different transaction.
i.e. pwrite(fd, "aaaaaaaaa", 10, 0);
pwrite(fd, "bbbbbbbbb", 10, 5);
If you're not going to take a copy of data in the first write, but just
keep it in the page cache and remember where it is, then you cannot write
that transaction unless you combine it with the second one.
That is - you _must_ combine the two into a single node write. It's not
just an optimisation. If you were to write "aaaaabbbbb" to the beginning of
the file and lose power before writing the rest of the 'bbbbb', I believe
you're violating POSIX by having non-atomic write().
So if you're going to write data to the flash directly from the page cache,
you have to have some lock in place which prevents anything else from
dirtying it during the mtd_write() call.
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
next prev parent reply other threads:[~2000-07-25 15:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-21 23:41 jffs_file_write Rogelio M. Serrano Jr.
2000-07-24 15:09 ` jffs_file_write Finn Hakansson
2000-07-25 9:29 ` jffs_file_write David Woodhouse
2000-07-25 9:44 ` jffs_file_write Finn Hakansson
2000-07-25 10:01 ` jffs_file_write David Woodhouse
2000-07-25 10:11 ` jffs_file_write Finn Hakansson
2000-07-25 13:02 ` jffs_file_write Bjorn Wesen
2000-07-25 13:19 ` jffs_file_write David Woodhouse
2000-07-25 13:54 ` jffs_file_write David Woodhouse
2000-07-25 10:02 ` jffs_file_write Bjorn Wesen
2000-07-25 10:15 ` jffs_file_write David Woodhouse
2000-07-25 14:29 ` jffs_file_write Philipp Rumpf
2000-07-25 15:12 ` David Woodhouse [this message]
2000-07-25 15:24 ` jffs_file_write Philipp Rumpf
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=6960.964537931@cygnus.co.uk \
--to=dwmw2@infradead.org \
--cc=finn@axis.com \
--cc=jffs-dev@axis.com \
--cc=mtd@infradead.org \
--cc=prumpf@uzix.org \
--cc=rogelio@evoserve.com \
/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