/* SPDX-License-Identifier: GPL-2.0-or-later */ /* AFS fileserver XDR types * * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com)
*/
/* * Directory entry structure.
*/ union afs_xdr_dirent { struct {
u8 valid;
u8 unused[1];
__be16 hash_next;
__be32 vnode;
__be32 unique;
u8 name[]; /* When determining the number of dirent slots needed to * represent a directory entry, name should be assumed to be 16 * bytes, due to a now-standardised (mis)calculation, but it is * in fact 20 bytes in size. afs_dir_calc_slots() should be * used for this. * * For names longer than (16 or) 20 bytes, extra slots should * be annexed to this one using the extended_name format.
*/
} u;
u8 extended_name[32];
} __packed;
/* * Directory block header (one at the beginning of every 2048-byte block).
*/ struct afs_xdr_dir_hdr {
__be16 npages;
__be16 magic; #define AFS_DIR_MAGIC htons(1234)
u8 reserved;
u8 bitmap[8];
u8 pad[19];
} __packed;
union afs_xdr_dirent dirents[AFS_DIR_SLOTS_PER_BLOCK];
} __packed;
/* * Directory layout on a linux VM page.
*/ struct afs_xdr_dir_page { union afs_xdr_dir_block blocks[AFS_DIR_BLOCKS_PER_PAGE];
};
/* * Calculate the number of dirent slots required for any given name length. * The calculation is made assuming the part of the name in the first slot is * 16 bytes, rather than 20, but this miscalculation is now standardised.
*/ staticinlineunsignedint afs_dir_calc_slots(size_t name_len)
{
name_len++; /* NUL-terminated */ return 1 + ((name_len + 15) / AFS_DIR_DIRENT_SIZE);
}
#endif/* XDR_FS_H */
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.