Directory Tags
Syntax : .(tag)(<tagName>)
Tags in Pnfs are file like objects. All file operations are also
defined on tags, although they might do thinks you won't expect
files to do.
Limitations
- The tagName is limited to 62 characters.
- The data content of a tag is limited to 512 bytes.
Exceeding this limit during one or more write operations
won't produce any kind of error messages, the residual data
is simply lost.
Additional behaviour
Beyond the well known behaviour of regular files, tags
provide a set of additional features.
While directories usually are only containers of references
to objects, tags really belong to the directory. As a result they can't
be moved to other directories. As a matter of fact, they can't even be
renamed, but this is a totally different story. Whenever a directory is
created, it inherits all tags belonging to its mother directory.
Inherited tags are are inherited to new subdirectories.
A tag which has been created and which has not
been inherited by creating a subdirectory
is called a Primary Tag otherwise it's called
an Inherited Tag. The parent tag of the total
Tag Chain is called the Super Tag of that chain or
its members. The idiom Pseudo Primary Tag will
be explained later in this description.
The following list summarises the behaviour of tags on the usual nfs
filesystem operations.
Tag Inheritance
A newly created subdirectory will inherit all Primary and
Inherited Tags of its parent directory which exist at the
moment of the directory creation. Tags which are created in a directory
are not distributed to its subdirectories if those subdirectories already
exists at the time the tag is created. So, Tag Inheritance is
an action, which only takes place whenever a directory is created, and
not when a tag is created.
All Inherited Tags always have the same name, content and unix
attributes as their Super Tag. Changing the content or attributes
of the Super Tag will change the content and attributes of all
Inherited Tags.
Tag I/O operations
All read operations which are performed on an Inherited Tag
are actually performed on its Super Tag.
This is different for write operations. A write on an Inherited
Tag cracks the tag chain this tag belongs to and
makes this tag to a so called Pseudo Primary Tag.
This Pseudo Primary Tag behaves exactly like a regular
Primary Tag except for the remove operation discussed below.
It becomes the Super Tag of all subsequent Inherited
Tags. The former Super Tag of the Pseudo Primary
Tag looses all its influence on the Pseudo Primary Tag.
Removing of tags
Tags can't be removed. After a tag has been created,
it will exist as long as the directory it belongs to does. The filesystem
remove or unlink operation perfomes different task on different
tag types.
- Primary Tags : Performing the remove operation
on a Primary Tag invalidates this tag and all Inherited
Tags in that Tag Chain.
An Invalidated Tag behaves as if this tag
doesn't exist. All filesystem I/O operations on that tag produce
an "File Not Found" error. BUT all lookup operations ( e.g. ls )
will show this tag with a 0 byte content. The inheritance scheme
is still active on Invalidated Tags. That means, that
a new subdirectory will inherit an invalidated tag.
Each write operation in an Invalidated Tag will revalidate
this tag and the whole Tag Chain.
- Pseudo Primary Tags : Performing the remove operation
on a Pseudo Primary Tag will reinstall the former Tag chain.
This tag becomes an Inherited Tag and the Super Tag
will be the next higher Primary or Pseudo Primary Tag in the
Tag Chain.
- Inherited Tags : Performing the remove operation
on Inherited Tags doesn't do anything.
Moving of directories
What happens if a directory, containing Inherited Tags,
is moved to some
other point in the filesystem hierarchy ?
The original tag chain remains active ( Think about it ! )
As a result you can never be sure that your parent directory holds the
parent of your tag, which means :
The Tag Chain needs not necessarily follow the
directory hierarchy.
ls of tags
A filesystem readdir (ls) will
not show the tag content of a directory, while
ls [-l] .(tag)(<tagName>) will return the
attributes of the tag tagName. Reading from .(tags)()
will return a list of tagNames belonging to the current working
directory. So the following sh script will simulate an ls -l *
ls -l `cat ".(tags)()"`
The nlink in the file attributes ( second of ls -l )
reflects the current status of the tag.
- 00 : Invalidated Primary or Pseudo Primary Tag.
- 01 : Valid Primary or Pseudo Primary Tag.
- 10 : Invalidated Inherited Tag.
- 11 : Validated Inherited Tag.
Patrick Fuhrmann DESY-ZDV (patrick@desy.de)