hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/fs/afs/afs.h
....@@ -1,12 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /* AFS common types
23 *
34 * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
45 * 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.
106 */
117
128 #ifndef AFS_H
....@@ -14,7 +10,7 @@
1410
1511 #include <linux/in.h>
1612
17
-#define AFS_MAXCELLNAME 64 /* Maximum length of a cell name */
13
+#define AFS_MAXCELLNAME 256 /* Maximum length of a cell name */
1814 #define AFS_MAXVOLNAME 64 /* Maximum length of a volume name */
1915 #define AFS_MAXNSERVERS 8 /* Maximum servers in a basic volume record */
2016 #define AFS_NMAXNSERVERS 13 /* Maximum servers in a N/U-class volume record */
....@@ -23,9 +19,12 @@
2319 #define AFSPATHMAX 1024 /* Maximum length of a pathname plus NUL */
2420 #define AFSOPAQUEMAX 1024 /* Maximum length of an opaque field */
2521
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;
2928
3029 typedef enum {
3130 AFSVL_RWVOL, /* read/write volume */
....@@ -52,8 +51,9 @@
5251 */
5352 struct afs_fid {
5453 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) */
5757 };
5858
5959 /*
....@@ -67,14 +67,14 @@
6767 } afs_callback_type_t;
6868
6969 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 */
7373 };
7474
7575 struct afs_callback_break {
7676 struct afs_fid fid; /* File identifier */
77
- struct afs_callback cb; /* Callback details */
77
+ //struct afs_callback cb; /* Callback details */
7878 };
7979
8080 #define AFSCBMAX 50 /* maximum callbacks transferred per bulk op */
....@@ -129,19 +129,26 @@
129129 struct afs_file_status {
130130 u64 size; /* file size */
131131 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 */
141137 afs_access_t caller_access; /* access rights for authenticated caller */
142138 afs_access_t anon_access; /* access rights for unauthenticated caller */
143139 umode_t mode; /* UNIX mode */
140
+ afs_file_type_t type; /* file type */
141
+ u32 nlink; /* link count */
144142 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 */
145152 };
146153
147154 /*
....@@ -158,25 +165,27 @@
158165 * AFS volume synchronisation information
159166 */
160167 struct afs_volsync {
161
- time_t creation; /* volume creation time */
168
+ time64_t creation; /* volume creation time */
162169 };
163170
164171 /*
165172 * AFS volume status record
166173 */
167174 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 */
170177 u8 online; /* true if volume currently online and available */
171178 u8 in_service; /* true if volume currently in service */
172179 u8 blessed; /* same as in_service */
173180 u8 needs_salvage; /* true if consistency checking required */
174181 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;
180189 };
181190
182191 #define AFS_BLOCK_SIZE 1024