From: "ye janboe" <janboe.ye@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: dwmw2@infradead.org, jffs-dev@axis.com
Subject: jffs2 statfs issue
Date: Thu, 19 Jul 2007 18:01:52 +0800 [thread overview]
Message-ID: <af3ea28a0707190301l5d8a801aj260a259a08360de1@mail.gmail.com> (raw)
jffs2 can not return correct free space amount.
I checked jffs2_statfs, there is problem.
avail = c->dirty_size + c->free_size;
if (avail > c->sector_size * c->resv_blocks_write)
avail -= c->sector_size * c->resv_blocks_write;
else
avail = 0;
But in jffs2_reserve_space, c->dirty_size will compare to
c->nospc_dirty_size. If dirty < c->nospc_dirty_size, it will return
nospace error.
So I change above code to
dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks *
c->sector_size + c->unchecked_size;
if (dirty > c->nospc_dirty_size)
avail = c->dirty_size + c->free_size - c->nospc_dirty_size;
else
avail = c->free_size;
Do this make sense?
Thanks a lot!
Janboe
reply other threads:[~2007-07-19 10:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=af3ea28a0707190301l5d8a801aj260a259a08360de1@mail.gmail.com \
--to=janboe.ye@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jffs-dev@axis.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®