acl.c (cf9ce948f47640797bd19980e1d99c6d17d0bdc3) acl.c (7f165aaa7dc898472f3b3fbf2231bb3b5623a3df)
1/*
2 * Copyright IBM Corporation, 2010
3 * Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2.1 of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
8 *

--- 105 unchanged lines hidden (view full) ---

114}
115
116static int v9fs_set_acl(struct dentry *dentry, int type, struct posix_acl *acl)
117{
118 int retval;
119 char *name;
120 size_t size;
121 void *buffer;
1/*
2 * Copyright IBM Corporation, 2010
3 * Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2.1 of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
8 *

--- 105 unchanged lines hidden (view full) ---

114}
115
116static int v9fs_set_acl(struct dentry *dentry, int type, struct posix_acl *acl)
117{
118 int retval;
119 char *name;
120 size_t size;
121 void *buffer;
122 struct inode *inode = dentry->d_inode;
123
124 set_cached_acl(inode, type, acl);
125
126 if (!acl)
127 return 0;
128
129 /* Set a setxattr request to server */
130 size = posix_acl_xattr_size(acl->a_count);
131 buffer = kmalloc(size, GFP_KERNEL);
132 if (!buffer)
133 return -ENOMEM;

--- 24 unchanged lines hidden (view full) ---

158
159 if (S_ISLNK(inode->i_mode))
160 return -EOPNOTSUPP;
161 acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS);
162 if (acl) {
163 retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
164 if (retval)
165 return retval;
122 if (!acl)
123 return 0;
124
125 /* Set a setxattr request to server */
126 size = posix_acl_xattr_size(acl->a_count);
127 buffer = kmalloc(size, GFP_KERNEL);
128 if (!buffer)
129 return -ENOMEM;

--- 24 unchanged lines hidden (view full) ---

154
155 if (S_ISLNK(inode->i_mode))
156 return -EOPNOTSUPP;
157 acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS);
158 if (acl) {
159 retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
160 if (retval)
161 return retval;
162 set_cached_acl(inode, ACL_TYPE_ACCESS, acl);
166 retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, acl);
167 posix_acl_release(acl);
168 }
169 return retval;
170}
171
172int v9fs_set_create_acl(struct dentry *dentry,
173 struct posix_acl **dpacl, struct posix_acl **pacl)
174{
175 if (dentry) {
163 retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, acl);
164 posix_acl_release(acl);
165 }
166 return retval;
167}
168
169int v9fs_set_create_acl(struct dentry *dentry,
170 struct posix_acl **dpacl, struct posix_acl **pacl)
171{
172 if (dentry) {
173 set_cached_acl(dentry->d_inode, ACL_TYPE_DEFAULT, *dpacl);
176 v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, *dpacl);
174 v9fs_set_acl(dentry, ACL_TYPE_DEFAULT, *dpacl);
175 set_cached_acl(dentry->d_inode, ACL_TYPE_ACCESS, *pacl);
177 v9fs_set_acl(dentry, ACL_TYPE_ACCESS, *pacl);
178 }
179 posix_acl_release(*dpacl);
180 posix_acl_release(*pacl);
181 *dpacl = *pacl = NULL;
182 return 0;
183}
184

--- 196 unchanged lines hidden ---
176 v9fs_set_acl(dentry, ACL_TYPE_ACCESS, *pacl);
177 }
178 posix_acl_release(*dpacl);
179 posix_acl_release(*pacl);
180 *dpacl = *pacl = NULL;
181 return 0;
182}
183

--- 196 unchanged lines hidden ---