aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4acl.c
diff options
context:
space:
mode:
authorJ.Bruce Fields <bfields@fieldses.org>2006-10-04 05:16:13 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:20 -0400
commitf3b64eb6efb1ef46f6629b66a429e7f2b5955003 (patch)
treeac2fa48b848ee63a17d8a6eeed72140bb49e8ff0 /fs/nfsd/nfs4acl.c
parentb548edc2dd9440c561f3302cb9f212ef2d06a8ef (diff)
[PATCH] knfsd: nfsd4: acls: simplify nfs4_acl_nfsv4_to_posix interface
There's no need to handle the case where the caller passes in null for pacl or dpacl; no caller does that, because it would be a dumb thing to do. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfs4acl.c')
-rw-r--r--fs/nfsd/nfs4acl.c48
1 files changed, 21 insertions, 27 deletions
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 59fdd9c1d3ee..105544eac9a3 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -360,39 +360,33 @@ nfs4_acl_nfsv4_to_posix(struct nfs4_acl *acl, struct posix_acl **pacl,
360 if (error < 0) 360 if (error < 0)
361 goto out_acl; 361 goto out_acl;
362 362
363 if (pacl != NULL) { 363 if (acl->naces == 0) {
364 if (acl->naces == 0) { 364 error = -ENODATA;
365 error = -ENODATA; 365 goto try_dpacl;
366 goto try_dpacl;
367 }
368
369 *pacl = _nfsv4_to_posix_one(acl, flags);
370 if (IS_ERR(*pacl)) {
371 error = PTR_ERR(*pacl);
372 *pacl = NULL;
373 goto out_acl;
374 }
375 } 366 }
376 367
368 *pacl = _nfsv4_to_posix_one(acl, flags);
369 if (IS_ERR(*pacl)) {
370 error = PTR_ERR(*pacl);
371 *pacl = NULL;
372 goto out_acl;
373 }
377try_dpacl: 374try_dpacl:
378 if (dpacl != NULL) { 375 if (dacl->naces == 0) {
379 if (dacl->naces == 0) { 376 if (pacl == NULL || *pacl == NULL)
380 if (pacl == NULL || *pacl == NULL) 377 error = -ENODATA;
381 error = -ENODATA; 378 goto out_acl;
382 goto out_acl;
383 }
384
385 error = 0;
386 *dpacl = _nfsv4_to_posix_one(dacl, flags);
387 if (IS_ERR(*dpacl)) {
388 error = PTR_ERR(*dpacl);
389 *dpacl = NULL;
390 goto out_acl;
391 }
392 } 379 }
393 380
381 error = 0;
382 *dpacl = _nfsv4_to_posix_one(dacl, flags);
383 if (IS_ERR(*dpacl)) {
384 error = PTR_ERR(*dpacl);
385 *dpacl = NULL;
386 goto out_acl;
387 }
394out_acl: 388out_acl:
395 if (error && pacl) { 389 if (error) {
396 posix_acl_release(*pacl); 390 posix_acl_release(*pacl);
397 *pacl = NULL; 391 *pacl = NULL;
398 } 392 }