diff options
-rw-r--r-- | fs/reiserfs/xattr.c | 36 | ||||
-rw-r--r-- | include/linux/reiserfs_xattr.h | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 628075ca82c1..8e7deb0e6964 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -871,23 +871,6 @@ static int reiserfs_check_acl(struct inode *inode, int mask) | |||
871 | return error; | 871 | return error; |
872 | } | 872 | } |
873 | 873 | ||
874 | int reiserfs_permission(struct inode *inode, int mask) | ||
875 | { | ||
876 | /* | ||
877 | * We don't do permission checks on the internal objects. | ||
878 | * Permissions are determined by the "owning" object. | ||
879 | */ | ||
880 | if (IS_PRIVATE(inode)) | ||
881 | return 0; | ||
882 | /* | ||
883 | * Stat data v1 doesn't support ACLs. | ||
884 | */ | ||
885 | if (get_inode_sd_version(inode) == STAT_DATA_V1) | ||
886 | return generic_permission(inode, mask, NULL); | ||
887 | else | ||
888 | return generic_permission(inode, mask, reiserfs_check_acl); | ||
889 | } | ||
890 | |||
891 | static int create_privroot(struct dentry *dentry) | 874 | static int create_privroot(struct dentry *dentry) |
892 | { | 875 | { |
893 | int err; | 876 | int err; |
@@ -951,6 +934,25 @@ static int xattr_mount_check(struct super_block *s) | |||
951 | return 0; | 934 | return 0; |
952 | } | 935 | } |
953 | 936 | ||
937 | int reiserfs_permission(struct inode *inode, int mask) | ||
938 | { | ||
939 | /* | ||
940 | * We don't do permission checks on the internal objects. | ||
941 | * Permissions are determined by the "owning" object. | ||
942 | */ | ||
943 | if (IS_PRIVATE(inode)) | ||
944 | return 0; | ||
945 | |||
946 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
947 | /* | ||
948 | * Stat data v1 doesn't support ACLs. | ||
949 | */ | ||
950 | if (get_inode_sd_version(inode) != STAT_DATA_V1) | ||
951 | return generic_permission(inode, mask, reiserfs_check_acl); | ||
952 | #endif | ||
953 | return generic_permission(inode, mask, NULL); | ||
954 | } | ||
955 | |||
954 | /* This will catch lookups from the fs root to .reiserfs_priv */ | 956 | /* This will catch lookups from the fs root to .reiserfs_priv */ |
955 | static int | 957 | static int |
956 | xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name) | 958 | xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name) |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index cdedc01036e4..99928dce37ea 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -41,6 +41,7 @@ int reiserfs_xattr_init(struct super_block *sb, int mount_flags); | |||
41 | int reiserfs_lookup_privroot(struct super_block *sb); | 41 | int reiserfs_lookup_privroot(struct super_block *sb); |
42 | int reiserfs_delete_xattrs(struct inode *inode); | 42 | int reiserfs_delete_xattrs(struct inode *inode); |
43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); | 43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); |
44 | int reiserfs_permission(struct inode *inode, int mask); | ||
44 | 45 | ||
45 | #ifdef CONFIG_REISERFS_FS_XATTR | 46 | #ifdef CONFIG_REISERFS_FS_XATTR |
46 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) | 47 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) |
@@ -50,7 +51,6 @@ int reiserfs_setxattr(struct dentry *dentry, const char *name, | |||
50 | const void *value, size_t size, int flags); | 51 | const void *value, size_t size, int flags); |
51 | ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size); | 52 | ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size); |
52 | int reiserfs_removexattr(struct dentry *dentry, const char *name); | 53 | int reiserfs_removexattr(struct dentry *dentry, const char *name); |
53 | int reiserfs_permission(struct inode *inode, int mask); | ||
54 | 54 | ||
55 | int reiserfs_xattr_get(struct inode *, const char *, void *, size_t); | 55 | int reiserfs_xattr_get(struct inode *, const char *, void *, size_t); |
56 | int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int); | 56 | int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int); |
@@ -117,8 +117,6 @@ static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | |||
117 | #define reiserfs_listxattr NULL | 117 | #define reiserfs_listxattr NULL |
118 | #define reiserfs_removexattr NULL | 118 | #define reiserfs_removexattr NULL |
119 | 119 | ||
120 | #define reiserfs_permission NULL | ||
121 | |||
122 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | 120 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) |
123 | { | 121 | { |
124 | } | 122 | } |