1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* AFS fileserver XDR types
4 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
11 struct afs_xdr_AFSFetchStatus
{
13 #define AFS_FSTATUS_VERSION 1
17 __be32 data_version_lo
;
30 __be32 data_version_hi
;
36 #define AFS_DIR_HASHTBL_SIZE 128
37 #define AFS_DIR_DIRENT_SIZE 32
38 #define AFS_DIR_SLOTS_PER_BLOCK 64
39 #define AFS_DIR_BLOCK_SIZE 2048
40 #define AFS_DIR_BLOCKS_PER_PAGE (PAGE_SIZE / AFS_DIR_BLOCK_SIZE)
41 #define AFS_DIR_MAX_SLOTS 65536
42 #define AFS_DIR_BLOCKS_WITH_CTR 128
43 #define AFS_DIR_MAX_BLOCKS 1023
44 #define AFS_DIR_RESV_BLOCKS 1
45 #define AFS_DIR_RESV_BLOCKS0 13
48 * Directory entry structure.
50 union afs_xdr_dirent
{
58 u8 overflow
[4]; /* if any char of the name (inc
59 * NUL) reaches here, consume
60 * the next dirent too */
66 * Directory block header (one at the beginning of every 2048-byte block).
68 struct afs_xdr_dir_hdr
{
71 #define AFS_DIR_MAGIC htons(1234)
78 * Directory block layout
80 union afs_xdr_dir_block
{
81 struct afs_xdr_dir_hdr hdr
;
84 struct afs_xdr_dir_hdr hdr
;
85 u8 alloc_ctrs
[AFS_DIR_MAX_BLOCKS
];
86 __be16 hashtable
[AFS_DIR_HASHTBL_SIZE
];
89 union afs_xdr_dirent dirents
[AFS_DIR_SLOTS_PER_BLOCK
];
93 * Directory layout on a linux VM page.
95 struct afs_xdr_dir_page
{
96 union afs_xdr_dir_block blocks
[AFS_DIR_BLOCKS_PER_PAGE
];