Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Bob Harris <harris@zk3.dec.com>
Subject: Re: ADVFS fileset information
Date: Wed, 06 Feb 2002 10:18:08 -0500	[thread overview]
Message-ID: <060220021018087142%harris@zk3.dec.com> (raw)
In-Reply-To: b9019227.0202051312.33fc9979@posting.google.com

In article <b9019227.0202051312.33fc9979@posting.google.com>, Narasimha
<mknarasimha@hotmail.com> wrote:

X  Hi Bob,
X  
X Thanks for the info. The method that you suggest involves getting the
X list of files contained in the fileset directory and then do a
X showfile -x on each of them to get their extent map. .............

That is what I've said in every reply I've posted, so at least I'm
consistant.

X  ........................................ Would it be possible to
X  construct a lower and upper bound for the extent offsets on a
X  particular volume(i.e can one say that a fileset spans from offset x
X  to offset y on a volume in the domain?). .........................

If you look at all the extents of all the files in the fileset name
space, you can find the file that owns the lowest numbered block on a
given volume and the file that owns the highest numbered block.

Filesets do not have storage which is why nothing in AdvFS tracks that
information.  Individual files have storage, and from a domain
perspective, all files are the same, and get stored anywhere storage is
available at the time they are created without regard for what fileset
they belong to.

And I get back to a previous question.  What is your goal in finding
the lowest numbered block of an extent owned by a file which happens to
be listed in a specific fileset's name space, and finding the highest
numbered block of an extent owned by a file which also happens to be
named in the same fileset's name space?

What is the big picture question you are trying to answer?

X  ........................................ Also i was doing a bit of
X  study on the clonefset utility which makes a clone of the fileset:
X  This seems to invoke a msfs_syscall systemcall and doesnt seem to
X  traverse the whole directory tree which brings me back to the premise
X  that there must be a system call which gets the information on a
X  fileset. ...........................................

No, sorry a clone does not work the way you seem to be thinking.  A
clone starts by marking the original fileset so that it knows it has
been cloned, then it duplicates the original fileset's tag directory
(I've mentioned this before; it provides tranlations between bitfile
tag ID's (like an inode) to the primary mcell location for each file in
the fileset name space.

From this point forward, if there is a change to any file, the clone
fileset allocates a new primary mcell for the file (on the first
modification of a file), and puts that the clone file's primary mcell
the clone's tag directory file.  Then just enough new storage is
allocated for the clone to equal the amount of storage being modified,
and the original data being modified is copied to the new storage in
the clone (copy-on-write or COW), then the original file's storage is
modified.  An original file being deleted or truncated, just has all of
its original storage moved directly into the clone (after all it
doesn't need it any more).

An empty clone fileset just contains a tag directory and some state
information on the original fileset to say there is a clone.

There is no need for the clone to know anything more about the files in
the original fileset, nor about what storage those files use until the
original files start to be modified.

When the clone is mounted and then read (such as during a backup),
since it has a copy of the original's tag directory, it can find all
the unmodified data of the files in the original fileset name space. 
And for modified files, the clone has its own tracking primary mcell
that keeps track of the storage that was modified in the original,
otherwise, the clone uses the original file's mcell information to read
the unmodified storage of the modified file.

Removing a clone consists of walking the clone's tag directory file and
deleting all the storage and mcells that were allocated to the clone
because of modifications to the original fileset.  A clone that
experienced very few copy-on-write operations will have very little to
delete and will be rmfset'ed very quickly.  A clone that has had lots
of copy-on-write operations performed to it, will take much longer to
rmfset.

Now I've been saying that a fileset is just a name space.  If you think
about the fact that a clone fileset starts out life as just a name
space that points to the same files as it original, and from a read
perspective, the file does not care whether it is read by the original
fileset or by the cloned fileset.  So a name space is like your address
book.  It is just a pointer to the real thing, and the real think for a
file is its metadata and storage kept in the domain, _NOT_ in the
fileset which is just an address book that points to the file.  And a
cloned fileset is just a copy of the original address book.

Once modifications start to happen, the 2 address books get marked up
and start to diverge, but the fact still remains that a fileset just
keeps track of the names (actually the bitfile tag numbers) of files it
is tracking and where they are located.  Nothing more.

X  fileset. It would be great if you could let me know.

What you are looking for does not exist.  There is no need for it to
exist.  It has no value to AdvFS, so there is no need to track that
information and no need to build an interface to get it.

----

By the way, I said my example script was not very well debugged, and I
was correct.  The string pageOff should have been enclosed in double
quotes as "pageOff".  I've corrected the example below:

X> Here is a rude, crude, and slow script (which is _NOT_ very well
X> debugged and will most likely break) that will find the high and low
X> blocks used by a given fileset:
X> 
X> #!/bin/ksh
X> #
X> if [[ $# = 0 ]]; then
X>     echo 1>&2 "Usage:  fileset_lo_hi_allocation.ksh mount_point"
X>     exit 1
X> fi
X> 
X> find $1 -mount -exec showfile -x {} \; | awk '
X>     $1 == "pageOff" { next }
X>     NF == 5 {
X>         if ( vol < $3 )
X>             vol = $3
X>         if ( lo[$3] > $4 || lo[$3] == 0 )
X>             lo[$3] = $4
X>         n = $4 + $5 - 1
X>         if ( hi[$3] < n )
X>             hi[$3] = n
X>     }
X>     END {
X>         for(j=1; j <= vol; j++ ) {
X>             if ( j in lo ) {
X>                 printf("vol:%d lo:%d hi:%d\n",
X>                     j, lo[j], hi[j])
X>             }
X>         }
X>     }'  # don't miss the closing single quote or not work.


                                        Bob Harris


  reply	other threads:[~2002-02-06 15:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-31 14:42 ADVFS fileset information Narasimha
2002-02-01  9:39 ` Marre des Spameurs qui prennent les add dans les news [SauroN]
2002-02-01 14:28 ` Narasimha
2002-02-04 15:40   ` Bob Harris
2002-02-01 15:15 ` Bob Harris
2002-02-04 16:47   ` Narasimha
2002-02-05 15:18     ` Bob Harris
2002-02-05 21:12       ` Narasimha
2002-02-06 15:18         ` Bob Harris [this message]
2002-02-06 22:48           ` Narasimha
2002-02-07  3:21             ` Bob Harris
2002-02-07 13:37               ` Narasimha
2002-02-08 17:36                 ` Bob Harris
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox