diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2005-01-14 23:36:51 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-14 23:36:51 -0800 |
commit | 3061b0a9e778056fccfe7e3ca9dda1f1faf0b410 (patch) | |
tree | c931518c570e395f2d5e2110e55eca8625545741 /fs/ext3/xattr.c | |
parent | 27160c293115ac4c706d6597d683b8fe5c7bb887 (diff) | |
download | history-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>
Diffstat (limited to 'fs/ext3/xattr.c')
-rw-r--r-- | fs/ext3/xattr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c index 115df27013a315..09ab967231286a 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; } |