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

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.

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.
Patrick Fuhrmann DESY-ZDV (patrick@desy.de)