2874c5fd28426 fs/afs/afs_vl.h (Thomas Gleixner 2019-05-27 08:55:01 +0200 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 2) /* AFS Volume Location Service client interface
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 3) *
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 4) * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 5) * Written by David Howells (dhowells@redhat.com)
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 6) */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 7)
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 8) #ifndef AFS_VL_H
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 9) #define AFS_VL_H
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 10)
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 11) #include "afs.h"
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 12)
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 13) #define AFS_VL_PORT 7003 /* volume location service port */
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 14) #define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 15) #define YFS_VL_SERVICE 2503 /* Service ID for AuriStor upgraded VL service */
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 16)
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 17) enum AFSVL_Operations {
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 18) VLGETENTRYBYID = 503, /* AFS Get VLDB entry by ID */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 19) VLGETENTRYBYNAME = 504, /* AFS Get VLDB entry by name */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 20) VLPROBE = 514, /* AFS probe VL service */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 21) VLGETENTRYBYIDU = 526, /* AFS Get VLDB entry by ID (UUID-variant) */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 22) VLGETENTRYBYNAMEU = 527, /* AFS Get VLDB entry by name (UUID-variant) */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 23) VLGETADDRSU = 533, /* AFS Get addrs for fileserver */
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 24) YVLGETENDPOINTS = 64002, /* YFS Get endpoints for file/volume server */
c3e9f888263bb fs/afs/afs_vl.h (David Howells 2020-04-29 17:26:41 +0100 25) YVLGETCELLNAME = 64014, /* YFS Get actual cell name */
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 26) VLGETCAPABILITIES = 65537, /* AFS Get server capabilities */
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 27) };
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 28)
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 29) enum AFSVL_Errors {
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 30) AFSVL_IDEXIST = 363520, /* Volume Id entry exists in vl database */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 31) AFSVL_IO = 363521, /* I/O related error */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 32) AFSVL_NAMEEXIST = 363522, /* Volume name entry exists in vl database */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 33) AFSVL_CREATEFAIL = 363523, /* Internal creation failure */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 34) AFSVL_NOENT = 363524, /* No such entry */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 35) AFSVL_EMPTY = 363525, /* Vl database is empty */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 36) AFSVL_ENTDELETED = 363526, /* Entry is deleted (soft delete) */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 37) AFSVL_BADNAME = 363527, /* Volume name is illegal */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 38) AFSVL_BADINDEX = 363528, /* Index is out of range */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 39) AFSVL_BADVOLTYPE = 363529, /* Bad volume type */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 40) AFSVL_BADSERVER = 363530, /* Illegal server number (out of range) */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 41) AFSVL_BADPARTITION = 363531, /* Bad partition number */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 42) AFSVL_REPSFULL = 363532, /* Run out of space for Replication sites */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 43) AFSVL_NOREPSERVER = 363533, /* No such Replication server site exists */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 44) AFSVL_DUPREPSERVER = 363534, /* Replication site already exists */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 45) AFSVL_RWNOTFOUND = 363535, /* Parent R/W entry not found */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 46) AFSVL_BADREFCOUNT = 363536, /* Illegal Reference Count number */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 47) AFSVL_SIZEEXCEEDED = 363537, /* Vl size for attributes exceeded */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 48) AFSVL_BADENTRY = 363538, /* Bad incoming vl entry */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 49) AFSVL_BADVOLIDBUMP = 363539, /* Illegal max volid increment */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 50) AFSVL_IDALREADYHASHED = 363540, /* RO/BACK id already hashed */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 51) AFSVL_ENTRYLOCKED = 363541, /* Vl entry is already locked */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 52) AFSVL_BADVOLOPER = 363542, /* Bad volume operation code */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 53) AFSVL_BADRELLOCKTYPE = 363543, /* Bad release lock type */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 54) AFSVL_RERELEASE = 363544, /* Status report: last release was aborted */
e4b9f0058145a fs/afs/afs_vl.h (David Howells 2011-07-18 13:50:00 +0100 55) AFSVL_BADSERVERFLAG = 363545, /* Invalid replication site server flag */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 56) AFSVL_PERM = 363546, /* No permission access */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 57) AFSVL_NOMEM = 363547, /* malloc/realloc failed to alloc enough memory */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 58) };
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 59)
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 60) enum {
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 61) YFS_SERVER_INDEX = 0,
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 62) YFS_SERVER_UUID = 1,
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 63) YFS_SERVER_ENDPOINT = 2,
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 64) };
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 65)
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 66) enum {
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 67) YFS_ENDPOINT_IPV4 = 0,
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 68) YFS_ENDPOINT_IPV6 = 1,
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 69) };
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 70)
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 71) #define YFS_MAXENDPOINTS 16
bf99a53ce22a2 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:51 +0000 72)
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 73) /*
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 74) * maps to "struct vldbentry" in vvl-spec.pdf
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 75) */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 76) struct afs_vldbentry {
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 77) char name[65]; /* name of volume (with NUL char) */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 78) afs_voltype_t type; /* volume type */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 79) unsigned num_servers; /* num servers that hold instances of this vol */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 80) unsigned clone_id; /* cloning ID */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 81)
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 82) unsigned flags;
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 83) #define AFS_VLF_RWEXISTS 0x1000 /* R/W volume exists */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 84) #define AFS_VLF_ROEXISTS 0x2000 /* R/O volume exists */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 85) #define AFS_VLF_BACKEXISTS 0x4000 /* backup volume exists */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 86)
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 87) afs_volid_t volume_ids[3]; /* volume IDs */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 88)
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 89) struct {
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 90) struct in_addr addr; /* server address */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 91) unsigned partition; /* partition ID on this server */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 92) unsigned flags; /* server specific flags */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 93) #define AFS_VLSF_NEWREPSITE 0x0001 /* Ignore all 'non-new' servers */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 94) #define AFS_VLSF_ROVOL 0x0002 /* this server holds a R/O instance of the volume */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 95) #define AFS_VLSF_RWVOL 0x0004 /* this server holds a R/W instance of the volume */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 96) #define AFS_VLSF_BACKVOL 0x0008 /* this server holds a backup instance of the volume */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 97) #define AFS_VLSF_UUID 0x0010 /* This server is referred to by its UUID */
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 98) #define AFS_VLSF_DONTUSE 0x0020 /* This server ref should be ignored */
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 99) } servers[8];
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 100) };
^1da177e4c3f4 fs/afs/vlclient.h (Linus Torvalds 2005-04-16 15:20:36 -0700 101)
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 102) #define AFS_VLDB_MAXNAMELEN 65
91a90380efbc8 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:46 +0000 103)
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 104)
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 105) struct afs_ListAddrByAttributes__xdr {
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 106) __be32 Mask;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 107) #define AFS_VLADDR_IPADDR 0x1 /* Match by ->ipaddr */
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 108) #define AFS_VLADDR_INDEX 0x2 /* Match by ->index */
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 109) #define AFS_VLADDR_UUID 0x4 /* Match by ->uuid */
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 110) __be32 ipaddr;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 111) __be32 index;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 112) __be32 spare;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 113) struct afs_uuid__xdr uuid;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 114) };
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 115)
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 116) struct afs_uvldbentry__xdr {
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 117) __be32 name[AFS_VLDB_MAXNAMELEN];
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 118) __be32 nServers;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 119) struct afs_uuid__xdr serverNumber[AFS_NMAXNSERVERS];
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 120) __be32 serverUnique[AFS_NMAXNSERVERS];
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 121) __be32 serverPartition[AFS_NMAXNSERVERS];
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 122) __be32 serverFlags[AFS_NMAXNSERVERS];
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 123) __be32 volumeId[AFS_MAXTYPES];
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 124) __be32 cloneId;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 125) __be32 flags;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 126) __be32 spares1;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 127) __be32 spares2;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 128) __be32 spares3;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 129) __be32 spares4;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 130) __be32 spares5;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 131) __be32 spares6;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 132) __be32 spares7;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 133) __be32 spares8;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 134) __be32 spares9;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 135) };
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 136)
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 137) struct afs_address_list {
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 138) refcount_t usage;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 139) unsigned int version;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 140) unsigned int nr_addrs;
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 141) struct sockaddr_rxrpc addrs[];
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 142) };
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 143)
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 144) extern void afs_put_address_list(struct afs_address_list *alist);
d2ddc776a4581 fs/afs/afs_vl.h (David Howells 2017-11-02 15:27:50 +0000 145)
08e0e7c82eead fs/afs/afs_vl.h (David Howells 2007-04-26 15:55:03 -0700 146) #endif /* AFS_VL_H */