diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-08 19:50:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 08:15:27 -0400 |
commit | f19d4a8fa6f9b6ccf54df0971c97ffcaa390b7b0 (patch) | |
tree | 552854efb57cce365c4db585f1009946aeb03062 | |
parent | 3e63cbb1efca7dd3137de1bb475e2e068e38ef23 (diff) |
add caching of ACLs in struct inode
No helpers, no conversions yet.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/inode.c | 10 | ||||
-rw-r--r-- | include/linux/fs.h | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c index f643be565df8..e193cd592fa8 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/fsnotify.h> | 25 | #include <linux/fsnotify.h> |
26 | #include <linux/mount.h> | 26 | #include <linux/mount.h> |
27 | #include <linux/async.h> | 27 | #include <linux/async.h> |
28 | #include <linux/posix_acl.h> | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * This is needed for the following functions: | 31 | * This is needed for the following functions: |
@@ -189,6 +190,9 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode) | |||
189 | } | 190 | } |
190 | inode->i_private = NULL; | 191 | inode->i_private = NULL; |
191 | inode->i_mapping = mapping; | 192 | inode->i_mapping = mapping; |
193 | #ifdef CONFIG_FS_POSIX_ACL | ||
194 | inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; | ||
195 | #endif | ||
192 | 196 | ||
193 | #ifdef CONFIG_FSNOTIFY | 197 | #ifdef CONFIG_FSNOTIFY |
194 | inode->i_fsnotify_mask = 0; | 198 | inode->i_fsnotify_mask = 0; |
@@ -227,6 +231,12 @@ void destroy_inode(struct inode *inode) | |||
227 | ima_inode_free(inode); | 231 | ima_inode_free(inode); |
228 | security_inode_free(inode); | 232 | security_inode_free(inode); |
229 | fsnotify_inode_delete(inode); | 233 | fsnotify_inode_delete(inode); |
234 | #ifdef CONFIG_FS_POSIX_ACL | ||
235 | if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED) | ||
236 | posix_acl_release(inode->i_acl); | ||
237 | if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED) | ||
238 | posix_acl_release(inode->i_default_acl); | ||
239 | #endif | ||
230 | if (inode->i_sb->s_op->destroy_inode) | 240 | if (inode->i_sb->s_op->destroy_inode) |
231 | inode->i_sb->s_op->destroy_inode(inode); | 241 | inode->i_sb->s_op->destroy_inode(inode); |
232 | else | 242 | else |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 79e302ddde0f..0872372184fe 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -710,6 +710,9 @@ static inline int mapping_writably_mapped(struct address_space *mapping) | |||
710 | #define i_size_ordered_init(inode) do { } while (0) | 710 | #define i_size_ordered_init(inode) do { } while (0) |
711 | #endif | 711 | #endif |
712 | 712 | ||
713 | struct posix_acl; | ||
714 | #define ACL_NOT_CACHED ((void *)(-1)) | ||
715 | |||
713 | struct inode { | 716 | struct inode { |
714 | struct hlist_node i_hash; | 717 | struct hlist_node i_hash; |
715 | struct list_head i_list; | 718 | struct list_head i_list; |
@@ -773,6 +776,10 @@ struct inode { | |||
773 | #ifdef CONFIG_SECURITY | 776 | #ifdef CONFIG_SECURITY |
774 | void *i_security; | 777 | void *i_security; |
775 | #endif | 778 | #endif |
779 | #ifdef CONFIG_FS_POSIX_ACL | ||
780 | struct posix_acl *i_acl; | ||
781 | struct posix_acl *i_default_acl; | ||
782 | #endif | ||
776 | void *i_private; /* fs or device private pointer */ | 783 | void *i_private; /* fs or device private pointer */ |
777 | }; | 784 | }; |
778 | 785 | ||