Blame view
fs/afs/xdr_fs.h
2.03 KB
b4d0d230c treewide: Replace... |
1 |
/* SPDX-License-Identifier: GPL-2.0-or-later */ |
dd9fbcb8e afs: Rearrange st... |
2 3 4 5 |
/* AFS fileserver XDR types * * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) |
dd9fbcb8e afs: Rearrange st... |
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
*/ #ifndef XDR_FS_H #define XDR_FS_H struct afs_xdr_AFSFetchStatus { __be32 if_version; #define AFS_FSTATUS_VERSION 1 __be32 type; __be32 nlink; __be32 size_lo; __be32 data_version_lo; __be32 author; __be32 owner; __be32 caller_access; __be32 anon_access; __be32 mode; __be32 parent_vnode; __be32 parent_unique; __be32 seg_size; __be32 mtime_client; __be32 mtime_server; __be32 group; __be32 sync_counter; __be32 data_version_hi; __be32 lock_count; __be32 size_hi; __be32 abort_code; } __packed; |
4ea219a83 afs: Split the di... |
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
#define AFS_DIR_HASHTBL_SIZE 128 #define AFS_DIR_DIRENT_SIZE 32 #define AFS_DIR_SLOTS_PER_BLOCK 64 #define AFS_DIR_BLOCK_SIZE 2048 #define AFS_DIR_BLOCKS_PER_PAGE (PAGE_SIZE / AFS_DIR_BLOCK_SIZE) #define AFS_DIR_MAX_SLOTS 65536 #define AFS_DIR_BLOCKS_WITH_CTR 128 #define AFS_DIR_MAX_BLOCKS 1023 #define AFS_DIR_RESV_BLOCKS 1 #define AFS_DIR_RESV_BLOCKS0 13 /* * Directory entry structure. */ |
003176369 afs: Adjust the d... |
49 |
union afs_xdr_dirent { |
4ea219a83 afs: Split the di... |
50 |
struct { |
003176369 afs: Adjust the d... |
51 52 |
u8 valid; u8 unused[1]; |
4ea219a83 afs: Split the di... |
53 54 55 |
__be16 hash_next; __be32 vnode; __be32 unique; |
003176369 afs: Adjust the d... |
56 57 |
u8 name[16]; u8 overflow[4]; /* if any char of the name (inc |
4ea219a83 afs: Split the di... |
58 59 60 |
* NUL) reaches here, consume * the next dirent too */ } u; |
003176369 afs: Adjust the d... |
61 62 |
u8 extended_name[32]; } __packed; |
4ea219a83 afs: Split the di... |
63 64 |
/* |
003176369 afs: Adjust the d... |
65 |
* Directory block header (one at the beginning of every 2048-byte block). |
4ea219a83 afs: Split the di... |
66 |
*/ |
003176369 afs: Adjust the d... |
67 |
struct afs_xdr_dir_hdr { |
4ea219a83 afs: Split the di... |
68 69 70 |
__be16 npages; __be16 magic; #define AFS_DIR_MAGIC htons(1234) |
003176369 afs: Adjust the d... |
71 72 73 74 |
u8 reserved; u8 bitmap[8]; u8 pad[19]; } __packed; |
4ea219a83 afs: Split the di... |
75 76 77 78 |
/* * Directory block layout */ |
003176369 afs: Adjust the d... |
79 80 |
union afs_xdr_dir_block { struct afs_xdr_dir_hdr hdr; |
4ea219a83 afs: Split the di... |
81 82 |
struct { |
003176369 afs: Adjust the d... |
83 84 |
struct afs_xdr_dir_hdr hdr; u8 alloc_ctrs[AFS_DIR_MAX_BLOCKS]; |
4ea219a83 afs: Split the di... |
85 |
__be16 hashtable[AFS_DIR_HASHTBL_SIZE]; |
003176369 afs: Adjust the d... |
86 |
} meta; |
4ea219a83 afs: Split the di... |
87 |
|
003176369 afs: Adjust the d... |
88 89 |
union afs_xdr_dirent dirents[AFS_DIR_SLOTS_PER_BLOCK]; } __packed; |
4ea219a83 afs: Split the di... |
90 91 92 93 |
/* * Directory layout on a linux VM page. */ |
003176369 afs: Adjust the d... |
94 95 |
struct afs_xdr_dir_page { union afs_xdr_dir_block blocks[AFS_DIR_BLOCKS_PER_PAGE]; |
4ea219a83 afs: Split the di... |
96 |
}; |
dd9fbcb8e afs: Rearrange st... |
97 |
#endif /* XDR_FS_H */ |