1 /* AFS fileserver XDR types
3 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
15 struct afs_xdr_AFSFetchStatus
{
17 #define AFS_FSTATUS_VERSION 1
21 __be32 data_version_lo
;
34 __be32 data_version_hi
;
40 #define AFS_DIR_HASHTBL_SIZE 128
41 #define AFS_DIR_DIRENT_SIZE 32
42 #define AFS_DIR_SLOTS_PER_BLOCK 64
43 #define AFS_DIR_BLOCK_SIZE 2048
44 #define AFS_DIR_BLOCKS_PER_PAGE (PAGE_SIZE / AFS_DIR_BLOCK_SIZE)
45 #define AFS_DIR_MAX_SLOTS 65536
46 #define AFS_DIR_BLOCKS_WITH_CTR 128
47 #define AFS_DIR_MAX_BLOCKS 1023
48 #define AFS_DIR_RESV_BLOCKS 1
49 #define AFS_DIR_RESV_BLOCKS0 13
52 * Directory entry structure.
54 union afs_xdr_dirent
{
62 u8 overflow
[4]; /* if any char of the name (inc
63 * NUL) reaches here, consume
64 * the next dirent too */
70 * Directory block header (one at the beginning of every 2048-byte block).
72 struct afs_xdr_dir_hdr
{
75 #define AFS_DIR_MAGIC htons(1234)
82 * Directory block layout
84 union afs_xdr_dir_block
{
85 struct afs_xdr_dir_hdr hdr
;
88 struct afs_xdr_dir_hdr hdr
;
89 u8 alloc_ctrs
[AFS_DIR_MAX_BLOCKS
];
90 __be16 hashtable
[AFS_DIR_HASHTBL_SIZE
];
93 union afs_xdr_dirent dirents
[AFS_DIR_SLOTS_PER_BLOCK
];
97 * Directory layout on a linux VM page.
99 struct afs_xdr_dir_page
{
100 union afs_xdr_dir_block blocks
[AFS_DIR_BLOCKS_PER_PAGE
];
103 #endif /* XDR_FS_H */