| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* AFS common types |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved. |
|---|
| 4 | 5 | * 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 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #ifndef AFS_H |
|---|
| .. | .. |
|---|
| 14 | 10 | |
|---|
| 15 | 11 | #include <linux/in.h> |
|---|
| 16 | 12 | |
|---|
| 17 | | -#define AFS_MAXCELLNAME 64 /* Maximum length of a cell name */ |
|---|
| 13 | +#define AFS_MAXCELLNAME 256 /* Maximum length of a cell name */ |
|---|
| 18 | 14 | #define AFS_MAXVOLNAME 64 /* Maximum length of a volume name */ |
|---|
| 19 | 15 | #define AFS_MAXNSERVERS 8 /* Maximum servers in a basic volume record */ |
|---|
| 20 | 16 | #define AFS_NMAXNSERVERS 13 /* Maximum servers in a N/U-class volume record */ |
|---|
| .. | .. |
|---|
| 23 | 19 | #define AFSPATHMAX 1024 /* Maximum length of a pathname plus NUL */ |
|---|
| 24 | 20 | #define AFSOPAQUEMAX 1024 /* Maximum length of an opaque field */ |
|---|
| 25 | 21 | |
|---|
| 26 | | -typedef unsigned afs_volid_t; |
|---|
| 27 | | -typedef unsigned afs_vnodeid_t; |
|---|
| 28 | | -typedef unsigned long long afs_dataversion_t; |
|---|
| 22 | +#define AFS_VL_MAX_LIFESPAN (120 * HZ) |
|---|
| 23 | +#define AFS_PROBE_MAX_LIFESPAN (30 * HZ) |
|---|
| 24 | + |
|---|
| 25 | +typedef u64 afs_volid_t; |
|---|
| 26 | +typedef u64 afs_vnodeid_t; |
|---|
| 27 | +typedef u64 afs_dataversion_t; |
|---|
| 29 | 28 | |
|---|
| 30 | 29 | typedef enum { |
|---|
| 31 | 30 | AFSVL_RWVOL, /* read/write volume */ |
|---|
| .. | .. |
|---|
| 52 | 51 | */ |
|---|
| 53 | 52 | struct afs_fid { |
|---|
| 54 | 53 | afs_volid_t vid; /* volume ID */ |
|---|
| 55 | | - afs_vnodeid_t vnode; /* file index within volume */ |
|---|
| 56 | | - unsigned unique; /* unique ID number (file index version) */ |
|---|
| 54 | + afs_vnodeid_t vnode; /* Lower 64-bits of file index within volume */ |
|---|
| 55 | + u32 vnode_hi; /* Upper 32-bits of file index */ |
|---|
| 56 | + u32 unique; /* unique ID number (file index version) */ |
|---|
| 57 | 57 | }; |
|---|
| 58 | 58 | |
|---|
| 59 | 59 | /* |
|---|
| .. | .. |
|---|
| 67 | 67 | } afs_callback_type_t; |
|---|
| 68 | 68 | |
|---|
| 69 | 69 | struct afs_callback { |
|---|
| 70 | | - unsigned version; /* Callback version */ |
|---|
| 71 | | - unsigned expiry; /* Time at which expires */ |
|---|
| 72 | | - afs_callback_type_t type; /* Type of callback */ |
|---|
| 70 | + time64_t expires_at; /* Time at which expires */ |
|---|
| 71 | + //unsigned version; /* Callback version */ |
|---|
| 72 | + //afs_callback_type_t type; /* Type of callback */ |
|---|
| 73 | 73 | }; |
|---|
| 74 | 74 | |
|---|
| 75 | 75 | struct afs_callback_break { |
|---|
| 76 | 76 | struct afs_fid fid; /* File identifier */ |
|---|
| 77 | | - struct afs_callback cb; /* Callback details */ |
|---|
| 77 | + //struct afs_callback cb; /* Callback details */ |
|---|
| 78 | 78 | }; |
|---|
| 79 | 79 | |
|---|
| 80 | 80 | #define AFSCBMAX 50 /* maximum callbacks transferred per bulk op */ |
|---|
| .. | .. |
|---|
| 129 | 129 | struct afs_file_status { |
|---|
| 130 | 130 | u64 size; /* file size */ |
|---|
| 131 | 131 | afs_dataversion_t data_version; /* current data version */ |
|---|
| 132 | | - time_t mtime_client; /* last time client changed data */ |
|---|
| 133 | | - time_t mtime_server; /* last time server changed data */ |
|---|
| 134 | | - unsigned abort_code; /* Abort if bulk-fetching this failed */ |
|---|
| 135 | | - |
|---|
| 136 | | - afs_file_type_t type; /* file type */ |
|---|
| 137 | | - unsigned nlink; /* link count */ |
|---|
| 138 | | - u32 author; /* author ID */ |
|---|
| 139 | | - u32 owner; /* owner ID */ |
|---|
| 140 | | - u32 group; /* group ID */ |
|---|
| 132 | + struct timespec64 mtime_client; /* Last time client changed data */ |
|---|
| 133 | + struct timespec64 mtime_server; /* Last time server changed data */ |
|---|
| 134 | + s64 author; /* author ID */ |
|---|
| 135 | + s64 owner; /* owner ID */ |
|---|
| 136 | + s64 group; /* group ID */ |
|---|
| 141 | 137 | afs_access_t caller_access; /* access rights for authenticated caller */ |
|---|
| 142 | 138 | afs_access_t anon_access; /* access rights for unauthenticated caller */ |
|---|
| 143 | 139 | umode_t mode; /* UNIX mode */ |
|---|
| 140 | + afs_file_type_t type; /* file type */ |
|---|
| 141 | + u32 nlink; /* link count */ |
|---|
| 144 | 142 | s32 lock_count; /* file lock count (0=UNLK -1=WRLCK +ve=#RDLCK */ |
|---|
| 143 | + u32 abort_code; /* Abort if bulk-fetching this failed */ |
|---|
| 144 | +}; |
|---|
| 145 | + |
|---|
| 146 | +struct afs_status_cb { |
|---|
| 147 | + struct afs_file_status status; |
|---|
| 148 | + struct afs_callback callback; |
|---|
| 149 | + bool have_status; /* True if status record was retrieved */ |
|---|
| 150 | + bool have_cb; /* True if cb record was retrieved */ |
|---|
| 151 | + bool have_error; /* True if status.abort_code indicates an error */ |
|---|
| 145 | 152 | }; |
|---|
| 146 | 153 | |
|---|
| 147 | 154 | /* |
|---|
| .. | .. |
|---|
| 158 | 165 | * AFS volume synchronisation information |
|---|
| 159 | 166 | */ |
|---|
| 160 | 167 | struct afs_volsync { |
|---|
| 161 | | - time_t creation; /* volume creation time */ |
|---|
| 168 | + time64_t creation; /* volume creation time */ |
|---|
| 162 | 169 | }; |
|---|
| 163 | 170 | |
|---|
| 164 | 171 | /* |
|---|
| 165 | 172 | * AFS volume status record |
|---|
| 166 | 173 | */ |
|---|
| 167 | 174 | struct afs_volume_status { |
|---|
| 168 | | - u32 vid; /* volume ID */ |
|---|
| 169 | | - u32 parent_id; /* parent volume ID */ |
|---|
| 175 | + afs_volid_t vid; /* volume ID */ |
|---|
| 176 | + afs_volid_t parent_id; /* parent volume ID */ |
|---|
| 170 | 177 | u8 online; /* true if volume currently online and available */ |
|---|
| 171 | 178 | u8 in_service; /* true if volume currently in service */ |
|---|
| 172 | 179 | u8 blessed; /* same as in_service */ |
|---|
| 173 | 180 | u8 needs_salvage; /* true if consistency checking required */ |
|---|
| 174 | 181 | u32 type; /* volume type (afs_voltype_t) */ |
|---|
| 175 | | - u32 min_quota; /* minimum space set aside (blocks) */ |
|---|
| 176 | | - u32 max_quota; /* maximum space this volume may occupy (blocks) */ |
|---|
| 177 | | - u32 blocks_in_use; /* space this volume currently occupies (blocks) */ |
|---|
| 178 | | - u32 part_blocks_avail; /* space available in volume's partition */ |
|---|
| 179 | | - u32 part_max_blocks; /* size of volume's partition */ |
|---|
| 182 | + u64 min_quota; /* minimum space set aside (blocks) */ |
|---|
| 183 | + u64 max_quota; /* maximum space this volume may occupy (blocks) */ |
|---|
| 184 | + u64 blocks_in_use; /* space this volume currently occupies (blocks) */ |
|---|
| 185 | + u64 part_blocks_avail; /* space available in volume's partition */ |
|---|
| 186 | + u64 part_max_blocks; /* size of volume's partition */ |
|---|
| 187 | + s64 vol_copy_date; |
|---|
| 188 | + s64 vol_backup_date; |
|---|
| 180 | 189 | }; |
|---|
| 181 | 190 | |
|---|
| 182 | 191 | #define AFS_BLOCK_SIZE 1024 |
|---|