88
99#include <linux/mutex.h>
1010#include <linux/sched.h>
11+ #include <linux/stddef.h>
1112#include <linux/types.h>
1213#include <linux/wait.h>
1314
@@ -73,7 +74,7 @@ enum uds_request_type {
7374 /* Remove any mapping for a name. */
7475 UDS_DELETE ,
7576
76- };
77+ } __packed ;
7778
7879enum uds_open_index_type {
7980 /* Create a new index. */
@@ -226,7 +227,7 @@ struct uds_zone_message {
226227 enum uds_zone_message_type type ;
227228 /* The virtual chapter number to which the message applies */
228229 u64 virtual_chapter ;
229- };
230+ } __packed ;
230231
231232struct uds_index_session ;
232233struct uds_index ;
@@ -253,34 +254,32 @@ struct uds_request {
253254
254255 /* The existing data associated with the request name, if any */
255256 struct uds_record_data old_metadata ;
256- /* Either UDS_SUCCESS or an error code for the request */
257- int status ;
258257 /* True if the record name had an existing entry in the index */
259258 bool found ;
259+ /* Either UDS_SUCCESS or an error code for the request */
260+ int status ;
260261
261- /*
262- * The remaining fields are used internally and should not be altered by clients. The index
263- * relies on zone_number being the first field in this section.
264- */
265-
266- /* The number of the zone which will process this request*/
267- unsigned int zone_number ;
268- /* A link for adding a request to a lock-free queue */
269- struct funnel_queue_entry queue_link ;
270- /* A link for adding a request to a standard linked list */
271- struct uds_request * next_request ;
272- /* A pointer to the index processing this request */
273- struct uds_index * index ;
274- /* Control message for coordinating between zones */
275- struct uds_zone_message zone_message ;
276- /* If true, process request immediately by waking the worker thread */
277- bool unbatched ;
278- /* If true, continue this request before processing newer requests */
279- bool requeued ;
280- /* The virtual chapter containing the record name, if known */
281- u64 virtual_chapter ;
282- /* The region of the index containing the record name */
283- enum uds_index_region location ;
262+ /* The remaining fields are used internally and should not be altered by clients. */
263+ struct_group (internal ,
264+ /* The virtual chapter containing the record name, if known */
265+ u64 virtual_chapter ;
266+ /* The region of the index containing the record name */
267+ enum uds_index_region location ;
268+ /* If true, process request immediately by waking the worker thread */
269+ bool unbatched ;
270+ /* If true, continue this request before processing newer requests */
271+ bool requeued ;
272+ /* Control message for coordinating between zones */
273+ struct uds_zone_message zone_message ;
274+ /* The number of the zone which will process this request*/
275+ unsigned int zone_number ;
276+ /* A link for adding a request to a lock-free queue */
277+ struct funnel_queue_entry queue_link ;
278+ /* A link for adding a request to a standard linked list */
279+ struct uds_request * next_request ;
280+ /* A pointer to the index processing this request */
281+ struct uds_index * index ;
282+ );
284283};
285284
286285/* A session is required for most index operations. */
0 commit comments