summaryrefslogtreecommitdiff
path: root/fs/posix_acl.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-05 20:49:57 (GMT)
committerThomas Gleixner <tglx@linutronix.de>2011-02-05 20:50:05 (GMT)
commit285c1a2c3a5f84ce1c811ab4cb1f8a17466e1a06 (patch)
tree7eb4aeab927a25b6cc82aef21ffd5a4f4866ae4b /fs/posix_acl.c
parent1fb0ef31f428f345a7c3666f8e7444a563edd537 (diff)
parenta9fe8d5fd52ecd17c3f3970bbcf6b3573f831898 (diff)
downloadlinux-fsl-qoriq-285c1a2c3a5f84ce1c811ab4cb1f8a17466e1a06.tar.xz
Merge branch 'irq/urgent' into irq/core
Reason: Get mainline fixes integrated. Further patches conflict with them Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/posix_acl.c')
-rw-r--r--fs/posix_acl.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 39df95a..b1cf6bf 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -22,6 +22,7 @@
#include <linux/errno.h>
+EXPORT_SYMBOL(posix_acl_init);
EXPORT_SYMBOL(posix_acl_alloc);
EXPORT_SYMBOL(posix_acl_clone);
EXPORT_SYMBOL(posix_acl_valid);
@@ -32,6 +33,16 @@ EXPORT_SYMBOL(posix_acl_chmod_masq);
EXPORT_SYMBOL(posix_acl_permission);
/*
+ * Init a fresh posix_acl
+ */
+void
+posix_acl_init(struct posix_acl *acl, int count)
+{
+ atomic_set(&acl->a_refcount, 1);
+ acl->a_count = count;
+}
+
+/*
* Allocate a new ACL with the specified number of entries.
*/
struct posix_acl *
@@ -40,10 +51,8 @@ posix_acl_alloc(int count, gfp_t flags)
const size_t size = sizeof(struct posix_acl) +
count * sizeof(struct posix_acl_entry);
struct posix_acl *acl = kmalloc(size, flags);
- if (acl) {
- atomic_set(&acl->a_refcount, 1);
- acl->a_count = count;
- }
+ if (acl)
+ posix_acl_init(acl, count);
return acl;
}