prototypes/types for discussion Was: [AFS3-std] File Server/Cache
Manager Extended Status Information
Matt Benjamin
matt@linuxbox.com
Mon, 14 Apr 2008 09:55:08 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Based on comments made in the previous round of discussion, which seems
now to have died down, I'd like to suggest an interface for further
discussion.
The intention is not to innovate beyond the ideas for which there
appeared to be consensus (supporting snippet included).
Thanks to Tom Kaiser, for initial check-over and comments.
Thanks,
Matt
#include "common.xg" /*Common structures & definitions*/
%#ifdef KERNEL
%#include "../afs/longc_procs.h"
%#endif
package RXAFSCB_
prefix S
statindex 6
/* the following notifications are specified not to break
~ * the file server's promise to call back the client */
const AFSCB_Event_StoreData = 1; /* data in file changed */
const AFSCB_Event_StoreACL = 2; /* ACL changed on directory */
const AFSCB_Event_StoreStatus = 3; /* */
const AFSCB_Event_CreateFile = 4; /* with following, changes in */
const AFSCB_Event_RemoveFile = 5; /* directory vnode */
const AFSCB_Event_RenameFile = 6;
const AFSCB_Event_Symlink = 7;
const AFSCB_Event_Link = 8;
const AFSCB_Event_MakeDir = 9;
const AFSCB_Event_RemoveDir = 10;
const AFSCB_Event_ReleaseLock = 11; /* traditional AFS lock released */
/* the following notifications are specified to break the file
~ * server's promise to call back the client */
const AFSCB_Event_Cancel = 15; /* CallBack is broken */
/* identical with decl in afsint.xg--this should move to common.xg */
struct AFSStoreStatus {
~ afs_uint32 Mask;
~ afs_uint32 ClientModTime;
~ afs_uint32 Owner;
~ afs_uint32 Group;
~ afs_uint32 UnixModeBits;
~ afs_uint32 SegSize;
};
struct AFSCBRangeData {
~ afs_int64 offset;
afs_int64 length;
};
struct AFSCBNameData {
string name<AFSNAMEMAX>;
};
struct AFSCBNameFidData {
string name<AFSNAMEMAX>;
AFSFid fid;
};
struct AFSCBStatusData {
struct AFSStoreStatus status;
};
struct AFSCBLockData {
afs_uint32 LockType;
};
struct AFSCBRenameData {
string oldname<AFSNAMEMAX>;
string newname<AFSNAMEMAX>;
AFSFid fid;
};
struct AFSCBSymlinkData {
string name<AFSNAMEMAX>;
string linkContents<AFSPATHMAX>;
AFSFid fid;
};
union AFSCB_NotificationData switch (afs_uint32 Event_Type) {
case AFSCB_Event_StoreData:
AFSCBRangeData u_data;
case AFSCB_Event_StoreACL:
void;
case AFSCB_Event_StoreStatus:
AFSCBStatusData u_data;
case AFSCB_Event_CreateFile:
AFSCBNameFidData u_data;
case AFSCB_Event_RemoveFile:
AFSCBNameData u_data;
case AFSCB_Event_Rename:
AFSCBRenameData u_data;
case AFSCB_Event_RemoveDir:
AFSCBNameFidData u_data;
case AFSCB_Event_Symlink:
AFSCBSymlinkData u_data;
case AFSCB_Event_Link:
AFSCBNameFidData u_data;
case AFSCB_Event_MakeDir:
AFSCBNameFidData u_data;
case AFSCB_Event_RemoveDir:
AFSCBNameData u_data;
case AFSCB_Event_MakeDir:
AFSCBNameFidData u_data;
case AFSCB_Event_ReleaseLock:
AFSCBLockData u_data;
case AFSCB_Event_Cancel:
void;
};
struct AFSExtendedCallBack {
~ afs_uint32 newDV;
~ afs_uint32 ExpirationTime;
~ AFSCB_NotificationData data;
};
/* this prototype follows the style of the traditional AFS
~ * CallBack proc, and is not intended to imply any change in
~ * style of invocation in the OpenAFS file server, eg, coalescing
~ * of call backs (though this might be interesting to explore in
~ * future) */
typedef AFSExtendedCallBack AFSExtendedCallBackSeq<AFSCBMAX>;
proc ExtendedCallBack(
~ IN AFSCBFids *Fids_Array,
~ AFSExtendedCallBackSeq *CallBacks_Array
) multi = 65539;
Matt Benjamin wrote:
| Jeffrey Hutzelman wrote:
| | Incidentally, I don't think "union is not currently used" is a good
| | argument for not using it. I'm pretty sure I've actually seen a use
| | outside of AFS, though I can't find it at the moment, but even if there
| | is none, it doesn't matter. If it turns out to be buggy, we'll fix it!
| |
|
| For what there's a "phase 1" consensus on, the union would be ideal, an
| it worked. I'll give it a try.
|
| (Marcus used XDR unions in his rewrite of the rxk5 tokens stuff but we
| don't have RPCs using them.)
|
| | -- Jeff
|
- --
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104
http://linuxbox.com
tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIA2I8JiSUUSaRdSURCELSAJ41KU47A/bLmDDz3LS8fPtqqzJdEACgmKRH
bsbx8dgccqxFZM+i+Ts9Cac=
=/iij
-----END PGP SIGNATURE-----