9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: geoff@plan9.bell-labs.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Fs64 file server, partition boundaries out of range
Date: Sat,  5 Aug 2006 19:13:05 -0400	[thread overview]
Message-ID: <cdc21564dfd06d16b4b155c3fabcfe51@plan9.bell-labs.com> (raw)
In-Reply-To: <1eb60af701688ea28c07b2ca3ad595d0@quanstro.net>

I believe Charles wrote the original version of what is now
dowormcopy() and I probably modified it; Nigel may have also.  It
copes with real and fake worms.  On a fake worm, the block-allocation
bitmap is at the end of the file system, but all blocks can be read.

On a real worm, only already-written blocks can be read and there is
no allocation bitmap (or at least none visible outside the jukebox
hardware).  Because the file server kernel gradually extends the upper
limit of blocks it will allocate on the worm, there will tend to be
both written and unwritten blocks just before the current nominal end
of the file system (but the end is increased when cwgrow() is called).
After the current end there should only be unwritten blocks, and
almost all of the blocks before it should be written.

All sizes are in blocks of RBUFSIZE bytes.  writtensize() gets the
device's size from devsize(), which calls fwormsize() for fake worms
or cwsize() for real ones.  cwsize() just gets the current end of the
file system from the cache device, where it's conveniently stored.
fwormsize() subtracts the size of the allocation bitmap from the size
of the underlying device.  writtensize() works backward from the end
of the device, using the size returned by devsize() as its nominal
size, reading blocks until it succeeds.  This should be pretty quick;
for fake worms, fwormread() just consults the allocation bitmap to see
if a block is allocated and thus readable, so writtensize() will see a
long series of failed getbuf() attempts before reading the last
allocated block before the allocation bitmap.  Real worms are similar,
but starting at the cache's notion of where the file system currently
ends will be much closer to the last-written block than starting at
the end of the non-bitmap fake worm device, so the backward scan will
be short.



  reply	other threads:[~2006-08-05 23:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-05 13:08 Gregory Pavelcak
2006-08-05 13:57 ` erik quanstrom
2006-08-05 18:14   ` Gregory Pavelcak
2006-08-05 19:32     ` Anthony Sorace
2006-08-05 20:19       ` Gregory Pavelcak
2006-08-05 20:24         ` erik quanstrom
2006-08-05 23:13           ` geoff [this message]
2006-08-05 23:21             ` geoff
2006-08-06  4:27               ` erik quanstrom
2006-08-05 23:34                 ` geoff
2006-08-06 15:06             ` Gregory Pavelcak
2006-08-07  1:06               ` geoff
2006-08-05 14:38 ` geoff
2006-08-05 18:11   ` Gregory Pavelcak
2006-08-07 21:19 Gregory Pavelcak
2006-08-07 21:29 ` geoff
2006-08-07 22:50   ` Gregory Pavelcak
2006-08-07 23:38     ` geoff
2006-08-10 12:44   ` Gregory Pavelcak

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=cdc21564dfd06d16b4b155c3fabcfe51@plan9.bell-labs.com \
    --to=geoff@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /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).