Skip to contentSkip to conversation

Add extended attributes to ext2/3

RFC PATCH In review [email protected] 2 participants 3 messages Oct 8, 2002 VFS

lore
Share & tools
lore
#0 lore raw

RFC PATCH 2/4 Add extended attributes to ext2/3

This is the second of four patches which add extended attribute support to the ext2 and ext3 filesystems. Please comment and bleed.

This patch creates a meta block cache which is utilized by the ext3 and ext2 extended attribute patch (patches 3 and 4, respectively). This cache allows directory blocks to be indexed by multiple keys. In the case of the extended attribute patches, it is used to look up blocks by both the block number and by the hash of the extended attributes. This is extremely important to allow the sharing of acl's when stored as extended attributes. Otherwise every single file would require its own, separate, one block overhead to store then ACL, even though there might be a large number of files that have the same ACL.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
#

# fs/Config.in            |    4 
# fs/Makefile             |    4 
# fs/mbcache.c            |  716 ++++++++++++++++++++++++++++++++++++++++++++++++
# include/linux/mbcache.h |   69 ++++

#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/04 [email protected] 1.666
# Port of the 0.8.50 xattr-mbcache patch to 2.5.
# --------------------------------------------
#

fs/Config.in +4 -0
diff -Nru a/fs/Config.in b/fs/Config.in
@@ -168,6 +168,10 @@
    define_tristate CONFIG_ZISOFS_FS n
 fi
 
+# Meta block cache for Extended Attributes (ext2/ext3)
+#tristate 'Meta block cache' CONFIG_FS_MBCACHE
+define_tristate CONFIG_FS_MBCACHE y
+
 mainmenu_option next_comment
 comment 'Partition Types'
 source fs/partitions/Config.in
fs/Makefile +3 -1
diff -Nru a/fs/Makefile b/fs/Makefile
@@ -6,7 +6,7 @@
 # 
 
 export-objs :=	open.o dcache.o buffer.o bio.o inode.o dquot.o mpage.o aio.o \
-                fcntl.o
+                fcntl.o mbcache.o
 
 obj-y :=	open.o read_write.o devices.o file_table.o buffer.o \
 		bio.o super.o block_dev.o char_dev.o stat.o exec.o pipe.o \
@@ -29,6 +29,8 @@
 obj-y				+= binfmt_script.o
 
 obj-$(CONFIG_BINFMT_ELF)	+= binfmt_elf.o
+
+obj-$(CONFIG_FS_MBCACHE)	+= mbcache.o
 
 obj-$(CONFIG_QUOTA)		+= dquot.o
 obj-$(CONFIG_QFMT_V1)		+= quota_v1.o
fs/mbcache.c new file +716 -0

716 lines not on this page · raw message

include/linux/mbcache.h new file +69 -0

69 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · On Tue, Oct 08, 2002 at 02:08:14PM -0400, [email protected] wrote:

This is the second of four patches which add extended attribute support to the ext2 and ext3 filesystems. Please comment and bleed.

Quoted 9 lines

This patch creates a meta block cache which is utilized by the ext3 and ext2 extended attribute patch (patches 3 and 4, respectively). This cache allows directory blocks to be indexed by multiple keys. In the case of the extended attribute patches, it is used to look up blocks by both the block number and by the hash of the extended attributes. This is extremely important to allow the sharing of acl's when stored as extended attributes. Otherwise every single file would require its own, separate, one block overhead to store then ACL, even though there might be a large number of files that have the same ACL.

The code doesn't really make æny sense outside ext2/ext3. I'd suggest you move it there instead of bloating every kernel with it unconditionally.

__mb_cache_entry_in_lru() is buggy and can't work anymore now that akpm removed some list_head debugging.

And please get rid of the LINUX_VERSION_CODE checks..

#2 lore raw
Quoted 3 lines · Christoph Hellwig

The code doesn't really make ?ny sense outside ext2/ext3. I'd suggest you move it there instead of bloating every kernel with it unconditionally.

The code is general enough that it can be used for a variety of purposes, not just ext2/ext3, although granted at the moment only ext2 and ext3 are using it. Also, having two copies of the code bewteen the ext2 and ext3 directories is undeseriable.

Probably the right thing to do is to add the appropriate logic in fs/Config.in so it's only enabled when necessary.

Quoted 3 lines

__mb_cache_entry_in_lru() is buggy and can't work anymore now that akpm removed some list_head debugging.

Oops. Nice catche. I didn't notice since it's only used in the mb_assert code, which I hadn't enabled.

Quoted 1 line

And please get rid of the LINUX_VERSION_CODE checks..

Thanks. Missed those....

- Ted