Commit 91a90380 authored by David Howells's avatar David Howells

afs: Add some protocol defs

Add some protocol definitions, including max field lengths, flag defs, an
XDR-encoded UUID def, more VL operation IDs and more fileserver abort
codes.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 9ed900b1
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
#include <linux/in.h> #include <linux/in.h>
#define AFS_MAXCELLNAME 64 /* maximum length of a cell name */ #define AFS_MAXCELLNAME 64 /* Maximum length of a cell name */
#define AFS_MAXVOLNAME 64 /* maximum length of a volume name */ #define AFS_MAXVOLNAME 64 /* Maximum length of a volume name */
#define AFSNAMEMAX 256 /* maximum length of a filename plus NUL */ #define AFS_MAXNSERVERS 8 /* Maximum servers in a basic volume record */
#define AFSPATHMAX 1024 /* maximum length of a pathname plus NUL */ #define AFS_NMAXNSERVERS 13 /* Maximum servers in a N/U-class volume record */
#define AFSOPAQUEMAX 1024 /* maximum length of an opaque field */ #define AFS_MAXTYPES 3 /* Maximum number of volume types */
#define AFSNAMEMAX 256 /* Maximum length of a filename plus NUL */
#define AFSPATHMAX 1024 /* Maximum length of a pathname plus NUL */
#define AFSOPAQUEMAX 1024 /* Maximum length of an opaque field */
typedef unsigned afs_volid_t; typedef unsigned afs_volid_t;
typedef unsigned afs_vnodeid_t; typedef unsigned afs_vnodeid_t;
...@@ -176,4 +179,16 @@ struct afs_volume_status { ...@@ -176,4 +179,16 @@ struct afs_volume_status {
#define AFS_BLOCK_SIZE 1024 #define AFS_BLOCK_SIZE 1024
/*
* XDR encoding of UUID in AFS.
*/
struct afs_uuid__xdr {
__be32 time_low;
__be32 time_mid;
__be32 time_hi_and_version;
__be32 clock_seq_hi_and_reserved;
__be32 clock_seq_low;
__be32 node[6];
};
#endif /* AFS_H */ #endif /* AFS_H */
...@@ -40,6 +40,7 @@ enum AFS_FS_Operations { ...@@ -40,6 +40,7 @@ enum AFS_FS_Operations {
}; };
enum AFS_FS_Errors { enum AFS_FS_Errors {
VRESTARTING = -100, /* Server is restarting */
VSALVAGE = 101, /* volume needs salvaging */ VSALVAGE = 101, /* volume needs salvaging */
VNOVNODE = 102, /* no such file/dir (vnode) */ VNOVNODE = 102, /* no such file/dir (vnode) */
VNOVOL = 103, /* no such volume or volume unavailable */ VNOVOL = 103, /* no such volume or volume unavailable */
...@@ -51,6 +52,9 @@ enum AFS_FS_Errors { ...@@ -51,6 +52,9 @@ enum AFS_FS_Errors {
VOVERQUOTA = 109, /* volume's maximum quota exceeded */ VOVERQUOTA = 109, /* volume's maximum quota exceeded */
VBUSY = 110, /* volume is temporarily unavailable */ VBUSY = 110, /* volume is temporarily unavailable */
VMOVED = 111, /* volume moved to new server - ask this FS where */ VMOVED = 111, /* volume moved to new server - ask this FS where */
VIO = 112, /* I/O error in volume */
VSALVAGING = 113, /* Volume is being salvaged */
VRESTRICTED = 120, /* Volume is restricted from using */
}; };
#endif /* AFS_FS_H */ #endif /* AFS_FS_H */
...@@ -18,9 +18,12 @@ ...@@ -18,9 +18,12 @@
#define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */ #define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */
enum AFSVL_Operations { enum AFSVL_Operations {
VLGETENTRYBYID = 503, /* AFS Get Cache Entry By ID operation ID */ VLGETENTRYBYID = 503, /* AFS Get VLDB entry by ID */
VLGETENTRYBYNAME = 504, /* AFS Get Cache Entry By Name operation ID */ VLGETENTRYBYNAME = 504, /* AFS Get VLDB entry by name */
VLPROBE = 514, /* AFS Probe Volume Location Service operation ID */ VLPROBE = 514, /* AFS probe VL service */
VLGETENTRYBYIDU = 526, /* AFS Get VLDB entry by ID (UUID-variant) */
VLGETENTRYBYNAMEU = 527, /* AFS Get VLDB entry by name (UUID-variant) */
VLGETADDRSU = 533, /* AFS Get addrs for fileserver */
}; };
enum AFSVL_Errors { enum AFSVL_Errors {
...@@ -74,11 +77,15 @@ struct afs_vldbentry { ...@@ -74,11 +77,15 @@ struct afs_vldbentry {
struct in_addr addr; /* server address */ struct in_addr addr; /* server address */
unsigned partition; /* partition ID on this server */ unsigned partition; /* partition ID on this server */
unsigned flags; /* server specific flags */ unsigned flags; /* server specific flags */
#define AFS_VLSF_NEWREPSITE 0x0001 /* unused */ #define AFS_VLSF_NEWREPSITE 0x0001 /* Ignore all 'non-new' servers */
#define AFS_VLSF_ROVOL 0x0002 /* this server holds a R/O instance of the volume */ #define AFS_VLSF_ROVOL 0x0002 /* this server holds a R/O instance of the volume */
#define AFS_VLSF_RWVOL 0x0004 /* this server holds a R/W instance of the volume */ #define AFS_VLSF_RWVOL 0x0004 /* this server holds a R/W instance of the volume */
#define AFS_VLSF_BACKVOL 0x0008 /* this server holds a backup instance of the volume */ #define AFS_VLSF_BACKVOL 0x0008 /* this server holds a backup instance of the volume */
#define AFS_VLSF_UUID 0x0010 /* This server is referred to by its UUID */
#define AFS_VLSF_DONTUSE 0x0020 /* This server ref should be ignored */
} servers[8]; } servers[8];
}; };
#define AFS_VLDB_MAXNAMELEN 65
#endif /* AFS_VL_H */ #endif /* AFS_VL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment