]>
Commit | Line | Data |
---|---|---|
08e0e7c8 | 1 | /* AFS common types |
1da177e4 | 2 | * |
08e0e7c8 | 3 | * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved. |
1da177e4 LT |
4 | * Written by David Howells (dhowells@redhat.com) |
5 | * | |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public License | |
8 | * as published by the Free Software Foundation; either version | |
9 | * 2 of the License, or (at your option) any later version. | |
10 | */ | |
11 | ||
08e0e7c8 DH |
12 | #ifndef AFS_H |
13 | #define AFS_H | |
1da177e4 | 14 | |
08e0e7c8 | 15 | #include <linux/in.h> |
1da177e4 LT |
16 | |
17 | typedef unsigned afs_volid_t; | |
18 | typedef unsigned afs_vnodeid_t; | |
19 | typedef unsigned long long afs_dataversion_t; | |
20 | ||
21 | typedef enum { | |
22 | AFSVL_RWVOL, /* read/write volume */ | |
23 | AFSVL_ROVOL, /* read-only volume */ | |
24 | AFSVL_BACKVOL, /* backup volume */ | |
25 | } __attribute__((packed)) afs_voltype_t; | |
26 | ||
27 | typedef enum { | |
28 | AFS_FTYPE_INVALID = 0, | |
29 | AFS_FTYPE_FILE = 1, | |
30 | AFS_FTYPE_DIR = 2, | |
31 | AFS_FTYPE_SYMLINK = 3, | |
32 | } afs_file_type_t; | |
33 | ||
1da177e4 LT |
34 | /* |
35 | * AFS file identifier | |
36 | */ | |
ec26815a | 37 | struct afs_fid { |
1da177e4 LT |
38 | afs_volid_t vid; /* volume ID */ |
39 | afs_vnodeid_t vnode; /* file index within volume */ | |
40 | unsigned unique; /* unique ID number (file index version) */ | |
41 | }; | |
42 | ||
1da177e4 LT |
43 | /* |
44 | * AFS callback notification | |
45 | */ | |
46 | typedef enum { | |
47 | AFSCM_CB_UNTYPED = 0, /* no type set on CB break */ | |
48 | AFSCM_CB_EXCLUSIVE = 1, /* CB exclusive to CM [not implemented] */ | |
49 | AFSCM_CB_SHARED = 2, /* CB shared by other CM's */ | |
50 | AFSCM_CB_DROPPED = 3, /* CB promise cancelled by file server */ | |
51 | } afs_callback_type_t; | |
52 | ||
ec26815a | 53 | struct afs_callback { |
1da177e4 LT |
54 | struct afs_fid fid; /* file identifier */ |
55 | unsigned version; /* callback version */ | |
56 | unsigned expiry; /* time at which expires */ | |
57 | afs_callback_type_t type; /* type of callback */ | |
58 | }; | |
59 | ||
08e0e7c8 | 60 | #define AFSCBMAX 50 /* maximum callbacks transferred per bulk op */ |
1da177e4 | 61 | |
1da177e4 LT |
62 | /* |
63 | * AFS volume information | |
64 | */ | |
ec26815a | 65 | struct afs_volume_info { |
1da177e4 LT |
66 | afs_volid_t vid; /* volume ID */ |
67 | afs_voltype_t type; /* type of this volume */ | |
68 | afs_volid_t type_vids[5]; /* volume ID's for possible types for this vol */ | |
08e0e7c8 | 69 | |
1da177e4 LT |
70 | /* list of fileservers serving this volume */ |
71 | size_t nservers; /* number of entries used in servers[] */ | |
72 | struct { | |
73 | struct in_addr addr; /* fileserver address */ | |
74 | } servers[8]; | |
75 | }; | |
76 | ||
1da177e4 LT |
77 | /* |
78 | * AFS file status information | |
79 | */ | |
ec26815a | 80 | struct afs_file_status { |
1da177e4 LT |
81 | unsigned if_version; /* interface version */ |
82 | #define AFS_FSTATUS_VERSION 1 | |
83 | ||
84 | afs_file_type_t type; /* file type */ | |
85 | unsigned nlink; /* link count */ | |
86 | size_t size; /* file size */ | |
08e0e7c8 | 87 | afs_dataversion_t data_version; /* current data version */ |
1da177e4 LT |
88 | unsigned author; /* author ID */ |
89 | unsigned owner; /* owner ID */ | |
90 | unsigned caller_access; /* access rights for authenticated caller */ | |
91 | unsigned anon_access; /* access rights for unauthenticated caller */ | |
92 | umode_t mode; /* UNIX mode */ | |
93 | struct afs_fid parent; /* parent file ID */ | |
94 | time_t mtime_client; /* last time client changed data */ | |
95 | time_t mtime_server; /* last time server changed data */ | |
96 | }; | |
97 | ||
1da177e4 LT |
98 | /* |
99 | * AFS volume synchronisation information | |
100 | */ | |
ec26815a | 101 | struct afs_volsync { |
1da177e4 LT |
102 | time_t creation; /* volume creation time */ |
103 | }; | |
104 | ||
08e0e7c8 | 105 | #endif /* AFS_H */ |