initial commit with v2.6.9
[linux-2.6.9-moxart.git] / fs / afs / types.h
blob27596b35dcc6016c1f16adc330a6f19bbd6a99ac
1 /* types.h: 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 _LINUX_AFS_TYPES_H
13 #define _LINUX_AFS_TYPES_H
15 #ifdef __KERNEL__
16 #include <rxrpc/types.h>
17 #endif /* __KERNEL__ */
19 typedef unsigned afs_volid_t;
20 typedef unsigned afs_vnodeid_t;
21 typedef unsigned long long afs_dataversion_t;
23 typedef enum {
24 AFSVL_RWVOL, /* read/write volume */
25 AFSVL_ROVOL, /* read-only volume */
26 AFSVL_BACKVOL, /* backup volume */
27 } __attribute__((packed)) afs_voltype_t;
29 extern const char *afs_voltypes[];
31 typedef enum {
32 AFS_FTYPE_INVALID = 0,
33 AFS_FTYPE_FILE = 1,
34 AFS_FTYPE_DIR = 2,
35 AFS_FTYPE_SYMLINK = 3,
36 } afs_file_type_t;
38 #ifdef __KERNEL__
40 struct afs_cell;
41 struct afs_vnode;
43 /*****************************************************************************/
45 * AFS file identifier
47 struct afs_fid
49 afs_volid_t vid; /* volume ID */
50 afs_vnodeid_t vnode; /* file index within volume */
51 unsigned unique; /* unique ID number (file index version) */
54 /*****************************************************************************/
56 * AFS callback notification
58 typedef enum {
59 AFSCM_CB_UNTYPED = 0, /* no type set on CB break */
60 AFSCM_CB_EXCLUSIVE = 1, /* CB exclusive to CM [not implemented] */
61 AFSCM_CB_SHARED = 2, /* CB shared by other CM's */
62 AFSCM_CB_DROPPED = 3, /* CB promise cancelled by file server */
63 } afs_callback_type_t;
65 struct afs_callback
67 struct afs_server *server; /* server that made the promise */
68 struct afs_fid fid; /* file identifier */
69 unsigned version; /* callback version */
70 unsigned expiry; /* time at which expires */
71 afs_callback_type_t type; /* type of callback */
74 #define AFSCBMAX 50
76 /*****************************************************************************/
78 * AFS volume information
80 struct afs_volume_info
82 afs_volid_t vid; /* volume ID */
83 afs_voltype_t type; /* type of this volume */
84 afs_volid_t type_vids[5]; /* volume ID's for possible types for this vol */
86 /* list of fileservers serving this volume */
87 size_t nservers; /* number of entries used in servers[] */
88 struct {
89 struct in_addr addr; /* fileserver address */
90 } servers[8];
93 /*****************************************************************************/
95 * AFS file status information
97 struct afs_file_status
99 unsigned if_version; /* interface version */
100 #define AFS_FSTATUS_VERSION 1
102 afs_file_type_t type; /* file type */
103 unsigned nlink; /* link count */
104 size_t size; /* file size */
105 afs_dataversion_t version; /* current data version */
106 unsigned author; /* author ID */
107 unsigned owner; /* owner ID */
108 unsigned caller_access; /* access rights for authenticated caller */
109 unsigned anon_access; /* access rights for unauthenticated caller */
110 umode_t mode; /* UNIX mode */
111 struct afs_fid parent; /* parent file ID */
112 time_t mtime_client; /* last time client changed data */
113 time_t mtime_server; /* last time server changed data */
116 /*****************************************************************************/
118 * AFS volume synchronisation information
120 struct afs_volsync
122 time_t creation; /* volume creation time */
125 #endif /* __KERNEL__ */
127 #endif /* _LINUX_AFS_TYPES_H */