aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-05-17 01:02:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-17 14:45:45 -0400
commit12abb35a03e32c97235fcefdcf2d851be9f82dc2 (patch)
treeb415acb9230b775a899252f9fc7b66b14092911e
parentbba0b4ec3cd6c52cb778af34ad70f6cc3aec1c7e (diff)
reiserfs: clean up ifdefs
With xattr cleanup even with xattrs disabled, much of the initial setup is still performed. Some #ifdefs are just not needed since the options they protect wouldn't be available anyway. This cleans those up. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/reiserfs/xattr.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 2237e10c7c7c..cf949646dd57 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -685,20 +685,6 @@ out:
685 return err; 685 return err;
686} 686}
687 687
688/* Actual operations that are exported to VFS-land */
689struct xattr_handler *reiserfs_xattr_handlers[] = {
690 &reiserfs_xattr_user_handler,
691 &reiserfs_xattr_trusted_handler,
692#ifdef CONFIG_REISERFS_FS_SECURITY
693 &reiserfs_xattr_security_handler,
694#endif
695#ifdef CONFIG_REISERFS_FS_POSIX_ACL
696 &reiserfs_posix_acl_access_handler,
697 &reiserfs_posix_acl_default_handler,
698#endif
699 NULL
700};
701
702/* 688/*
703 * In order to implement different sets of xattr operations for each xattr 689 * In order to implement different sets of xattr operations for each xattr
704 * prefix with the generic xattr API, a filesystem should create a 690 * prefix with the generic xattr API, a filesystem should create a
@@ -922,6 +908,28 @@ static int create_privroot(struct dentry *dentry)
922 return 0; 908 return 0;
923} 909}
924 910
911#else
912int __init reiserfs_xattr_register_handlers(void) { return 0; }
913void reiserfs_xattr_unregister_handlers(void) {}
914static int create_privroot(struct dentry *dentry) { return 0; }
915#endif
916
917/* Actual operations that are exported to VFS-land */
918struct xattr_handler *reiserfs_xattr_handlers[] = {
919#ifdef CONFIG_REISERFS_FS_XATTR
920 &reiserfs_xattr_user_handler,
921 &reiserfs_xattr_trusted_handler,
922#endif
923#ifdef CONFIG_REISERFS_FS_SECURITY
924 &reiserfs_xattr_security_handler,
925#endif
926#ifdef CONFIG_REISERFS_FS_POSIX_ACL
927 &reiserfs_posix_acl_access_handler,
928 &reiserfs_posix_acl_default_handler,
929#endif
930 NULL
931};
932
925static int xattr_mount_check(struct super_block *s) 933static int xattr_mount_check(struct super_block *s)
926{ 934{
927 /* We need generation numbers to ensure that the oid mapping is correct 935 /* We need generation numbers to ensure that the oid mapping is correct
@@ -941,11 +949,6 @@ static int xattr_mount_check(struct super_block *s)
941 return 0; 949 return 0;
942} 950}
943 951
944#else
945int __init reiserfs_xattr_register_handlers(void) { return 0; }
946void reiserfs_xattr_unregister_handlers(void) {}
947#endif
948
949/* This will catch lookups from the fs root to .reiserfs_priv */ 952/* This will catch lookups from the fs root to .reiserfs_priv */
950static int 953static int
951xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name) 954xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name)
@@ -992,7 +995,6 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
992 int err = 0; 995 int err = 0;
993 struct dentry *privroot = REISERFS_SB(s)->priv_root; 996 struct dentry *privroot = REISERFS_SB(s)->priv_root;
994 997
995#ifdef CONFIG_REISERFS_FS_XATTR
996 err = xattr_mount_check(s); 998 err = xattr_mount_check(s);
997 if (err) 999 if (err)
998 goto error; 1000 goto error;
@@ -1023,14 +1025,11 @@ error:
1023 clear_bit(REISERFS_XATTRS_USER, &(REISERFS_SB(s)->s_mount_opt)); 1025 clear_bit(REISERFS_XATTRS_USER, &(REISERFS_SB(s)->s_mount_opt));
1024 clear_bit(REISERFS_POSIXACL, &(REISERFS_SB(s)->s_mount_opt)); 1026 clear_bit(REISERFS_POSIXACL, &(REISERFS_SB(s)->s_mount_opt));
1025 } 1027 }
1026#endif
1027 1028
1028 /* The super_block MS_POSIXACL must mirror the (no)acl mount option. */ 1029 /* The super_block MS_POSIXACL must mirror the (no)acl mount option. */
1029#ifdef CONFIG_REISERFS_FS_POSIX_ACL
1030 if (reiserfs_posixacl(s)) 1030 if (reiserfs_posixacl(s))
1031 s->s_flags |= MS_POSIXACL; 1031 s->s_flags |= MS_POSIXACL;
1032 else 1032 else
1033#endif
1034 s->s_flags &= ~MS_POSIXACL; 1033 s->s_flags &= ~MS_POSIXACL;
1035 1034
1036 return err; 1035 return err;