diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-08 19:55:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 08:17:05 -0400 |
commit | 5affd88a104af43f0063a12ad1ee4c7a587945dc (patch) | |
tree | 95c727eac8669bd346f937b8be2d58ef716a2fe5 /fs/btrfs | |
parent | 290c263bf83cd78e53b1aa3b42165f588163f2be (diff) |
switch btrfs to inode->i_acl
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/acl.c | 14 | ||||
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 4 | ||||
-rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 16 |
4 files changed, 9 insertions, 27 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 603972576f0f..6db8a42a3e5e 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -34,7 +34,7 @@ static void btrfs_update_cached_acl(struct inode *inode, | |||
34 | struct posix_acl *acl) | 34 | struct posix_acl *acl) |
35 | { | 35 | { |
36 | spin_lock(&inode->i_lock); | 36 | spin_lock(&inode->i_lock); |
37 | if (*p_acl && *p_acl != BTRFS_ACL_NOT_CACHED) | 37 | if (*p_acl && *p_acl != ACL_NOT_CACHED) |
38 | posix_acl_release(*p_acl); | 38 | posix_acl_release(*p_acl); |
39 | *p_acl = posix_acl_dup(acl); | 39 | *p_acl = posix_acl_dup(acl); |
40 | spin_unlock(&inode->i_lock); | 40 | spin_unlock(&inode->i_lock); |
@@ -50,11 +50,11 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | |||
50 | switch (type) { | 50 | switch (type) { |
51 | case ACL_TYPE_ACCESS: | 51 | case ACL_TYPE_ACCESS: |
52 | name = POSIX_ACL_XATTR_ACCESS; | 52 | name = POSIX_ACL_XATTR_ACCESS; |
53 | p_acl = &BTRFS_I(inode)->i_acl; | 53 | p_acl = &inode->i_acl; |
54 | break; | 54 | break; |
55 | case ACL_TYPE_DEFAULT: | 55 | case ACL_TYPE_DEFAULT: |
56 | name = POSIX_ACL_XATTR_DEFAULT; | 56 | name = POSIX_ACL_XATTR_DEFAULT; |
57 | p_acl = &BTRFS_I(inode)->i_default_acl; | 57 | p_acl = &inode->i_default_acl; |
58 | break; | 58 | break; |
59 | default: | 59 | default: |
60 | return ERR_PTR(-EINVAL); | 60 | return ERR_PTR(-EINVAL); |
@@ -67,11 +67,11 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | |||
67 | 67 | ||
68 | spin_lock(&inode->i_lock); | 68 | spin_lock(&inode->i_lock); |
69 | acl = *p_acl; | 69 | acl = *p_acl; |
70 | if (acl != BTRFS_ACL_NOT_CACHED) | 70 | if (acl != ACL_NOT_CACHED) |
71 | acl = posix_acl_dup(acl); | 71 | acl = posix_acl_dup(acl); |
72 | spin_unlock(&inode->i_lock); | 72 | spin_unlock(&inode->i_lock); |
73 | 73 | ||
74 | if (acl != BTRFS_ACL_NOT_CACHED) | 74 | if (acl != ACL_NOT_CACHED) |
75 | return acl; | 75 | return acl; |
76 | 76 | ||
77 | size = __btrfs_getxattr(inode, name, "", 0); | 77 | size = __btrfs_getxattr(inode, name, "", 0); |
@@ -141,13 +141,13 @@ static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
141 | ret = 0; | 141 | ret = 0; |
142 | inode->i_mode = mode; | 142 | inode->i_mode = mode; |
143 | name = POSIX_ACL_XATTR_ACCESS; | 143 | name = POSIX_ACL_XATTR_ACCESS; |
144 | p_acl = &BTRFS_I(inode)->i_acl; | 144 | p_acl = &inode->i_acl; |
145 | break; | 145 | break; |
146 | case ACL_TYPE_DEFAULT: | 146 | case ACL_TYPE_DEFAULT: |
147 | if (!S_ISDIR(inode->i_mode)) | 147 | if (!S_ISDIR(inode->i_mode)) |
148 | return acl ? -EINVAL : 0; | 148 | return acl ? -EINVAL : 0; |
149 | name = POSIX_ACL_XATTR_DEFAULT; | 149 | name = POSIX_ACL_XATTR_DEFAULT; |
150 | p_acl = &BTRFS_I(inode)->i_default_acl; | 150 | p_acl = &inode->i_default_acl; |
151 | break; | 151 | break; |
152 | default: | 152 | default: |
153 | return -EINVAL; | 153 | return -EINVAL; |
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index acb4f3517582..ea1ea0af8c0e 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
@@ -53,10 +53,6 @@ struct btrfs_inode { | |||
53 | /* used to order data wrt metadata */ | 53 | /* used to order data wrt metadata */ |
54 | struct btrfs_ordered_inode_tree ordered_tree; | 54 | struct btrfs_ordered_inode_tree ordered_tree; |
55 | 55 | ||
56 | /* standard acl pointers */ | ||
57 | struct posix_acl *i_acl; | ||
58 | struct posix_acl *i_default_acl; | ||
59 | |||
60 | /* for keeping track of orphaned inodes */ | 56 | /* for keeping track of orphaned inodes */ |
61 | struct list_head i_orphan; | 57 | struct list_head i_orphan; |
62 | 58 | ||
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 03441a99ea38..2779c2f5360a 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -41,8 +41,6 @@ struct btrfs_ordered_sum; | |||
41 | 41 | ||
42 | #define BTRFS_MAGIC "_BHRfS_M" | 42 | #define BTRFS_MAGIC "_BHRfS_M" |
43 | 43 | ||
44 | #define BTRFS_ACL_NOT_CACHED ((void *)-1) | ||
45 | |||
46 | #define BTRFS_MAX_LEVEL 8 | 44 | #define BTRFS_MAX_LEVEL 8 |
47 | 45 | ||
48 | #define BTRFS_COMPAT_EXTENT_TREE_V0 | 46 | #define BTRFS_COMPAT_EXTENT_TREE_V0 |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8612b3a09811..78ad38ddd01f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -2123,8 +2123,8 @@ static void btrfs_read_locked_inode(struct inode *inode) | |||
2123 | */ | 2123 | */ |
2124 | maybe_acls = acls_after_inode_item(leaf, path->slots[0], inode->i_ino); | 2124 | maybe_acls = acls_after_inode_item(leaf, path->slots[0], inode->i_ino); |
2125 | if (!maybe_acls) { | 2125 | if (!maybe_acls) { |
2126 | BTRFS_I(inode)->i_acl = NULL; | 2126 | inode->i_acl = NULL; |
2127 | BTRFS_I(inode)->i_default_acl = NULL; | 2127 | inode->i_default_acl = NULL; |
2128 | } | 2128 | } |
2129 | 2129 | ||
2130 | BTRFS_I(inode)->block_group = btrfs_find_block_group(root, 0, | 2130 | BTRFS_I(inode)->block_group = btrfs_find_block_group(root, 0, |
@@ -3141,9 +3141,6 @@ static noinline void init_btrfs_i(struct inode *inode) | |||
3141 | { | 3141 | { |
3142 | struct btrfs_inode *bi = BTRFS_I(inode); | 3142 | struct btrfs_inode *bi = BTRFS_I(inode); |
3143 | 3143 | ||
3144 | bi->i_acl = BTRFS_ACL_NOT_CACHED; | ||
3145 | bi->i_default_acl = BTRFS_ACL_NOT_CACHED; | ||
3146 | |||
3147 | bi->generation = 0; | 3144 | bi->generation = 0; |
3148 | bi->sequence = 0; | 3145 | bi->sequence = 0; |
3149 | bi->last_trans = 0; | 3146 | bi->last_trans = 0; |
@@ -4640,8 +4637,6 @@ struct inode *btrfs_alloc_inode(struct super_block *sb) | |||
4640 | ei->last_trans = 0; | 4637 | ei->last_trans = 0; |
4641 | ei->logged_trans = 0; | 4638 | ei->logged_trans = 0; |
4642 | btrfs_ordered_inode_tree_init(&ei->ordered_tree); | 4639 | btrfs_ordered_inode_tree_init(&ei->ordered_tree); |
4643 | ei->i_acl = BTRFS_ACL_NOT_CACHED; | ||
4644 | ei->i_default_acl = BTRFS_ACL_NOT_CACHED; | ||
4645 | INIT_LIST_HEAD(&ei->i_orphan); | 4640 | INIT_LIST_HEAD(&ei->i_orphan); |
4646 | INIT_LIST_HEAD(&ei->ordered_operations); | 4641 | INIT_LIST_HEAD(&ei->ordered_operations); |
4647 | return &ei->vfs_inode; | 4642 | return &ei->vfs_inode; |
@@ -4655,13 +4650,6 @@ void btrfs_destroy_inode(struct inode *inode) | |||
4655 | WARN_ON(!list_empty(&inode->i_dentry)); | 4650 | WARN_ON(!list_empty(&inode->i_dentry)); |
4656 | WARN_ON(inode->i_data.nrpages); | 4651 | WARN_ON(inode->i_data.nrpages); |
4657 | 4652 | ||
4658 | if (BTRFS_I(inode)->i_acl && | ||
4659 | BTRFS_I(inode)->i_acl != BTRFS_ACL_NOT_CACHED) | ||
4660 | posix_acl_release(BTRFS_I(inode)->i_acl); | ||
4661 | if (BTRFS_I(inode)->i_default_acl && | ||
4662 | BTRFS_I(inode)->i_default_acl != BTRFS_ACL_NOT_CACHED) | ||
4663 | posix_acl_release(BTRFS_I(inode)->i_default_acl); | ||
4664 | |||
4665 | /* | 4653 | /* |
4666 | * Make sure we're properly removed from the ordered operation | 4654 | * Make sure we're properly removed from the ordered operation |
4667 | * lists. | 4655 | * lists. |