git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nilfs2: fix bh leak in nilfs_cpfile_delete_checkpoints function
[safe/jmp/linux-2.6]
/
fs
/
posix_acl.c
diff --git
a/fs/posix_acl.c
b/fs/posix_acl.c
index
296480e
..
39df95a
100644
(file)
--- a/
fs/posix_acl.c
+++ b/
fs/posix_acl.c
@@
-35,7
+35,7
@@
EXPORT_SYMBOL(posix_acl_permission);
* Allocate a new ACL with the specified number of entries.
*/
struct posix_acl *
* Allocate a new ACL with the specified number of entries.
*/
struct posix_acl *
-posix_acl_alloc(int count,
unsigned int __nocas
t flags)
+posix_acl_alloc(int count,
gfp_
t flags)
{
const size_t size = sizeof(struct posix_acl) +
count * sizeof(struct posix_acl_entry);
{
const size_t size = sizeof(struct posix_acl) +
count * sizeof(struct posix_acl_entry);
@@
-51,18
+51,16
@@
posix_acl_alloc(int count, unsigned int __nocast flags)
* Clone an ACL.
*/
struct posix_acl *
* Clone an ACL.
*/
struct posix_acl *
-posix_acl_clone(const struct posix_acl *acl,
unsigned int __nocas
t flags)
+posix_acl_clone(const struct posix_acl *acl,
gfp_
t flags)
{
struct posix_acl *clone = NULL;
if (acl) {
int size = sizeof(struct posix_acl) + acl->a_count *
sizeof(struct posix_acl_entry);
{
struct posix_acl *clone = NULL;
if (acl) {
int size = sizeof(struct posix_acl) + acl->a_count *
sizeof(struct posix_acl_entry);
- clone = kmalloc(size, flags);
- if (clone) {
- memcpy(clone, acl, size);
+ clone = kmemdup(acl, size, flags);
+ if (clone)
atomic_set(&clone->a_refcount, 1);
atomic_set(&clone->a_refcount, 1);
- }
}
return clone;
}
}
return clone;
}
@@
-185,7
+183,7
@@
posix_acl_equiv_mode(const struct posix_acl *acl, mode_t *mode_p)
* Create an ACL representing the file mode permission bits of an inode.
*/
struct posix_acl *
* Create an ACL representing the file mode permission bits of an inode.
*/
struct posix_acl *
-posix_acl_from_mode(mode_t mode,
unsigned int __nocas
t flags)
+posix_acl_from_mode(mode_t mode,
gfp_
t flags)
{
struct posix_acl *acl = posix_acl_alloc(3, flags);
if (!acl)
{
struct posix_acl *acl = posix_acl_alloc(3, flags);
if (!acl)
@@
-219,11
+217,11
@@
posix_acl_permission(struct inode *inode, const struct posix_acl *acl, int want)
switch(pa->e_tag) {
case ACL_USER_OBJ:
/* (May have been checked already) */
switch(pa->e_tag) {
case ACL_USER_OBJ:
/* (May have been checked already) */
-
if (inode->i_uid == current->fsuid
)
+
if (inode->i_uid == current_fsuid()
)
goto check_perm;
break;
case ACL_USER:
goto check_perm;
break;
case ACL_USER:
-
if (pa->e_id == current->fsuid
)
+
if (pa->e_id == current_fsuid()
)
goto mask;
break;
case ACL_GROUP_OBJ:
goto mask;
break;
case ACL_GROUP_OBJ: