acl.c (d0034a7a4ac7fae708146ac0059b9c47a1543f0d) | acl.c (0cad6246621b5887d5b33fea84219d2a71f2f99a) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 5 */ 6 7#include <linux/sched.h> 8#include <linux/slab.h> --- 43 unchanged lines hidden (view full) --- 52 len = gfs2_xattr_acl_get(ip, name, &data); 53 if (len <= 0) 54 return ERR_PTR(len); 55 acl = posix_acl_from_xattr(&init_user_ns, data, len); 56 kfree(data); 57 return acl; 58} 59 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 5 */ 6 7#include <linux/sched.h> 8#include <linux/slab.h> --- 43 unchanged lines hidden (view full) --- 52 len = gfs2_xattr_acl_get(ip, name, &data); 53 if (len <= 0) 54 return ERR_PTR(len); 55 acl = posix_acl_from_xattr(&init_user_ns, data, len); 56 kfree(data); 57 return acl; 58} 59 |
60struct posix_acl *gfs2_get_acl(struct inode *inode, int type) | 60struct posix_acl *gfs2_get_acl(struct inode *inode, int type, bool rcu) |
61{ 62 struct gfs2_inode *ip = GFS2_I(inode); 63 struct gfs2_holder gh; 64 bool need_unlock = false; 65 struct posix_acl *acl; 66 | 61{ 62 struct gfs2_inode *ip = GFS2_I(inode); 63 struct gfs2_holder gh; 64 bool need_unlock = false; 65 struct posix_acl *acl; 66 |
67 if (rcu) 68 return ERR_PTR(-ECHILD); 69 |
|
67 if (!gfs2_glock_is_locked_by_me(ip->i_gl)) { 68 int ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 69 LM_FLAG_ANY, &gh); 70 if (ret) 71 return ERR_PTR(ret); 72 need_unlock = true; 73 } 74 acl = __gfs2_get_acl(inode, type); --- 77 unchanged lines hidden --- | 70 if (!gfs2_glock_is_locked_by_me(ip->i_gl)) { 71 int ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 72 LM_FLAG_ANY, &gh); 73 if (ret) 74 return ERR_PTR(ret); 75 need_unlock = true; 76 } 77 acl = __gfs2_get_acl(inode, type); --- 77 unchanged lines hidden --- |