diff options
| author | Christoph Hellwig <hch@lst.de> | 2011-07-23 11:37:31 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-25 14:30:23 -0400 |
| commit | 4e34e719e457f2e031297175410fc0bd4016a085 (patch) | |
| tree | ab969a371e0d2efc6bfbf503ca6cdfce3af3bf6c /include/linux | |
| parent | edde854e8bb34a7f32fa993d721f1da0faf64165 (diff) | |
fs: take the ACL checks to common code
Replace the ->check_acl method with a ->get_acl method that simply reads an
ACL from disk after having a cache miss. This means we can replace the ACL
checking boilerplate code with a single implementation in namei.c.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 2 | ||||
| -rw-r--r-- | include/linux/generic_acl.h | 1 | ||||
| -rw-r--r-- | include/linux/reiserfs_acl.h | 6 | ||||
| -rw-r--r-- | include/linux/reiserfs_xattr.h | 2 |
4 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7a757a48a5c6..12f84b30c3ca 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1586,7 +1586,7 @@ struct inode_operations { | |||
| 1586 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 1586 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); |
| 1587 | void * (*follow_link) (struct dentry *, struct nameidata *); | 1587 | void * (*follow_link) (struct dentry *, struct nameidata *); |
| 1588 | int (*permission) (struct inode *, int); | 1588 | int (*permission) (struct inode *, int); |
| 1589 | int (*check_acl)(struct inode *, int); | 1589 | struct posix_acl * (*get_acl)(struct inode *, int); |
| 1590 | 1590 | ||
| 1591 | int (*readlink) (struct dentry *, char __user *,int); | 1591 | int (*readlink) (struct dentry *, char __user *,int); |
| 1592 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 1592 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h index 574bea4013b6..b6d657544ef1 100644 --- a/include/linux/generic_acl.h +++ b/include/linux/generic_acl.h | |||
| @@ -10,6 +10,5 @@ extern const struct xattr_handler generic_acl_default_handler; | |||
| 10 | 10 | ||
| 11 | int generic_acl_init(struct inode *, struct inode *); | 11 | int generic_acl_init(struct inode *, struct inode *); |
| 12 | int generic_acl_chmod(struct inode *); | 12 | int generic_acl_chmod(struct inode *); |
| 13 | int generic_check_acl(struct inode *inode, int mask); | ||
| 14 | 13 | ||
| 15 | #endif /* LINUX_GENERIC_ACL_H */ | 14 | #endif /* LINUX_GENERIC_ACL_H */ |
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 3fd8c4506bbb..f096b80e73d8 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h | |||
| @@ -59,11 +59,7 @@ extern const struct xattr_handler reiserfs_posix_acl_access_handler; | |||
| 59 | #else | 59 | #else |
| 60 | 60 | ||
| 61 | #define reiserfs_cache_default_acl(inode) 0 | 61 | #define reiserfs_cache_default_acl(inode) 0 |
| 62 | 62 | #define reiserfs_get_acl NULL | |
| 63 | static inline struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) | ||
| 64 | { | ||
| 65 | return NULL; | ||
| 66 | } | ||
| 67 | 63 | ||
| 68 | static inline int reiserfs_acl_chmod(struct inode *inode) | 64 | static inline int reiserfs_acl_chmod(struct inode *inode) |
| 69 | { | 65 | { |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 57958c0e1d38..c2b71473266e 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
| @@ -45,7 +45,6 @@ int reiserfs_permission(struct inode *inode, int mask); | |||
| 45 | 45 | ||
| 46 | #ifdef CONFIG_REISERFS_FS_XATTR | 46 | #ifdef CONFIG_REISERFS_FS_XATTR |
| 47 | #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) |
| 48 | int reiserfs_check_acl(struct inode *inode, int mask); | ||
| 49 | ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, | 48 | ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, |
| 50 | void *buffer, size_t size); | 49 | void *buffer, size_t size); |
| 51 | int reiserfs_setxattr(struct dentry *dentry, const char *name, | 50 | int reiserfs_setxattr(struct dentry *dentry, const char *name, |
| @@ -123,7 +122,6 @@ static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | |||
| 123 | #define reiserfs_setxattr NULL | 122 | #define reiserfs_setxattr NULL |
| 124 | #define reiserfs_listxattr NULL | 123 | #define reiserfs_listxattr NULL |
| 125 | #define reiserfs_removexattr NULL | 124 | #define reiserfs_removexattr NULL |
| 126 | #define reiserfs_check_acl NULL | ||
| 127 | 125 | ||
| 128 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | 126 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) |
| 129 | { | 127 | { |
