aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-23 18:56:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-08-01 02:10:06 -0400
commitd6952123b53cc8b334df69bba2cd0063b0d88f68 (patch)
treeb1ccaa7e3d65dbf4af093202044da65bc4deb34e /fs
parentd3fb612076eebec6f67257db0c7a9666ac7e5892 (diff)
switch posix_acl_equiv_mode() to umode_t *
... so that &inode->i_mode could be passed to it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/acl.c2
-rw-r--r--fs/btrfs/acl.c5
-rw-r--r--fs/ext2/acl.c4
-rw-r--r--fs/ext3/acl.c4
-rw-r--r--fs/ext4/acl.c4
-rw-r--r--fs/generic_acl.c6
-rw-r--r--fs/gfs2/acl.c2
-rw-r--r--fs/jffs2/acl.c2
-rw-r--r--fs/jfs/xattr.c4
-rw-r--r--fs/ocfs2/acl.c2
-rw-r--r--fs/posix_acl.c4
-rw-r--r--fs/reiserfs/xattr_acl.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_acl.c2
13 files changed, 14 insertions, 31 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c
index ad734e3220cf..9a1d42630751 100644
--- a/fs/9p/acl.c
+++ b/fs/9p/acl.c
@@ -319,7 +319,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name,
319 case ACL_TYPE_ACCESS: 319 case ACL_TYPE_ACCESS:
320 name = POSIX_ACL_XATTR_ACCESS; 320 name = POSIX_ACL_XATTR_ACCESS;
321 if (acl) { 321 if (acl) {
322 mode_t mode = inode->i_mode; 322 umode_t mode = inode->i_mode;
323 retval = posix_acl_equiv_mode(acl, &mode); 323 retval = posix_acl_equiv_mode(acl, &mode);
324 if (retval < 0) 324 if (retval < 0)
325 goto err_out; 325 goto err_out;
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 59086142c14d..4cc5c0164ed6 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -111,7 +111,6 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans,
111 int ret, size = 0; 111 int ret, size = 0;
112 const char *name; 112 const char *name;
113 char *value = NULL; 113 char *value = NULL;
114 mode_t mode;
115 114
116 if (acl) { 115 if (acl) {
117 ret = posix_acl_valid(acl); 116 ret = posix_acl_valid(acl);
@@ -122,13 +121,11 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans,
122 121
123 switch (type) { 122 switch (type) {
124 case ACL_TYPE_ACCESS: 123 case ACL_TYPE_ACCESS:
125 mode = inode->i_mode;
126 name = POSIX_ACL_XATTR_ACCESS; 124 name = POSIX_ACL_XATTR_ACCESS;
127 if (acl) { 125 if (acl) {
128 ret = posix_acl_equiv_mode(acl, &mode); 126 ret = posix_acl_equiv_mode(acl, &inode->i_mode);
129 if (ret < 0) 127 if (ret < 0)
130 return ret; 128 return ret;
131 inode->i_mode = mode;
132 } 129 }
133 ret = 0; 130 ret = 0;
134 break; 131 break;
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index 0ce740489ab1..35d6a3cfd9ff 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -194,12 +194,10 @@ ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
194 case ACL_TYPE_ACCESS: 194 case ACL_TYPE_ACCESS:
195 name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; 195 name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS;
196 if (acl) { 196 if (acl) {
197 mode_t mode = inode->i_mode; 197 error = posix_acl_equiv_mode(acl, &inode->i_mode);
198 error = posix_acl_equiv_mode(acl, &mode);
199 if (error < 0) 198 if (error < 0)
200 return error; 199 return error;
201 else { 200 else {
202 inode->i_mode = mode;
203 inode->i_ctime = CURRENT_TIME_SEC; 201 inode->i_ctime = CURRENT_TIME_SEC;
204 mark_inode_dirty(inode); 202 mark_inode_dirty(inode);
205 if (error == 0) 203 if (error == 0)
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index 74a3c6486f8f..3091f62e55b6 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -199,12 +199,10 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type,
199 case ACL_TYPE_ACCESS: 199 case ACL_TYPE_ACCESS:
200 name_index = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS; 200 name_index = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS;
201 if (acl) { 201 if (acl) {
202 mode_t mode = inode->i_mode; 202 error = posix_acl_equiv_mode(acl, &inode->i_mode);
203 error = posix_acl_equiv_mode(acl, &mode);
204 if (error < 0) 203 if (error < 0)
205 return error; 204 return error;
206 else { 205 else {
207 inode->i_mode = mode;
208 inode->i_ctime = CURRENT_TIME_SEC; 206 inode->i_ctime = CURRENT_TIME_SEC;
209 ext3_mark_inode_dirty(handle, inode); 207 ext3_mark_inode_dirty(handle, inode);
210 if (error == 0) 208 if (error == 0)
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index 74e469ccdf50..a5c29bb3b835 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -198,12 +198,10 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
198 case ACL_TYPE_ACCESS: 198 case ACL_TYPE_ACCESS:
199 name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; 199 name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
200 if (acl) { 200 if (acl) {
201 mode_t mode = inode->i_mode; 201 error = posix_acl_equiv_mode(acl, &inode->i_mode);
202 error = posix_acl_equiv_mode(acl, &mode);
203 if (error < 0) 202 if (error < 0)
204 return error; 203 return error;
205 else { 204 else {
206 inode->i_mode = mode;
207 inode->i_ctime = ext4_current_time(inode); 205 inode->i_ctime = ext4_current_time(inode);
208 ext4_mark_inode_dirty(handle, inode); 206 ext4_mark_inode_dirty(handle, inode);
209 if (error == 0) 207 if (error == 0)
diff --git a/fs/generic_acl.c b/fs/generic_acl.c
index 2dd434d6ff29..d0dddaceac59 100644
--- a/fs/generic_acl.c
+++ b/fs/generic_acl.c
@@ -82,18 +82,14 @@ generic_acl_set(struct dentry *dentry, const char *name, const void *value,
82 return PTR_ERR(acl); 82 return PTR_ERR(acl);
83 } 83 }
84 if (acl) { 84 if (acl) {
85 mode_t mode;
86
87 error = posix_acl_valid(acl); 85 error = posix_acl_valid(acl);
88 if (error) 86 if (error)
89 goto failed; 87 goto failed;
90 switch (type) { 88 switch (type) {
91 case ACL_TYPE_ACCESS: 89 case ACL_TYPE_ACCESS:
92 mode = inode->i_mode; 90 error = posix_acl_equiv_mode(acl, &inode->i_mode);
93 error = posix_acl_equiv_mode(acl, &mode);
94 if (error < 0) 91 if (error < 0)
95 goto failed; 92 goto failed;
96 inode->i_mode = mode;
97 inode->i_ctime = CURRENT_TIME; 93 inode->i_ctime = CURRENT_TIME;
98 if (error == 0) { 94 if (error == 0) {
99 posix_acl_release(acl); 95 posix_acl_release(acl);
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 0ac3c53f928f..34501b64bc47 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -276,7 +276,7 @@ static int gfs2_xattr_system_set(struct dentry *dentry, const char *name,
276 goto out_release; 276 goto out_release;
277 277
278 if (type == ACL_TYPE_ACCESS) { 278 if (type == ACL_TYPE_ACCESS) {
279 mode_t mode = inode->i_mode; 279 umode_t mode = inode->i_mode;
280 error = posix_acl_equiv_mode(acl, &mode); 280 error = posix_acl_equiv_mode(acl, &mode);
281 281
282 if (error <= 0) { 282 if (error <= 0) {
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 6372a84728d7..926d02068a14 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -227,7 +227,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
227 case ACL_TYPE_ACCESS: 227 case ACL_TYPE_ACCESS:
228 xprefix = JFFS2_XPREFIX_ACL_ACCESS; 228 xprefix = JFFS2_XPREFIX_ACL_ACCESS;
229 if (acl) { 229 if (acl) {
230 mode_t mode = inode->i_mode; 230 umode_t mode = inode->i_mode;
231 rc = posix_acl_equiv_mode(acl, &mode); 231 rc = posix_acl_equiv_mode(acl, &mode);
232 if (rc < 0) 232 if (rc < 0)
233 return rc; 233 return rc;
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
index 24838f1eeee5..e87fedef23db 100644
--- a/fs/jfs/xattr.c
+++ b/fs/jfs/xattr.c
@@ -693,8 +693,7 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
693 return rc; 693 return rc;
694 } 694 }
695 if (acl) { 695 if (acl) {
696 mode_t mode = inode->i_mode; 696 rc = posix_acl_equiv_mode(acl, &inode->i_mode);
697 rc = posix_acl_equiv_mode(acl, &mode);
698 posix_acl_release(acl); 697 posix_acl_release(acl);
699 if (rc < 0) { 698 if (rc < 0) {
700 printk(KERN_ERR 699 printk(KERN_ERR
@@ -702,7 +701,6 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
702 rc); 701 rc);
703 return rc; 702 return rc;
704 } 703 }
705 inode->i_mode = mode;
706 mark_inode_dirty(inode); 704 mark_inode_dirty(inode);
707 } 705 }
708 /* 706 /*
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
index fbafc6e36e25..a7219075b4de 100644
--- a/fs/ocfs2/acl.c
+++ b/fs/ocfs2/acl.c
@@ -247,7 +247,7 @@ static int ocfs2_set_acl(handle_t *handle,
247 case ACL_TYPE_ACCESS: 247 case ACL_TYPE_ACCESS:
248 name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS; 248 name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS;
249 if (acl) { 249 if (acl) {
250 mode_t mode = inode->i_mode; 250 umode_t mode = inode->i_mode;
251 ret = posix_acl_equiv_mode(acl, &mode); 251 ret = posix_acl_equiv_mode(acl, &mode);
252 if (ret < 0) 252 if (ret < 0)
253 return ret; 253 return ret;
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index f0a017edee1e..3d943be6761c 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -149,10 +149,10 @@ posix_acl_valid(const struct posix_acl *acl)
149 * file mode permission bits, or else 1. Returns -E... on error. 149 * file mode permission bits, or else 1. Returns -E... on error.
150 */ 150 */
151int 151int
152posix_acl_equiv_mode(const struct posix_acl *acl, mode_t *mode_p) 152posix_acl_equiv_mode(const struct posix_acl *acl, umode_t *mode_p)
153{ 153{
154 const struct posix_acl_entry *pa, *pe; 154 const struct posix_acl_entry *pa, *pe;
155 mode_t mode = 0; 155 umode_t mode = 0;
156 int not_equiv = 0; 156 int not_equiv = 0;
157 157
158 FOREACH_ACL_ENTRY(pa, acl, pe) { 158 FOREACH_ACL_ENTRY(pa, acl, pe) {
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 89ebc77e0e9a..6da0396e5052 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -272,12 +272,10 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
272 case ACL_TYPE_ACCESS: 272 case ACL_TYPE_ACCESS:
273 name = POSIX_ACL_XATTR_ACCESS; 273 name = POSIX_ACL_XATTR_ACCESS;
274 if (acl) { 274 if (acl) {
275 mode_t mode = inode->i_mode; 275 error = posix_acl_equiv_mode(acl, &inode->i_mode);
276 error = posix_acl_equiv_mode(acl, &mode);
277 if (error < 0) 276 if (error < 0)
278 return error; 277 return error;
279 else { 278 else {
280 inode->i_mode = mode;
281 if (error == 0) 279 if (error == 0)
282 acl = NULL; 280 acl = NULL;
283 } 281 }
diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c
index bb85500e0b88..b6c4b3795c4a 100644
--- a/fs/xfs/linux-2.6/xfs_acl.c
+++ b/fs/xfs/linux-2.6/xfs_acl.c
@@ -381,7 +381,7 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name,
381 goto out_release; 381 goto out_release;
382 382
383 if (type == ACL_TYPE_ACCESS) { 383 if (type == ACL_TYPE_ACCESS) {
384 mode_t mode = inode->i_mode; 384 umode_t mode = inode->i_mode;
385 error = posix_acl_equiv_mode(acl, &mode); 385 error = posix_acl_equiv_mode(acl, &mode);
386 386
387 if (error <= 0) { 387 if (error <= 0) {