summaryrefslogtreecommitdiff
path: root/fs/afs/xdr_fs.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-04-06 14:17:25 +0100
committerDavid Howells <dhowells@redhat.com>2018-04-09 21:54:48 +0100
commit0031763698d197d779fcafe5685f6e7818b70d32 (patch)
treec394fab3401bb476c034c51dcefb1da1d36e55fa /fs/afs/xdr_fs.h
parent4ea219a839bf85cf774299e2f817e609ba7ef331 (diff)
afs: Adjust the directory XDR structures
Adjust the AFS directory XDR structures in a number of superficial ways: (1) Rename them to all begin afs_xdr_. (2) Use u8 instead of uint8_t. (3) Mark the structures as __packed so they don't get rearranged by the compiler. (4) Rename the hdr member of afs_xdr_dir_block to meta. (5) Rename the pagehdr member of afs_xdr_dir_block to hdr. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/xdr_fs.h')
-rw-r--r--fs/afs/xdr_fs.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/afs/xdr_fs.h b/fs/afs/xdr_fs.h
index 63e87ccbb55b..aa21f3068d52 100644
--- a/fs/afs/xdr_fs.h
+++ b/fs/afs/xdr_fs.h
@@ -51,53 +51,53 @@ struct afs_xdr_AFSFetchStatus {
/*
* Directory entry structure.
*/
-union afs_dirent {
+union afs_xdr_dirent {
struct {
- uint8_t valid;
- uint8_t unused[1];
+ u8 valid;
+ u8 unused[1];
__be16 hash_next;
__be32 vnode;
__be32 unique;
- uint8_t name[16];
- uint8_t overflow[4]; /* if any char of the name (inc
+ u8 name[16];
+ u8 overflow[4]; /* if any char of the name (inc
* NUL) reaches here, consume
* the next dirent too */
} u;
- uint8_t extended_name[32];
-};
+ u8 extended_name[32];
+} __packed;
/*
- * Directory page header (one at the beginning of every 2048-byte chunk).
+ * Directory block header (one at the beginning of every 2048-byte block).
*/
-struct afs_dir_pagehdr {
+struct afs_xdr_dir_hdr {
__be16 npages;
__be16 magic;
#define AFS_DIR_MAGIC htons(1234)
- uint8_t reserved;
- uint8_t bitmap[8];
- uint8_t pad[19];
-};
+ u8 reserved;
+ u8 bitmap[8];
+ u8 pad[19];
+} __packed;
/*
* Directory block layout
*/
-union afs_dir_block {
- struct afs_dir_pagehdr pagehdr;
+union afs_xdr_dir_block {
+ struct afs_xdr_dir_hdr hdr;
struct {
- struct afs_dir_pagehdr pagehdr;
- uint8_t alloc_ctrs[AFS_DIR_MAX_BLOCKS];
+ struct afs_xdr_dir_hdr hdr;
+ u8 alloc_ctrs[AFS_DIR_MAX_BLOCKS];
__be16 hashtable[AFS_DIR_HASHTBL_SIZE];
- } hdr;
+ } meta;
- union afs_dirent dirents[AFS_DIR_SLOTS_PER_BLOCK];
-};
+ union afs_xdr_dirent dirents[AFS_DIR_SLOTS_PER_BLOCK];
+} __packed;
/*
* Directory layout on a linux VM page.
*/
-struct afs_dir_page {
- union afs_dir_block blocks[AFS_DIR_BLOCKS_PER_PAGE];
+struct afs_xdr_dir_page {
+ union afs_xdr_dir_block blocks[AFS_DIR_BLOCKS_PER_PAGE];
};
#endif /* XDR_FS_H */