Skip to contentSkip to conversation

Support for namespace "gnu" for extended attributes in ext2

PATCH New Thadeu Lima de Souza Cascardo 1 participant 1 message Jun 12, 2008 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Support for namespace "gnu" for extended attributes in ext2

This patch adds support for the "gnu" extended attributes namespace in ext2. This namespace is needed for Hurd, for things like translators.

---
 fs/ext2/Makefile    |    3 +-
 fs/ext2/xattr.c     |    2 +
 fs/ext2/xattr.h     |    2 +
 fs/ext2/xattr_gnu.c |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 1 deletions(-)
 create mode 100644 fs/ext2/xattr_gnu.c
fs/ext2/Makefile +2 -1
index e0b2b43..42184c1 100644
@@ -7,7 +7,8 @@ obj-$(CONFIG_EXT2_FS) += ext2.o
 ext2-y := balloc.o dir.o file.o fsync.o ialloc.o inode.o \
 	  ioctl.o namei.o super.o symlink.o
 
-ext2-$(CONFIG_EXT2_FS_XATTR)	 += xattr.o xattr_user.o xattr_trusted.o
+ext2-$(CONFIG_EXT2_FS_XATTR)	 += xattr.o xattr_user.o xattr_trusted.o \
+				    xattr_gnu.o
 ext2-$(CONFIG_EXT2_FS_POSIX_ACL) += acl.o
 ext2-$(CONFIG_EXT2_FS_SECURITY)	 += xattr_security.o
 ext2-$(CONFIG_EXT2_FS_XIP)	 += xip.o
fs/ext2/xattr.c +2 -0
index 987a526..93717ff 100644
@@ -110,6 +110,7 @@ static struct xattr_handler *ext2_xattr_handler_map[] = {
 #ifdef CONFIG_EXT2_FS_SECURITY
 	[EXT2_XATTR_INDEX_SECURITY]	     = &ext2_xattr_security_handler,
 #endif
+	[EXT2_XATTR_INDEX_GNU]		     = &ext2_xattr_gnu_handler,
 };
 
 struct xattr_handler *ext2_xattr_handlers[] = {
@@ -122,6 +123,7 @@ struct xattr_handler *ext2_xattr_handlers[] = {
 #ifdef CONFIG_EXT2_FS_SECURITY
 	&ext2_xattr_security_handler,
 #endif
+	&ext2_xattr_gnu_handler,
 	NULL
 };
 
fs/ext2/xattr.h +2 -0
index bf8175b..da3b5c7 100644
@@ -22,6 +22,7 @@
 #define EXT2_XATTR_INDEX_TRUSTED		4
 #define	EXT2_XATTR_INDEX_LUSTRE			5
 #define EXT2_XATTR_INDEX_SECURITY	        6
+#define EXT2_XATTR_INDEX_GNU			7
 
 struct ext2_xattr_header {
 	__le32	h_magic;	/* magic number for identification */
@@ -60,6 +61,7 @@ extern struct xattr_handler ext2_xattr_trusted_handler;
 extern struct xattr_handler ext2_xattr_acl_access_handler;
 extern struct xattr_handler ext2_xattr_acl_default_handler;
 extern struct xattr_handler ext2_xattr_security_handler;
+extern struct xattr_handler ext2_xattr_gnu_handler;
 
 extern ssize_t ext2_listxattr(struct dentry *, char *, size_t);
 
fs/ext2/xattr_gnu.c new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
1.5.5.4