aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-01-14 23:36:51 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-14 23:36:51 -0800
commit3061b0a9e778056fccfe7e3ca9dda1f1faf0b410 (patch)
treec931518c570e395f2d5e2110e55eca8625545741
parent27160c293115ac4c706d6597d683b8fe5c7bb887 (diff)
downloadhistory-3061b0a9e778056fccfe7e3ca9dda1f1faf0b410.tar.gz
[PATCH] ext3/EA: Ext[23]: no spare xattr handler slots needed
The ext3_xattr_set_handle2 and ext3_xattr_delete_inode functions contain duplicate code to decrease the reference count of an xattr block. Move this to a separate function. Also we know we have exclusive access to the inode in ext3_xattr_delete_inode; there is no need to grab the xattr_sem lock. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/ext2/xattr.c4
-rw-r--r--fs/ext2/xattr.h1
-rw-r--r--fs/ext3/xattr.c4
-rw-r--r--fs/ext3/xattr.h1
4 files changed, 4 insertions, 6 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 7560d9eec5c16..04cd1840195a9 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -100,7 +100,7 @@ static void ext2_xattr_rehash(struct ext2_xattr_header *,
static struct mb_cache *ext2_xattr_cache;
-static struct xattr_handler *ext2_xattr_handler_map[EXT2_XATTR_INDEX_MAX] = {
+static struct xattr_handler *ext2_xattr_handler_map[] = {
[EXT2_XATTR_INDEX_USER] = &ext2_xattr_user_handler,
#ifdef CONFIG_EXT2_FS_POSIX_ACL
[EXT2_XATTR_INDEX_POSIX_ACL_ACCESS] = &ext2_xattr_acl_access_handler,
@@ -130,7 +130,7 @@ ext2_xattr_handler(int name_index)
{
struct xattr_handler *handler = NULL;
- if (name_index > 0 && name_index <= EXT2_XATTR_INDEX_MAX)
+ if (name_index > 0 && name_index < ARRAY_SIZE(ext2_xattr_handler_map))
handler = ext2_xattr_handler_map[name_index];
return handler;
}
diff --git a/fs/ext2/xattr.h b/fs/ext2/xattr.h
index 0b7ad429fe00f..5f3bfde3b8100 100644
--- a/fs/ext2/xattr.h
+++ b/fs/ext2/xattr.h
@@ -17,7 +17,6 @@
#define EXT2_XATTR_REFCOUNT_MAX 1024
/* Name indexes */
-#define EXT2_XATTR_INDEX_MAX 10
#define EXT2_XATTR_INDEX_USER 1
#define EXT2_XATTR_INDEX_POSIX_ACL_ACCESS 2
#define EXT2_XATTR_INDEX_POSIX_ACL_DEFAULT 3
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 115df27013a31..09ab967231286 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -102,7 +102,7 @@ static void ext3_xattr_rehash(struct ext3_xattr_header *,
static struct mb_cache *ext3_xattr_cache;
-static struct xattr_handler *ext3_xattr_handler_map[EXT3_XATTR_INDEX_MAX] = {
+static struct xattr_handler *ext3_xattr_handler_map[] = {
[EXT3_XATTR_INDEX_USER] = &ext3_xattr_user_handler,
#ifdef CONFIG_EXT3_FS_POSIX_ACL
[EXT3_XATTR_INDEX_POSIX_ACL_ACCESS] = &ext3_xattr_acl_access_handler,
@@ -132,7 +132,7 @@ ext3_xattr_handler(int name_index)
{
struct xattr_handler *handler = NULL;
- if (name_index > 0 && name_index <= EXT3_XATTR_INDEX_MAX)
+ if (name_index > 0 && name_index < ARRAY_SIZE(ext3_xattr_handler_map))
handler = ext3_xattr_handler_map[name_index];
return handler;
}
diff --git a/fs/ext3/xattr.h b/fs/ext3/xattr.h
index 6ca51c0e65fa0..1bb352b6cbf4d 100644
--- a/fs/ext3/xattr.h
+++ b/fs/ext3/xattr.h
@@ -16,7 +16,6 @@
#define EXT3_XATTR_REFCOUNT_MAX 1024
/* Name indexes */
-#define EXT3_XATTR_INDEX_MAX 10
#define EXT3_XATTR_INDEX_USER 1
#define EXT3_XATTR_INDEX_POSIX_ACL_ACCESS 2
#define EXT3_XATTR_INDEX_POSIX_ACL_DEFAULT 3