summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-08 19:50:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 08:15:27 -0400
commitf19d4a8fa6f9b6ccf54df0971c97ffcaa390b7b0 (patch)
tree552854efb57cce365c4db585f1009946aeb03062 /fs
parent3e63cbb1efca7dd3137de1bb475e2e068e38ef23 (diff)
downloadop-kernel-dev-f19d4a8fa6f9b6ccf54df0971c97ffcaa390b7b0.zip
op-kernel-dev-f19d4a8fa6f9b6ccf54df0971c97ffcaa390b7b0.tar.gz
add caching of ACLs in struct inode
No helpers, no conversions yet. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/inode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index f643be5..e193cd5 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -25,6 +25,7 @@
#include <linux/fsnotify.h>
#include <linux/mount.h>
#include <linux/async.h>
+#include <linux/posix_acl.h>
/*
* This is needed for the following functions:
@@ -189,6 +190,9 @@ struct inode *inode_init_always(struct super_block *sb, struct inode *inode)
}
inode->i_private = NULL;
inode->i_mapping = mapping;
+#ifdef CONFIG_FS_POSIX_ACL
+ inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED;
+#endif
#ifdef CONFIG_FSNOTIFY
inode->i_fsnotify_mask = 0;
@@ -227,6 +231,12 @@ void destroy_inode(struct inode *inode)
ima_inode_free(inode);
security_inode_free(inode);
fsnotify_inode_delete(inode);
+#ifdef CONFIG_FS_POSIX_ACL
+ if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED)
+ posix_acl_release(inode->i_acl);
+ if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED)
+ posix_acl_release(inode->i_default_acl);
+#endif
if (inode->i_sb->s_op->destroy_inode)
inode->i_sb->s_op->destroy_inode(inode);
else
OpenPOWER on IntegriCloud