Skip to content

Commit

Permalink
fs: remove generic_acl
Browse files Browse the repository at this point in the history
And instead convert tmpfs to use the new generic ACL code, with two stub
methods provided for in-memory filesystems.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Jan 26, 2014
1 parent 013cdf1 commit feda821
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 238 deletions.
6 changes: 1 addition & 5 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ source "fs/quota/Kconfig"
source "fs/autofs4/Kconfig"
source "fs/fuse/Kconfig"

config GENERIC_ACL
bool
select FS_POSIX_ACL

menu "Caches"

source "fs/fscache/Kconfig"
Expand Down Expand Up @@ -119,7 +115,7 @@ config TMPFS_POSIX_ACL
bool "Tmpfs POSIX Access Control Lists"
depends on TMPFS
select TMPFS_XATTR
select GENERIC_ACL
select FS_POSIX_ACL
help
POSIX Access Control Lists (ACLs) support additional access rights
for users and groups beyond the standard owner/group/world scheme,
Expand Down
1 change: 0 additions & 1 deletion fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ obj-$(CONFIG_BINFMT_FLAT) += binfmt_flat.o
obj-$(CONFIG_FS_MBCACHE) += mbcache.o
obj-$(CONFIG_FS_POSIX_ACL) += posix_acl.o
obj-$(CONFIG_NFS_COMMON) += nfs_common/
obj-$(CONFIG_GENERIC_ACL) += generic_acl.o
obj-$(CONFIG_COREDUMP) += coredump.o
obj-$(CONFIG_SYSCTL) += drop_caches.o

Expand Down
184 changes: 0 additions & 184 deletions fs/generic_acl.c

This file was deleted.

36 changes: 36 additions & 0 deletions fs/posix_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,3 +786,39 @@ const struct xattr_handler posix_acl_default_xattr_handler = {
.set = posix_acl_xattr_set,
};
EXPORT_SYMBOL_GPL(posix_acl_default_xattr_handler);

int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
int error;

if (type == ACL_TYPE_ACCESS) {
error = posix_acl_equiv_mode(acl, &inode->i_mode);
if (error < 0)
return 0;
if (error == 0)
acl = NULL;
}

inode->i_ctime = CURRENT_TIME;
set_cached_acl(inode, type, acl);
return 0;
}

int simple_acl_create(struct inode *dir, struct inode *inode)
{
struct posix_acl *default_acl, *acl;
int error;

error = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl);
if (error)
return error;

set_cached_acl(inode, ACL_TYPE_DEFAULT, default_acl);
set_cached_acl(inode, ACL_TYPE_ACCESS, acl);

if (default_acl)
posix_acl_release(default_acl);
if (acl)
posix_acl_release(acl);
return 0;
}
14 changes: 0 additions & 14 deletions include/linux/generic_acl.h

This file was deleted.

9 changes: 9 additions & 0 deletions include/linux/posix_acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ extern int posix_acl_chmod(struct inode *, umode_t);
extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **,
struct posix_acl **);

extern int simple_set_acl(struct inode *, struct posix_acl *, int);
extern int simple_acl_create(struct inode *, struct inode *);

static inline struct posix_acl **acl_by_type(struct inode *inode, int type)
{
switch (type) {
Expand Down Expand Up @@ -181,6 +184,12 @@ static inline int posix_acl_chmod(struct inode *inode, umode_t mode)
return 0;
}

#define simple_set_acl NULL

static inline int simple_acl_create(struct inode *dir, struct inode *inode)
{
return 0;
}
static inline void cache_no_acl(struct inode *inode)
{
}
Expand Down
Loading

0 comments on commit feda821

Please sign in to comment.