Dharani,

You can use extended attributes to include metadata attributes that don't already exist. This might be easiest depending on your needs and intended goals.

If you really do want to add a field to the metadata on a file, you should start by looking at two files:

src/proto/pvfs2-attr.h

This defines how the attributes are encoded to send over the wire. Namely, the struct PVFS_metafile_attr_s has the metadata specific attributes.

src/io/trove/pvfs2-storage.h

This header defines how the attributes are stored on disk. It includes macros for converting from the object attr type (the one in pvfs2-attr.h) to the stored attr type (and vice-versa). Note though that the stored attr structure only contains common attributes (fields set on all types of objects -- metafiles, directories, symlinks, ...).

Finally, the object specific attributes (like the distribution for a metafile) are stored individual using the trove keyval component. You'll need to define another key for your keyval, and add it to the list of keys in the Trove_Common_Keys array. This can be found in pvfs2-server.c. Once you have that key, you can set the attr with a job_trove_keyval_write call, similar to what we do in many of the server state machines (see set-attr.sm for a couple good examples).

It looks like Murali responded ahead of me, but I was already too far into this email to abort :-). You should probably take his advice over mine.

-sam

On Apr 27, 2007, at 1:39 PM, Dharani Sankar Vijayakumar wrote:

Hi all,

What should i do to add another field into the metadata of a file.
(It will be helpful if one could point me to the .c file where the code for the metadata server database getting updated is present).

Regards,
Dharani



_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers


_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to