From: Andries Brouwer <aebr@win.tue.nl>
To: Erik McKee <camhanaich99@yahoo.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: minixfs question
Date: Sat, 2 Aug 2003 14:17:09 +0200 [thread overview]
Message-ID: <20030802121709.GA3689@win.tue.nl> (raw)
In-Reply-To: <20030802094854.19141.qmail@web14202.mail.yahoo.com>
On Sat, Aug 02, 2003 at 02:48:54AM -0700, Erik McKee wrote:
> hoping this fs is a good place to start learning about fs in linux
Since it is small, and was the first, it has been a template
for many other filesystems. On the other hand, today it is a fossil,
not used very much, and its code is no longer exemplary.
You ask about minix_find_first_zero_bit and whether there aren't generic fns.
There are, but the details differ a bit. The original version was
little-endian. On other architectures one must choose between
little-endian and native endian. The choice can be read off in asm*/bitops.h.
> 224 bh = NULL;
> 225 *error = -ENOSPC;
> 226 lock_kernel();
> 227 for (i = 0; i < sbi->s_imap_blocks; i++) {
> 228 bh = sbi->s_imap[i];
> 229 if ((j = minix_find_first_zero_bit(bh->b_data, 8192)) < 8192)
> 230 break;
> 231 }
> 232 if (!bh || j >= 8192) {
You ask about the dereference bh->b_data and the test !bh.
The intention is that sbi->s_imap_blocks gives the number of
entries in sbi->s_imap that are nonzero. So, the bh in the
inner loop should be non-NULL. But after the loop bh can be NULL,
namely when sbi->s_imap_blocks == 0.
prev parent reply other threads:[~2003-08-02 12:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-02 9:48 Erik McKee
2003-08-02 12:17 ` Andries Brouwer [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=20030802121709.GA3689@win.tue.nl \
--to=aebr@win.tue.nl \
--cc=camhanaich99@yahoo.com \
--cc=linux-fsdevel@vger.kernel.org \
--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®