diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2009-11-12 04:35:27 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-12-17 12:33:34 -0500 |
commit | f34f57a3ab4e73304d78c125682f1a53cd3975f2 (patch) | |
tree | 359aff6491d3e92b3901ea78dc164d41209d3eea /fs/btrfs/inode.c | |
parent | 8082510e7124cc50d728f1b875639cb4e22312cc (diff) |
Btrfs: Pass transaction handle to security and ACL initialization functions
Pass transaction handle down to security and ACL initialization
functions, so we can avoid starting nested transactions
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index dcec42ee8cf2..82740a3c628a 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -88,13 +88,14 @@ static noinline int cow_file_range(struct inode *inode, | |||
88 | u64 start, u64 end, int *page_started, | 88 | u64 start, u64 end, int *page_started, |
89 | unsigned long *nr_written, int unlock); | 89 | unsigned long *nr_written, int unlock); |
90 | 90 | ||
91 | static int btrfs_init_inode_security(struct inode *inode, struct inode *dir) | 91 | static int btrfs_init_inode_security(struct btrfs_trans_handle *trans, |
92 | struct inode *inode, struct inode *dir) | ||
92 | { | 93 | { |
93 | int err; | 94 | int err; |
94 | 95 | ||
95 | err = btrfs_init_acl(inode, dir); | 96 | err = btrfs_init_acl(trans, inode, dir); |
96 | if (!err) | 97 | if (!err) |
97 | err = btrfs_xattr_security_init(inode, dir); | 98 | err = btrfs_xattr_security_init(trans, inode, dir); |
98 | return err; | 99 | return err; |
99 | } | 100 | } |
100 | 101 | ||
@@ -4296,7 +4297,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry, | |||
4296 | if (IS_ERR(inode)) | 4297 | if (IS_ERR(inode)) |
4297 | goto out_unlock; | 4298 | goto out_unlock; |
4298 | 4299 | ||
4299 | err = btrfs_init_inode_security(inode, dir); | 4300 | err = btrfs_init_inode_security(trans, inode, dir); |
4300 | if (err) { | 4301 | if (err) { |
4301 | drop_inode = 1; | 4302 | drop_inode = 1; |
4302 | goto out_unlock; | 4303 | goto out_unlock; |
@@ -4367,7 +4368,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, | |||
4367 | if (IS_ERR(inode)) | 4368 | if (IS_ERR(inode)) |
4368 | goto out_unlock; | 4369 | goto out_unlock; |
4369 | 4370 | ||
4370 | err = btrfs_init_inode_security(inode, dir); | 4371 | err = btrfs_init_inode_security(trans, inode, dir); |
4371 | if (err) { | 4372 | if (err) { |
4372 | drop_inode = 1; | 4373 | drop_inode = 1; |
4373 | goto out_unlock; | 4374 | goto out_unlock; |
@@ -4500,7 +4501,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
4500 | 4501 | ||
4501 | drop_on_err = 1; | 4502 | drop_on_err = 1; |
4502 | 4503 | ||
4503 | err = btrfs_init_inode_security(inode, dir); | 4504 | err = btrfs_init_inode_security(trans, inode, dir); |
4504 | if (err) | 4505 | if (err) |
4505 | goto out_fail; | 4506 | goto out_fail; |
4506 | 4507 | ||
@@ -5660,7 +5661,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, | |||
5660 | if (IS_ERR(inode)) | 5661 | if (IS_ERR(inode)) |
5661 | goto out_unlock; | 5662 | goto out_unlock; |
5662 | 5663 | ||
5663 | err = btrfs_init_inode_security(inode, dir); | 5664 | err = btrfs_init_inode_security(trans, inode, dir); |
5664 | if (err) { | 5665 | if (err) { |
5665 | drop_inode = 1; | 5666 | drop_inode = 1; |
5666 | goto out_unlock; | 5667 | goto out_unlock; |