This patch adds the structure for a module to duplicate xattr blocks as part of copying files with the '-d' option to mke2fs. The function stubs here are intended to be the public interface to the module. We also define a macro for dumping debug data specific to this module. Signed-off-by: Philip Tricca Index: e2fsprogs-1.42.9/misc/xattr.c =================================================================== --- /dev/null +++ e2fsprogs-1.42.9/misc/xattr.c @@ -0,0 +1,34 @@ +#include "xattr.h" + +#include + +#ifdef XATTR_DEBUG +#define XATTR_STDERR(fmt, args...) fprintf (stderr, fmt, ##args) +#else +#define XATTR_STDERR(fmt, args...) do {} while (0) +#endif + + +/* Free remaining resources after all files have been processed. */ +void +xattr_cleanup () +{ + XATTR_STDERR ("Cleaning up resources from xattrs.\n"); +} + +/* This is the entry point to the xattr module. This function copies the xattrs + * from the file at 'path' to the file system object at 'ino'. + * + * Parameters: + * fs: the file system object for the fs we're operating on + * ino: inode for the object we're labeling + * path: path to the object we're copying xattrs from + */ +errcode_t +set_inode_xattr (ext2_filsys fs, ext2_ino_t ino, const char *path) +{ + errcode_t ret = 0; + + XATTR_STDERR ("Copying xattrs from %s to inode 0x%x.\n", path, ino); + return ret; +} Index: e2fsprogs-1.42.9/misc/xattr.h =================================================================== --- /dev/null +++ e2fsprogs-1.42.9/misc/xattr.h @@ -0,0 +1,6 @@ +#include "et/com_err.h" +#include "ext2fs/ext2fs.h" + +/* Copy xattrs from source file to destination inode */ +errcode_t set_inode_xattrs(ext2_filsys fs, ext2_ino_t ino, const char *name); +void xattr_cleanup ();