Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145081
b: refs/heads/master
c: 12abb35
h: refs/heads/master
i:
  145079: a9ce9d0
v: v3
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed May 17, 2009
1 parent 945c162 commit 3ec3256
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bba0b4ec3cd6c52cb778af34ad70f6cc3aec1c7e
refs/heads/master: 12abb35a03e32c97235fcefdcf2d851be9f82dc2
45 changes: 22 additions & 23 deletions trunk/fs/reiserfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,20 +685,6 @@ reiserfs_xattr_get(struct inode *inode, const char *name, void *buffer,
return err;
}

/* Actual operations that are exported to VFS-land */
struct xattr_handler *reiserfs_xattr_handlers[] = {
&reiserfs_xattr_user_handler,
&reiserfs_xattr_trusted_handler,
#ifdef CONFIG_REISERFS_FS_SECURITY
&reiserfs_xattr_security_handler,
#endif
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
&reiserfs_posix_acl_access_handler,
&reiserfs_posix_acl_default_handler,
#endif
NULL
};

/*
* In order to implement different sets of xattr operations for each xattr
* prefix with the generic xattr API, a filesystem should create a
Expand Down Expand Up @@ -922,6 +908,28 @@ static int create_privroot(struct dentry *dentry)
return 0;
}

#else
int __init reiserfs_xattr_register_handlers(void) { return 0; }
void reiserfs_xattr_unregister_handlers(void) {}
static int create_privroot(struct dentry *dentry) { return 0; }
#endif

/* Actual operations that are exported to VFS-land */
struct xattr_handler *reiserfs_xattr_handlers[] = {
#ifdef CONFIG_REISERFS_FS_XATTR
&reiserfs_xattr_user_handler,
&reiserfs_xattr_trusted_handler,
#endif
#ifdef CONFIG_REISERFS_FS_SECURITY
&reiserfs_xattr_security_handler,
#endif
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
&reiserfs_posix_acl_access_handler,
&reiserfs_posix_acl_default_handler,
#endif
NULL
};

static int xattr_mount_check(struct super_block *s)
{
/* We need generation numbers to ensure that the oid mapping is correct
Expand All @@ -941,11 +949,6 @@ static int xattr_mount_check(struct super_block *s)
return 0;
}

#else
int __init reiserfs_xattr_register_handlers(void) { return 0; }
void reiserfs_xattr_unregister_handlers(void) {}
#endif

/* This will catch lookups from the fs root to .reiserfs_priv */
static int
xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name)
Expand Down Expand Up @@ -992,7 +995,6 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
int err = 0;
struct dentry *privroot = REISERFS_SB(s)->priv_root;

#ifdef CONFIG_REISERFS_FS_XATTR
err = xattr_mount_check(s);
if (err)
goto error;
Expand Down Expand Up @@ -1023,14 +1025,11 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
clear_bit(REISERFS_XATTRS_USER, &(REISERFS_SB(s)->s_mount_opt));
clear_bit(REISERFS_POSIXACL, &(REISERFS_SB(s)->s_mount_opt));
}
#endif

/* The super_block MS_POSIXACL must mirror the (no)acl mount option. */
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
if (reiserfs_posixacl(s))
s->s_flags |= MS_POSIXACL;
else
#endif
s->s_flags &= ~MS_POSIXACL;

return err;
Expand Down

0 comments on commit 3ec3256

Please sign in to comment.