]> Git Repo - linux.git/blob - fs/afs/afs_vl.h
afs: Overhaul permit caching
[linux.git] / fs / afs / afs_vl.h
1 /* AFS Volume Location Service client interface
2  *
3  * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells ([email protected])
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_VL_H
13 #define AFS_VL_H
14
15 #include "afs.h"
16
17 #define AFS_VL_PORT             7003    /* volume location service port */
18 #define VL_SERVICE              52      /* RxRPC service ID for the Volume Location service */
19
20 enum AFSVL_Operations {
21         VLGETENTRYBYID          = 503,  /* AFS Get VLDB entry by ID */
22         VLGETENTRYBYNAME        = 504,  /* AFS Get VLDB entry by name */
23         VLPROBE                 = 514,  /* AFS probe VL service */
24         VLGETENTRYBYIDU         = 526,  /* AFS Get VLDB entry by ID (UUID-variant) */
25         VLGETENTRYBYNAMEU       = 527,  /* AFS Get VLDB entry by name (UUID-variant) */
26         VLGETADDRSU             = 533,  /* AFS Get addrs for fileserver */
27 };
28
29 enum AFSVL_Errors {
30         AFSVL_IDEXIST           = 363520,       /* Volume Id entry exists in vl database */
31         AFSVL_IO                = 363521,       /* I/O related error */
32         AFSVL_NAMEEXIST         = 363522,       /* Volume name entry exists in vl database */
33         AFSVL_CREATEFAIL        = 363523,       /* Internal creation failure */
34         AFSVL_NOENT             = 363524,       /* No such entry */
35         AFSVL_EMPTY             = 363525,       /* Vl database is empty */
36         AFSVL_ENTDELETED        = 363526,       /* Entry is deleted (soft delete) */
37         AFSVL_BADNAME           = 363527,       /* Volume name is illegal */
38         AFSVL_BADINDEX          = 363528,       /* Index is out of range */
39         AFSVL_BADVOLTYPE        = 363529,       /* Bad volume type */
40         AFSVL_BADSERVER         = 363530,       /* Illegal server number (out of range) */
41         AFSVL_BADPARTITION      = 363531,       /* Bad partition number */
42         AFSVL_REPSFULL          = 363532,       /* Run out of space for Replication sites */
43         AFSVL_NOREPSERVER       = 363533,       /* No such Replication server site exists */
44         AFSVL_DUPREPSERVER      = 363534,       /* Replication site already exists */
45         AFSVL_RWNOTFOUND        = 363535,       /* Parent R/W entry not found */
46         AFSVL_BADREFCOUNT       = 363536,       /* Illegal Reference Count number */
47         AFSVL_SIZEEXCEEDED      = 363537,       /* Vl size for attributes exceeded */
48         AFSVL_BADENTRY          = 363538,       /* Bad incoming vl entry */
49         AFSVL_BADVOLIDBUMP      = 363539,       /* Illegal max volid increment */
50         AFSVL_IDALREADYHASHED   = 363540,       /* RO/BACK id already hashed */
51         AFSVL_ENTRYLOCKED       = 363541,       /* Vl entry is already locked */
52         AFSVL_BADVOLOPER        = 363542,       /* Bad volume operation code */
53         AFSVL_BADRELLOCKTYPE    = 363543,       /* Bad release lock type */
54         AFSVL_RERELEASE         = 363544,       /* Status report: last release was aborted */
55         AFSVL_BADSERVERFLAG     = 363545,       /* Invalid replication site server flag */
56         AFSVL_PERM              = 363546,       /* No permission access */
57         AFSVL_NOMEM             = 363547,       /* malloc/realloc failed to alloc enough memory */
58 };
59
60 /*
61  * maps to "struct vldbentry" in vvl-spec.pdf
62  */
63 struct afs_vldbentry {
64         char            name[65];               /* name of volume (with NUL char) */
65         afs_voltype_t   type;                   /* volume type */
66         unsigned        num_servers;            /* num servers that hold instances of this vol */
67         unsigned        clone_id;               /* cloning ID */
68
69         unsigned        flags;
70 #define AFS_VLF_RWEXISTS        0x1000          /* R/W volume exists */
71 #define AFS_VLF_ROEXISTS        0x2000          /* R/O volume exists */
72 #define AFS_VLF_BACKEXISTS      0x4000          /* backup volume exists */
73
74         afs_volid_t     volume_ids[3];          /* volume IDs */
75
76         struct {
77                 struct in_addr  addr;           /* server address */
78                 unsigned        partition;      /* partition ID on this server */
79                 unsigned        flags;          /* server specific flags */
80 #define AFS_VLSF_NEWREPSITE     0x0001  /* Ignore all 'non-new' servers */
81 #define AFS_VLSF_ROVOL          0x0002  /* this server holds a R/O instance of the volume */
82 #define AFS_VLSF_RWVOL          0x0004  /* this server holds a R/W instance of the volume */
83 #define AFS_VLSF_BACKVOL        0x0008  /* this server holds a backup instance of the volume */
84 #define AFS_VLSF_UUID           0x0010  /* This server is referred to by its UUID */
85 #define AFS_VLSF_DONTUSE        0x0020  /* This server ref should be ignored */
86         } servers[8];
87 };
88
89 #define AFS_VLDB_MAXNAMELEN 65
90
91 #endif /* AFS_VL_H */
This page took 0.036914 seconds and 4 git commands to generate.