afs_vl.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* AFS Volume Location Service client interface
  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. #ifndef AFS_VL_H
  12. #define AFS_VL_H
  13. #include "afs.h"
  14. #define AFS_VL_PORT 7003 /* volume location service port */
  15. #define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */
  16. enum AFSVL_Operations {
  17. VLGETENTRYBYID = 503, /* AFS Get Cache Entry By ID operation ID */
  18. VLGETENTRYBYNAME = 504, /* AFS Get Cache Entry By Name operation ID */
  19. VLPROBE = 514, /* AFS Probe Volume Location Service operation ID */
  20. };
  21. enum AFSVL_Errors {
  22. AFSVL_IDEXIST = 363520, /* Volume Id entry exists in vl database */
  23. AFSVL_IO = 363521, /* I/O related error */
  24. AFSVL_NAMEEXIST = 363522, /* Volume name entry exists in vl database */
  25. AFSVL_CREATEFAIL = 363523, /* Internal creation failure */
  26. AFSVL_NOENT = 363524, /* No such entry */
  27. AFSVL_EMPTY = 363525, /* Vl database is empty */
  28. AFSVL_ENTDELETED = 363526, /* Entry is deleted (soft delete) */
  29. AFSVL_BADNAME = 363527, /* Volume name is illegal */
  30. AFSVL_BADINDEX = 363528, /* Index is out of range */
  31. AFSVL_BADVOLTYPE = 363529, /* Bad volume type */
  32. AFSVL_BADSERVER = 363530, /* Illegal server number (out of range) */
  33. AFSVL_BADPARTITION = 363531, /* Bad partition number */
  34. AFSVL_REPSFULL = 363532, /* Run out of space for Replication sites */
  35. AFSVL_NOREPSERVER = 363533, /* No such Replication server site exists */
  36. AFSVL_DUPREPSERVER = 363534, /* Replication site already exists */
  37. AFSVL_RWNOTFOUND = 363535, /* Parent R/W entry not found */
  38. AFSVL_BADREFCOUNT = 363536, /* Illegal Reference Count number */
  39. AFSVL_SIZEEXCEEDED = 363537, /* Vl size for attributes exceeded */
  40. AFSVL_BADENTRY = 363538, /* Bad incoming vl entry */
  41. AFSVL_BADVOLIDBUMP = 363539, /* Illegal max volid increment */
  42. AFSVL_IDALREADYHASHED = 363540, /* RO/BACK id already hashed */
  43. AFSVL_ENTRYLOCKED = 363541, /* Vl entry is already locked */
  44. AFSVL_BADVOLOPER = 363542, /* Bad volume operation code */
  45. AFSVL_BADRELLOCKTYPE = 363543, /* Bad release lock type */
  46. AFSVL_RERELEASE = 363544, /* Status report: last release was aborted */
  47. AFSVL_BADSERVERFLAG = 363545, /* Invalid replication site server flag */
  48. AFSVL_PERM = 363546, /* No permission access */
  49. AFSVL_NOMEM = 363547, /* malloc/realloc failed to alloc enough memory */
  50. };
  51. /*
  52. * maps to "struct vldbentry" in vvl-spec.pdf
  53. */
  54. struct afs_vldbentry {
  55. char name[65]; /* name of volume (with NUL char) */
  56. afs_voltype_t type; /* volume type */
  57. unsigned num_servers; /* num servers that hold instances of this vol */
  58. unsigned clone_id; /* cloning ID */
  59. unsigned flags;
  60. #define AFS_VLF_RWEXISTS 0x1000 /* R/W volume exists */
  61. #define AFS_VLF_ROEXISTS 0x2000 /* R/O volume exists */
  62. #define AFS_VLF_BACKEXISTS 0x4000 /* backup volume exists */
  63. afs_volid_t volume_ids[3]; /* volume IDs */
  64. struct {
  65. struct in_addr addr; /* server address */
  66. unsigned partition; /* partition ID on this server */
  67. unsigned flags; /* server specific flags */
  68. #define AFS_VLSF_NEWREPSITE 0x0001 /* unused */
  69. #define AFS_VLSF_ROVOL 0x0002 /* this server holds a R/O instance of the volume */
  70. #define AFS_VLSF_RWVOL 0x0004 /* this server holds a R/W instance of the volume */
  71. #define AFS_VLSF_BACKVOL 0x0008 /* this server holds a backup instance of the volume */
  72. } servers[8];
  73. };
  74. #endif /* AFS_VL_H */