diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-09-01 10:02:43 -0400 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-09-01 10:02:43 -0400 |
commit | 4f4b401bfaa97edbea41a1fcab794148e7ac0421 (patch) | |
tree | d58dcf9d90e15364398a3a4584f2892439295b64 /fs/jfs/acl.c | |
parent | b1b5d7f9b7ac6a8e3452ac43a53eebf69fdf5a77 (diff) |
JFS: allow extended attributes to be set within a existing transaction
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'fs/jfs/acl.c')
-rw-r--r-- | fs/jfs/acl.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index e892dab40c26..461e4934ca7c 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/quotaops.h> | 23 | #include <linux/quotaops.h> |
24 | #include <linux/posix_acl_xattr.h> | 24 | #include <linux/posix_acl_xattr.h> |
25 | #include "jfs_incore.h" | 25 | #include "jfs_incore.h" |
26 | #include "jfs_txnmgr.h" | ||
26 | #include "jfs_xattr.h" | 27 | #include "jfs_xattr.h" |
27 | #include "jfs_acl.h" | 28 | #include "jfs_acl.h" |
28 | 29 | ||
@@ -75,7 +76,8 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type) | |||
75 | return acl; | 76 | return acl; |
76 | } | 77 | } |
77 | 78 | ||
78 | static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) | 79 | static int jfs_set_acl(tid_t tid, struct inode *inode, int type, |
80 | struct posix_acl *acl) | ||
79 | { | 81 | { |
80 | char *ea_name; | 82 | char *ea_name; |
81 | struct jfs_inode_info *ji = JFS_IP(inode); | 83 | struct jfs_inode_info *ji = JFS_IP(inode); |
@@ -110,7 +112,7 @@ static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
110 | if (rc < 0) | 112 | if (rc < 0) |
111 | goto out; | 113 | goto out; |
112 | } | 114 | } |
113 | rc = __jfs_setxattr(inode, ea_name, value, size, 0); | 115 | rc = __jfs_setxattr(tid, inode, ea_name, value, size, 0); |
114 | out: | 116 | out: |
115 | kfree(value); | 117 | kfree(value); |
116 | 118 | ||
@@ -143,7 +145,7 @@ int jfs_permission(struct inode *inode, int mask, struct nameidata *nd) | |||
143 | return generic_permission(inode, mask, jfs_check_acl); | 145 | return generic_permission(inode, mask, jfs_check_acl); |
144 | } | 146 | } |
145 | 147 | ||
146 | int jfs_init_acl(struct inode *inode, struct inode *dir) | 148 | int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) |
147 | { | 149 | { |
148 | struct posix_acl *acl = NULL; | 150 | struct posix_acl *acl = NULL; |
149 | struct posix_acl *clone; | 151 | struct posix_acl *clone; |
@@ -159,7 +161,7 @@ int jfs_init_acl(struct inode *inode, struct inode *dir) | |||
159 | 161 | ||
160 | if (acl) { | 162 | if (acl) { |
161 | if (S_ISDIR(inode->i_mode)) { | 163 | if (S_ISDIR(inode->i_mode)) { |
162 | rc = jfs_set_acl(inode, ACL_TYPE_DEFAULT, acl); | 164 | rc = jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, acl); |
163 | if (rc) | 165 | if (rc) |
164 | goto cleanup; | 166 | goto cleanup; |
165 | } | 167 | } |
@@ -173,7 +175,8 @@ int jfs_init_acl(struct inode *inode, struct inode *dir) | |||
173 | if (rc >= 0) { | 175 | if (rc >= 0) { |
174 | inode->i_mode = mode; | 176 | inode->i_mode = mode; |
175 | if (rc > 0) | 177 | if (rc > 0) |
176 | rc = jfs_set_acl(inode, ACL_TYPE_ACCESS, clone); | 178 | rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, |
179 | clone); | ||
177 | } | 180 | } |
178 | posix_acl_release(clone); | 181 | posix_acl_release(clone); |
179 | cleanup: | 182 | cleanup: |
@@ -202,8 +205,15 @@ static int jfs_acl_chmod(struct inode *inode) | |||
202 | return -ENOMEM; | 205 | return -ENOMEM; |
203 | 206 | ||
204 | rc = posix_acl_chmod_masq(clone, inode->i_mode); | 207 | rc = posix_acl_chmod_masq(clone, inode->i_mode); |
205 | if (!rc) | 208 | if (!rc) { |
206 | rc = jfs_set_acl(inode, ACL_TYPE_ACCESS, clone); | 209 | tid_t tid = txBegin(inode->i_sb, 0); |
210 | down(&JFS_IP(inode)->commit_sem); | ||
211 | rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, clone); | ||
212 | if (!rc) | ||
213 | rc = txCommit(tid, 1, &inode, 0); | ||
214 | txEnd(tid); | ||
215 | up(&JFS_IP(inode)->commit_sem); | ||
216 | } | ||
207 | 217 | ||
208 | posix_acl_release(clone); | 218 | posix_acl_release(clone); |
209 | return rc; | 219 | return rc; |