Subject: Re: mfs read operations.
To: =?iso-8859-1?Q?P=E5l_Halvorsen?= <paalh@unik.no>
From: Wojciech Puchar <wojtek@wojtek.3miasto.net>
List: tech-kern
Date: 07/22/2001 09:57:35
>
> Where can I find the code for mfs?
/usr/src/sys/ufs & /usr/sys/sys/ufs/mfs

if you like to improve it don't forget to add memory freeing when file is
deleted.

> > Basically, MFS is really just FFS (seriously, it uses all of the FFS
> > file system code), but merely provides a different backing store for
> > that FFS -- instead of a disk, it uses the address space of a process.
>
> OK, I knew this, but where is the code that calls the mfs  to copy data
> into the buf structure's data area - i have a monitor in bio_read() called
> from ffs_read (READ() in ufs_readwite.c) --??? I'm sitting remote and
> cant check the code-- and it looks like VOP_STRATEGY is not called.
>
> I might put another monitor here...
>
> Thanks,
> -ph
>
> > When I/O to that backing store is to be done, it queues the buffer, wakes
> > up the process holding the MFS backing store, which then performs a copyin/
> > copyout from the process's user address space to the buffer, and biodone's
> > that buffer.
> >
> > It was done this way to allow the space used by the file system to be
> > pageable -- it just gets put in swap space.
> >
> > There are arguably much better ways to write a memory-based file system.
> > But as I understand it, MFS was written this way originally for a couple
> > of reasons:
> >
> > 	- As a way to demonstrate how alternate backing store
> > 	  for FFS worked.
> >
> > 	- It was quick and easy.
>
> -ph
> ---       . o  o   .  o  .  o ..  o ..  o .. o oo . o  . o o o
>          _n_n_n____i_i _++++++_ _______ ________ _+++++++++++_
>       *>(____________I I______I I_____I I______I I___________I
>  __^__  /ooOOOO OOOOoo  oo ooo  oo   oo oo    oo ooo       ooo  __^__
> ( ___ )--------------------------------------------------------( ___ )
>  | / | Paal Halvorsen   UniK - Center for technology at Kjeller | \ |
>  | / |                                       University of Oslo | \ |
>  | / | Phone: +47 64844731                               PB. 70 | \ |
>  | / | Phone: +47 64844700 (switchboard)       N - 2027 KJELLER | \ |
>  |_/_| Fax:   +47 63818146                               Norway |_\_|
> (_____)-- E-mail: paalh@unik.no -- http://www.unik.no/~paalh --(_____)
>