From fd962d6d833c6b18ce6c8d5c1ed0e68199dfffa7 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 8 Jun 2009 19:50:45 -0400 Subject: [PATCH] --- yaml --- r: 154126 b: refs/heads/master c: f19d4a8fa6f9b6ccf54df0971c97ffcaa390b7b0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/inode.c | 10 ++++++++++ trunk/include/linux/fs.h | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ab953dd17afe..0fc0791f7d02 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3e63cbb1efca7dd3137de1bb475e2e068e38ef23 +refs/heads/master: f19d4a8fa6f9b6ccf54df0971c97ffcaa390b7b0 diff --git a/trunk/fs/inode.c b/trunk/fs/inode.c index f643be565df8..e193cd592fa8 100644 --- a/trunk/fs/inode.c +++ b/trunk/fs/inode.c @@ -25,6 +25,7 @@ #include #include #include +#include /* * 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 diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index 79e302ddde0f..0872372184fe 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -710,6 +710,9 @@ static inline int mapping_writably_mapped(struct address_space *mapping) #define i_size_ordered_init(inode) do { } while (0) #endif +struct posix_acl; +#define ACL_NOT_CACHED ((void *)(-1)) + struct inode { struct hlist_node i_hash; struct list_head i_list; @@ -772,6 +775,10 @@ struct inode { atomic_t i_writecount; #ifdef CONFIG_SECURITY void *i_security; +#endif +#ifdef CONFIG_FS_POSIX_ACL + struct posix_acl *i_acl; + struct posix_acl *i_default_acl; #endif void *i_private; /* fs or device private pointer */ };