[AF_RXRPC]: Add an interface to the AF_RXRPC module for the AFS filesystem to use
[safe/jmp/linux-2.6] / fs / afs / afs.h
1 /* AFS common types
2  *
3  * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
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
12 #ifndef AFS_H
13 #define AFS_H
14
15 #include <linux/in.h>
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
34 /*
35  * AFS file identifier
36  */
37 struct afs_fid {
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
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
53 struct afs_callback {
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
60 #define AFSCBMAX 50     /* maximum callbacks transferred per bulk op */
61
62 /*
63  * AFS volume information
64  */
65 struct afs_volume_info {
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 */
69
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
77 /*
78  * AFS file status information
79  */
80 struct afs_file_status {
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 */
87         afs_dataversion_t       data_version;   /* current data version */
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
98 /*
99  * AFS volume synchronisation information
100  */
101 struct afs_volsync {
102         time_t                  creation;       /* volume creation time */
103 };
104
105 #endif /* AFS_H */