summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/obdclass/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass/acl.c')
-rw-r--r--drivers/staging/lustre/lustre/obdclass/acl.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c b/drivers/staging/lustre/lustre/obdclass/acl.c
index c2a6702c9f2c..f0bb632a70aa 100644
--- a/drivers/staging/lustre/lustre/obdclass/acl.c
+++ b/drivers/staging/lustre/lustre/obdclass/acl.c
@@ -144,10 +144,9 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
{
int count, i, esize;
ext_acl_xattr_header *new;
- ENTRY;
if (unlikely(size < 0))
- RETURN(ERR_PTR(-EINVAL));
+ return ERR_PTR(-EINVAL);
else if (!size)
count = 0;
else
@@ -155,7 +154,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
esize = CFS_ACL_XATTR_SIZE(count, ext_acl_xattr);
OBD_ALLOC(new, esize);
if (unlikely(new == NULL))
- RETURN(ERR_PTR(-ENOMEM));
+ return ERR_PTR(-ENOMEM);
new->a_count = cpu_to_le32(count);
for (i = 0; i < count; i++) {
@@ -165,7 +164,7 @@ lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size)
new->a_entries[i].e_stat = cpu_to_le32(ES_UNK);
}
- RETURN(new);
+ return new;
}
EXPORT_SYMBOL(lustre_posix_acl_xattr_2ext);
@@ -178,16 +177,15 @@ int lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
int count, i, j, rc = 0;
__u32 id;
posix_acl_xattr_header *new;
- ENTRY;
if (unlikely(size < 0))
- RETURN(-EINVAL);
+ return -EINVAL;
else if (!size)
- RETURN(0);
+ return 0;
OBD_ALLOC(new, size);
if (unlikely(new == NULL))
- RETURN(-ENOMEM);
+ return -ENOMEM;
new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
count = CFS_ACL_XATTR_COUNT(size, posix_acl_xattr);
@@ -228,7 +226,6 @@ int lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
*out = new;
rc = 0;
}
- EXIT;
_out:
if (rc) {
@@ -302,7 +299,6 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
posix_acl_xattr_entry pe = {ACL_MASK, 0, ACL_UNDEFINED_ID};
posix_acl_xattr_header *new;
ext_acl_xattr_entry *ee, ae;
- ENTRY;
lustre_posix_acl_cpu_to_le(&pe, &pe);
ee = lustre_ext_acl_xattr_search(ext_header, &pe, &pos);
@@ -312,7 +308,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
posix_size = CFS_ACL_XATTR_SIZE(posix_count, posix_acl_xattr);
OBD_ALLOC(new, posix_size);
if (unlikely(new == NULL))
- RETURN(-ENOMEM);
+ return -ENOMEM;
new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
for (i = 0, j = 0; i < ext_count; i++) {
@@ -349,7 +345,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
int ori_posix_count;
if (unlikely(size < 0))
- RETURN(-EINVAL);
+ return -EINVAL;
else if (!size)
ori_posix_count = 0;
else
@@ -360,7 +356,7 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
CFS_ACL_XATTR_SIZE(posix_count, posix_acl_xattr);
OBD_ALLOC(new, posix_size);
if (unlikely(new == NULL))
- RETURN(-ENOMEM);
+ return -ENOMEM;
new->a_version = cpu_to_le32(CFS_ACL_XATTR_VERSION);
/* 1. process the unchanged ACL entries
@@ -397,7 +393,6 @@ int lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
*out = new;
rc = 0;
}
- EXIT;
_out:
if (rc) {
@@ -420,10 +415,9 @@ lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
posix_acl_xattr_entry pae;
ext_acl_xattr_header *new;
ext_acl_xattr_entry *ee, eae;
- ENTRY;
if (unlikely(size < 0))
- RETURN(ERR_PTR(-EINVAL));
+ return ERR_PTR(-EINVAL);
else if (!size)
posix_count = 0;
else
@@ -434,7 +428,7 @@ lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
OBD_ALLOC(new, ext_size);
if (unlikely(new == NULL))
- RETURN(ERR_PTR(-ENOMEM));
+ return ERR_PTR(-ENOMEM);
for (i = 0, j = 0; i < posix_count; i++) {
lustre_posix_acl_le_to_cpu(&pae, &posix_header->a_entries[i]);
@@ -532,7 +526,6 @@ lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
new->a_count = cpu_to_le32(j);
/* free unused space. */
rc = lustre_ext_acl_xattr_reduce_space(&new, ext_count);
- EXIT;
out:
if (rc) {