[AFS]: Clean up the AFS sources
[linux-2.6/kvm.git] / fs / afs / types.h
blobdb2b5dc9ff4b3cd034620227b63ad3e07869fff5
1 /* AFS types
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
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.
12 #ifndef AFS_TYPES_H
13 #define AFS_TYPES_H
15 #include <rxrpc/types.h>
17 typedef unsigned afs_volid_t;
18 typedef unsigned afs_vnodeid_t;
19 typedef unsigned long long afs_dataversion_t;
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;
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;
34 struct afs_cell;
35 struct afs_vnode;
38 * AFS file identifier
40 struct afs_fid {
41 afs_volid_t vid; /* volume ID */
42 afs_vnodeid_t vnode; /* file index within volume */
43 unsigned unique; /* unique ID number (file index version) */
47 * AFS callback notification
49 typedef enum {
50 AFSCM_CB_UNTYPED = 0, /* no type set on CB break */
51 AFSCM_CB_EXCLUSIVE = 1, /* CB exclusive to CM [not implemented] */
52 AFSCM_CB_SHARED = 2, /* CB shared by other CM's */
53 AFSCM_CB_DROPPED = 3, /* CB promise cancelled by file server */
54 } afs_callback_type_t;
56 struct afs_callback {
57 struct afs_server *server; /* server that made the promise */
58 struct afs_fid fid; /* file identifier */
59 unsigned version; /* callback version */
60 unsigned expiry; /* time at which expires */
61 afs_callback_type_t type; /* type of callback */
64 #define AFSCBMAX 50
67 * AFS volume information
69 struct afs_volume_info {
70 afs_volid_t vid; /* volume ID */
71 afs_voltype_t type; /* type of this volume */
72 afs_volid_t type_vids[5]; /* volume ID's for possible types for this vol */
74 /* list of fileservers serving this volume */
75 size_t nservers; /* number of entries used in servers[] */
76 struct {
77 struct in_addr addr; /* fileserver address */
78 } servers[8];
82 * AFS file status information
84 struct afs_file_status {
85 unsigned if_version; /* interface version */
86 #define AFS_FSTATUS_VERSION 1
88 afs_file_type_t type; /* file type */
89 unsigned nlink; /* link count */
90 size_t size; /* file size */
91 afs_dataversion_t version; /* current data version */
92 unsigned author; /* author ID */
93 unsigned owner; /* owner ID */
94 unsigned caller_access; /* access rights for authenticated caller */
95 unsigned anon_access; /* access rights for unauthenticated caller */
96 umode_t mode; /* UNIX mode */
97 struct afs_fid parent; /* parent file ID */
98 time_t mtime_client; /* last time client changed data */
99 time_t mtime_server; /* last time server changed data */
103 * AFS volume synchronisation information
105 struct afs_volsync {
106 time_t creation; /* volume creation time */
109 #endif /* AFS_TYPES_H */