ocfs2_fs.h (cf1d6c763fbcb115263114302485ad17e7933d87) | ocfs2_fs.h (0c044f0b24b9128ba8c297149d88bd81f2e36af3) |
---|---|
1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * ocfs2_fs.h 5 * 6 * On-disk structures for OCFS2. 7 * 8 * Copyright (C) 2002, 2004 Oracle. All rights reserved. --- 741 unchanged lines hidden (view full) --- 750 * 751 * One ocfs2_xattr_header describes how many ocfs2_xattr_entry records in 752 * the local xattr storage. 753 */ 754struct ocfs2_xattr_header { 755 __le16 xh_count; /* contains the count of how 756 many records are in the 757 local xattr storage. */ | 1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * ocfs2_fs.h 5 * 6 * On-disk structures for OCFS2. 7 * 8 * Copyright (C) 2002, 2004 Oracle. All rights reserved. --- 741 unchanged lines hidden (view full) --- 750 * 751 * One ocfs2_xattr_header describes how many ocfs2_xattr_entry records in 752 * the local xattr storage. 753 */ 754struct ocfs2_xattr_header { 755 __le16 xh_count; /* contains the count of how 756 many records are in the 757 local xattr storage. */ |
758 __le16 xh_reserved1; 759 __le32 xh_reserved2; | 758 __le16 xh_free_start; /* current offset for storing 759 xattr. */ 760 __le16 xh_name_value_len; /* total length of name/value 761 length in this bucket. */ 762 __le16 xh_num_buckets; /* bucket nums in one extent 763 record, only valid in the 764 first bucket. */ |
760 __le64 xh_csum; 761 struct ocfs2_xattr_entry xh_entries[0]; /* xattr entry list. */ 762}; 763 764/* 765 * On disk structure for xattr value root. 766 * 767 * It is used when one extended attribute's size is larger, and we will save it --- 20 unchanged lines hidden (view full) --- 788}; 789 790#define OCFS2_XATTR_INDEXED 0x1 791#define OCFS2_HASH_SHIFT 5 792#define OCFS2_XATTR_ROUND 3 793#define OCFS2_XATTR_SIZE(size) (((size) + OCFS2_XATTR_ROUND) & \ 794 ~(OCFS2_XATTR_ROUND)) 795 | 765 __le64 xh_csum; 766 struct ocfs2_xattr_entry xh_entries[0]; /* xattr entry list. */ 767}; 768 769/* 770 * On disk structure for xattr value root. 771 * 772 * It is used when one extended attribute's size is larger, and we will save it --- 20 unchanged lines hidden (view full) --- 793}; 794 795#define OCFS2_XATTR_INDEXED 0x1 796#define OCFS2_HASH_SHIFT 5 797#define OCFS2_XATTR_ROUND 3 798#define OCFS2_XATTR_SIZE(size) (((size) + OCFS2_XATTR_ROUND) & \ 799 ~(OCFS2_XATTR_ROUND)) 800 |
801#define OCFS2_XATTR_BUCKET_SIZE 4096 802#define OCFS2_XATTR_MAX_BLOCKS_PER_BUCKET (OCFS2_XATTR_BUCKET_SIZE \ 803 / OCFS2_MIN_BLOCKSIZE) 804 |
|
796/* 797 * On disk structure for xattr block. 798 */ 799struct ocfs2_xattr_block { 800/*00*/ __u8 xb_signature[8]; /* Signature for verification */ 801 __le16 xb_suballoc_slot; /* Slot suballocator this 802 block belongs to. */ 803 __le16 xb_suballoc_bit; /* Bit offset in suballocator --- 154 unchanged lines hidden (view full) --- 958 offset <<= (2 * index); 959 offset >>= sb->s_blocksize_bits; 960 return offset; 961 } 962 963 return 0; 964 965} | 805/* 806 * On disk structure for xattr block. 807 */ 808struct ocfs2_xattr_block { 809/*00*/ __u8 xb_signature[8]; /* Signature for verification */ 810 __le16 xb_suballoc_slot; /* Slot suballocator this 811 block belongs to. */ 812 __le16 xb_suballoc_bit; /* Bit offset in suballocator --- 154 unchanged lines hidden (view full) --- 967 offset <<= (2 * index); 968 offset >>= sb->s_blocksize_bits; 969 return offset; 970 } 971 972 return 0; 973 974} |
975 976static inline u16 ocfs2_xattr_recs_per_xb(struct super_block *sb) 977{ 978 int size; 979 980 size = sb->s_blocksize - 981 offsetof(struct ocfs2_xattr_block, 982 xb_attrs.xb_root.xt_list.l_recs); 983 984 return size / sizeof(struct ocfs2_extent_rec); 985} |
|
966#else 967static inline int ocfs2_fast_symlink_chars(int blocksize) 968{ 969 return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink); 970} 971 972static inline int ocfs2_max_inline_data(int blocksize) 973{ --- 67 unchanged lines hidden (view full) --- 1041 if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) { 1042 offset <<= (2 * index); 1043 offset /= blocksize; 1044 return offset; 1045 } 1046 1047 return 0; 1048} | 986#else 987static inline int ocfs2_fast_symlink_chars(int blocksize) 988{ 989 return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink); 990} 991 992static inline int ocfs2_max_inline_data(int blocksize) 993{ --- 67 unchanged lines hidden (view full) --- 1061 if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) { 1062 offset <<= (2 * index); 1063 offset /= blocksize; 1064 return offset; 1065 } 1066 1067 return 0; 1068} |
1069 1070static inline int ocfs2_xattr_recs_per_xb(int blocksize) 1071{ 1072 int size; 1073 1074 size = blocksize - 1075 offsetof(struct ocfs2_xattr_block, 1076 xb_attrs.xb_root.xt_list.l_recs); 1077 1078 return size / sizeof(struct ocfs2_extent_rec); 1079} |
|
1049#endif /* __KERNEL__ */ 1050 1051 1052static inline int ocfs2_system_inode_is_global(int type) 1053{ 1054 return ((type >= 0) && 1055 (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)); 1056} --- 30 unchanged lines hidden --- | 1080#endif /* __KERNEL__ */ 1081 1082 1083static inline int ocfs2_system_inode_is_global(int type) 1084{ 1085 return ((type >= 0) && 1086 (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)); 1087} --- 30 unchanged lines hidden --- |