diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
commit | e5fd91f1ef340da553f7a79da9540c3db711c937 (patch) | |
tree | b11842027dc6641da63f4bcc524f8678263304a3 /fs/aufs/posix_acl.c | |
parent | 2a9b0348e685a63d97486f6749622b61e9e3292f (diff) |
Linux-libre 4.2-gnu
Diffstat (limited to 'fs/aufs/posix_acl.c')
-rw-r--r-- | fs/aufs/posix_acl.c | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/fs/aufs/posix_acl.c b/fs/aufs/posix_acl.c deleted file mode 100644 index d5266ef76..000000000 --- a/fs/aufs/posix_acl.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2014-2015 Junjiro R. Okajima - * - * This program, aufs is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* - * posix acl operations - */ - -#include <linux/fs.h> -#include <linux/posix_acl.h> -#include "aufs.h" - -struct posix_acl *aufs_get_acl(struct inode *inode, int type) -{ - struct posix_acl *acl; - int err; - aufs_bindex_t bindex; - struct inode *h_inode; - struct super_block *sb; - - acl = NULL; - sb = inode->i_sb; - si_read_lock(sb, AuLock_FLUSH); - ii_read_lock_child(inode); - if (!(sb->s_flags & MS_POSIXACL)) - goto out; - - bindex = au_ibstart(inode); - h_inode = au_h_iptr(inode, bindex); - if (unlikely(!h_inode - || ((h_inode->i_mode & S_IFMT) - != (inode->i_mode & S_IFMT)))) { - err = au_busy_or_stale(); - acl = ERR_PTR(err); - goto out; - } - - /* always topmost only */ - acl = get_acl(h_inode, type); - -out: - ii_read_unlock(inode); - si_read_unlock(sb); - - AuTraceErrPtr(acl); - return acl; -} - -int aufs_set_acl(struct inode *inode, struct posix_acl *acl, int type) -{ - int err; - ssize_t ssz; - struct dentry *dentry; - struct au_srxattr arg = { - .type = AU_ACL_SET, - .u.acl_set = { - .acl = acl, - .type = type - }, - }; - - mutex_lock(&inode->i_mutex); - if (inode->i_ino == AUFS_ROOT_INO) - dentry = dget(inode->i_sb->s_root); - else { - dentry = d_find_alias(inode); - if (!dentry) - dentry = d_find_any_alias(inode); - if (!dentry) { - pr_warn("cannot handle this inode, " - "please report to aufs-users ML\n"); - err = -ENOENT; - goto out; - } - } - - ssz = au_srxattr(dentry, &arg); - dput(dentry); - err = ssz; - if (ssz >= 0) - err = 0; - -out: - mutex_unlock(&inode->i_mutex); - return err; -} |