2 Copyright (C) 2003 - 2010 Chaskiel Grundman
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 1. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #include <afsconfig.h>
28 #include <afs/param.h>
30 #include <afs/vlserver.h>
31 #include <afs/vldbint.h>
34 #include "afscp_internal.h"
37 afscp_FetchACL(const struct afscp_venusfid
*dir
, struct AFSOpaque
*acl
)
40 struct AFSFid df
= dir
->fid
;
41 struct afscp_volume
*vol
;
42 struct AFSFetchStatus dfst
;
44 struct afscp_server
*server
;
46 vol
= afscp_VolumeById(dir
->cell
, dir
->fid
.Volume
);
52 for (i
= 0; i
< vol
->nservers
; i
++) {
53 server
= afscp_ServerByIndex(vol
->servers
[i
]);
54 if (server
&& server
->naddrs
> 0) {
55 for (j
= 0; j
< server
->naddrs
; j
++) {
56 code
= RXAFS_FetchACL(server
->conns
[j
], &df
, acl
, &dfst
, &vs
);
69 _StatStuff(dir
, &dfst
);
75 afscp_StoreACL(const struct afscp_venusfid
*dir
, struct AFSOpaque
*acl
)
78 struct AFSFid df
= dir
->fid
;
79 struct afscp_volume
*vol
;
80 struct AFSFetchStatus dfst
;
82 struct afscp_server
*server
;
84 vol
= afscp_VolumeById(dir
->cell
, dir
->fid
.Volume
);
90 for (i
= 0; i
< vol
->nservers
; i
++) {
91 server
= afscp_ServerByIndex(vol
->servers
[i
]);
92 if (server
&& server
->naddrs
> 0) {
93 for (j
= 0; j
< server
->naddrs
; j
++) {
94 code
= RXAFS_StoreACL(server
->conns
[j
], &df
, acl
, &dfst
, &vs
);
103 _StatInvalidate(dir
);
107 _StatStuff(dir
, &dfst
);