]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - fs/afs/types.h
[AF_RXRPC]: Add an interface to the AF_RXRPC module for the AFS filesystem to use
[linux-2.6-omap-h63xx.git] / fs / afs / types.h
1 /* AFS types
2  *
3  * Copyright (C) 2002 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_TYPES_H
13 #define AFS_TYPES_H
14
15 #include <rxrpc/types.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 struct afs_cell;
35 struct afs_vnode;
36
37 /*
38  * AFS file identifier
39  */
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) */
44 };
45
46 /*
47  * AFS callback notification
48  */
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;
55
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 */
62 };
63
64 #define AFSCBMAX 50
65
66 /*
67  * AFS volume information
68  */
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 */
73         
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];
79 };
80
81 /*
82  * AFS file status information
83  */
84 struct afs_file_status {
85         unsigned                if_version;     /* interface version */
86 #define AFS_FSTATUS_VERSION     1
87
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 */
100 };
101
102 /*
103  * AFS volume synchronisation information
104  */
105 struct afs_volsync {
106         time_t                  creation;       /* volume creation time */
107 };
108
109 #endif /* AFS_TYPES_H */