Skip to contentSkip to conversation

Extended Attributes for ext 2/3 filesystems (1/3)

PATCH In review [email protected] 1 participant 1 message Oct 18, 2002 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 Extended Attributes for ext 2/3 filesystems (1/3)

This patch creates a meta block cache which is utilized by the ext3 and ext2 extended attribute patches (patches 2 and 3, 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
#

# fs/Config.in            |   11 
# fs/Makefile             |    4 
# fs/mbcache.c            |  702 ++++++++++++++++++++++++++++++++++++++++++++++++
# include/linux/mbcache.h |   72 ++++

# 4 files changed, 788 insertions(+), 1 deletion(-)
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/18 [email protected] 1.809
# Port of the 0.8.50 xattr-mbcache patch to 2.5. (Shrinker API, hch cleanups) # (now uses struct block_device * to index devices, and uses hash.h for hash function) #
# This patch creates a meta block cache which is utilized by the ext3 and

# ext2 extended attribute patch (patches 2 and 3, 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.
# --------------------------------------------
#
diff -Nru a/fs/Config.in b/fs/Config.in
--- a/fs/Config.in	Fri Oct 18 14:26:50 2002
+++ b/fs/Config.in	Fri Oct 18 14:26:50 2002
@@ -182,6 +182,17 @@
    define_tristate CONFIG_ZISOFS_FS n
 fi

+# Meta block cache for Extended Attributes (ext2/ext3)
+if [ "$CONFIG_EXT2_FS_XATTR" = "y" -o "$CONFIG_EXT3_FS_XATTR" = "y" ]; then
+ if [ "$CONFIG_EXT2_FS" = "y" -o "$CONFIG_EXT3_FS" = "y" ]; then
+ define_tristate CONFIG_FS_MBCACHE y
+ else
+ if [ "$CONFIG_EXT2_FS" = "m" -o "$CONFIG_EXT3_FS" = "m" ]; then
+ define_tristate CONFIG_FS_MBCACHE m
+ fi
+ fi
+fi
+
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 read_write.o dcookies.o
+                fcntl.o read_write.o dcookies.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 +702 -0

702 lines not on this page · raw message

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

72 lines not on this page · raw message