diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-28 13:12:09 +0900 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-06-05 21:20:47 +0200 |
commit | 7adb1d4b6af65e557ee73544cb2f06afb32b0374 (patch) | |
tree | e88dda8339e86388544c3b10a466653e75ff9309 /fs | |
parent | 4abb287e4b018fa7b8e5c29d7807ec80ea44dceb (diff) | |
download | kernel_samsung_espresso10-7adb1d4b6af65e557ee73544cb2f06afb32b0374.zip kernel_samsung_espresso10-7adb1d4b6af65e557ee73544cb2f06afb32b0374.tar.gz kernel_samsung_espresso10-7adb1d4b6af65e557ee73544cb2f06afb32b0374.tar.bz2 |
f2fs: clean up acl flow for better readability
This patch cleans up a couple of acl codes.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Conflicts:
fs/f2fs/acl.h
Change-Id: I91dedc2998bcbb826fb78c8d709af692ba6bf3c6
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/acl.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index fa6dfd9..c1115f3 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -268,8 +268,8 @@ int f2fs_check_acl(struct inode *inode, int mask, unsigned int flags) int f2fs_init_acl(struct inode *inode, struct inode *dir) { - struct posix_acl *acl = NULL; struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); + struct posix_acl *acl = NULL; int error = 0; if (!S_ISLNK(inode->i_mode)) { @@ -282,19 +282,19 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir) inode->i_mode &= ~current_umask(); } - if (test_opt(sbi, POSIX_ACL) && acl) { + if (!test_opt(sbi, POSIX_ACL) || !acl) + goto cleanup; - if (S_ISDIR(inode->i_mode)) { - error = f2fs_set_acl(inode, ACL_TYPE_DEFAULT, acl); - if (error) - goto cleanup; - } - error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); - if (error < 0) - return error; - if (error > 0) - error = f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl); + if (S_ISDIR(inode->i_mode)) { + error = f2fs_set_acl(inode, ACL_TYPE_DEFAULT, acl); + if (error) + goto cleanup; } + error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); + if (error < 0) + return error; + if (error > 0) + error = f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl); cleanup: posix_acl_release(acl); return error; @@ -319,6 +319,7 @@ int f2fs_acl_chmod(struct inode *inode) error = posix_acl_chmod(&acl, GFP_KERNEL, mode); if (error) return error; + error = f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl); posix_acl_release(acl); return error; |