diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-06-28 02:43:50 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-14 01:37:02 -0400 |
commit | bbaaf53808c778bda24f8245a440c5ceacc1a37d (patch) | |
tree | 8539cec4777f2a20681bf46c224907f661923a39 /fs/xfs/xfs_dir2_sf.h | |
parent | 54aa8e26e90da882b145fcd33ed752431d6b318b (diff) |
[XFS] Reduce shouting by removing unnecessary macros from dir2 code.
SGI-PV: 966505
SGI-Modid: xfs-linux-melb:xfs-kern:28947a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_sf.h')
-rw-r--r-- | fs/xfs/xfs_dir2_sf.h | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/fs/xfs/xfs_dir2_sf.h b/fs/xfs/xfs_dir2_sf.h index 42f015b70018..11e503209afa 100644 --- a/fs/xfs/xfs_dir2_sf.h +++ b/fs/xfs/xfs_dir2_sf.h | |||
@@ -90,7 +90,6 @@ typedef struct xfs_dir2_sf { | |||
90 | xfs_dir2_sf_entry_t list[1]; /* shortform entries */ | 90 | xfs_dir2_sf_entry_t list[1]; /* shortform entries */ |
91 | } xfs_dir2_sf_t; | 91 | } xfs_dir2_sf_t; |
92 | 92 | ||
93 | #define XFS_DIR2_SF_HDR_SIZE(i8count) xfs_dir2_sf_hdr_size(i8count) | ||
94 | static inline int xfs_dir2_sf_hdr_size(int i8count) | 93 | static inline int xfs_dir2_sf_hdr_size(int i8count) |
95 | { | 94 | { |
96 | return ((uint)sizeof(xfs_dir2_sf_hdr_t) - \ | 95 | return ((uint)sizeof(xfs_dir2_sf_hdr_t) - \ |
@@ -98,14 +97,11 @@ static inline int xfs_dir2_sf_hdr_size(int i8count) | |||
98 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t))); | 97 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t))); |
99 | } | 98 | } |
100 | 99 | ||
101 | #define XFS_DIR2_SF_INUMBERP(sfep) xfs_dir2_sf_inumberp(sfep) | ||
102 | static inline xfs_dir2_inou_t *xfs_dir2_sf_inumberp(xfs_dir2_sf_entry_t *sfep) | 100 | static inline xfs_dir2_inou_t *xfs_dir2_sf_inumberp(xfs_dir2_sf_entry_t *sfep) |
103 | { | 101 | { |
104 | return (xfs_dir2_inou_t *)&(sfep)->name[(sfep)->namelen]; | 102 | return (xfs_dir2_inou_t *)&(sfep)->name[(sfep)->namelen]; |
105 | } | 103 | } |
106 | 104 | ||
107 | #define XFS_DIR2_SF_GET_INUMBER(sfp, from) \ | ||
108 | xfs_dir2_sf_get_inumber(sfp, from) | ||
109 | static inline xfs_intino_t | 105 | static inline xfs_intino_t |
110 | xfs_dir2_sf_get_inumber(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from) | 106 | xfs_dir2_sf_get_inumber(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from) |
111 | { | 107 | { |
@@ -114,8 +110,6 @@ xfs_dir2_sf_get_inumber(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from) | |||
114 | (xfs_intino_t)XFS_GET_DIR_INO8((from)->i8)); | 110 | (xfs_intino_t)XFS_GET_DIR_INO8((from)->i8)); |
115 | } | 111 | } |
116 | 112 | ||
117 | #define XFS_DIR2_SF_PUT_INUMBER(sfp,from,to) \ | ||
118 | xfs_dir2_sf_put_inumber(sfp,from,to) | ||
119 | static inline void xfs_dir2_sf_put_inumber(xfs_dir2_sf_t *sfp, xfs_ino_t *from, | 113 | static inline void xfs_dir2_sf_put_inumber(xfs_dir2_sf_t *sfp, xfs_ino_t *from, |
120 | xfs_dir2_inou_t *to) | 114 | xfs_dir2_inou_t *to) |
121 | { | 115 | { |
@@ -125,24 +119,18 @@ static inline void xfs_dir2_sf_put_inumber(xfs_dir2_sf_t *sfp, xfs_ino_t *from, | |||
125 | XFS_PUT_DIR_INO8(*(from), (to)->i8); | 119 | XFS_PUT_DIR_INO8(*(from), (to)->i8); |
126 | } | 120 | } |
127 | 121 | ||
128 | #define XFS_DIR2_SF_GET_OFFSET(sfep) \ | ||
129 | xfs_dir2_sf_get_offset(sfep) | ||
130 | static inline xfs_dir2_data_aoff_t | 122 | static inline xfs_dir2_data_aoff_t |
131 | xfs_dir2_sf_get_offset(xfs_dir2_sf_entry_t *sfep) | 123 | xfs_dir2_sf_get_offset(xfs_dir2_sf_entry_t *sfep) |
132 | { | 124 | { |
133 | return INT_GET_UNALIGNED_16_BE(&(sfep)->offset.i); | 125 | return INT_GET_UNALIGNED_16_BE(&(sfep)->offset.i); |
134 | } | 126 | } |
135 | 127 | ||
136 | #define XFS_DIR2_SF_PUT_OFFSET(sfep,off) \ | ||
137 | xfs_dir2_sf_put_offset(sfep,off) | ||
138 | static inline void | 128 | static inline void |
139 | xfs_dir2_sf_put_offset(xfs_dir2_sf_entry_t *sfep, xfs_dir2_data_aoff_t off) | 129 | xfs_dir2_sf_put_offset(xfs_dir2_sf_entry_t *sfep, xfs_dir2_data_aoff_t off) |
140 | { | 130 | { |
141 | INT_SET_UNALIGNED_16_BE(&(sfep)->offset.i, off); | 131 | INT_SET_UNALIGNED_16_BE(&(sfep)->offset.i, off); |
142 | } | 132 | } |
143 | 133 | ||
144 | #define XFS_DIR2_SF_ENTSIZE_BYNAME(sfp,len) \ | ||
145 | xfs_dir2_sf_entsize_byname(sfp,len) | ||
146 | static inline int xfs_dir2_sf_entsize_byname(xfs_dir2_sf_t *sfp, int len) | 134 | static inline int xfs_dir2_sf_entsize_byname(xfs_dir2_sf_t *sfp, int len) |
147 | { | 135 | { |
148 | return ((uint)sizeof(xfs_dir2_sf_entry_t) - 1 + (len) - \ | 136 | return ((uint)sizeof(xfs_dir2_sf_entry_t) - 1 + (len) - \ |
@@ -150,8 +138,6 @@ static inline int xfs_dir2_sf_entsize_byname(xfs_dir2_sf_t *sfp, int len) | |||
150 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t))); | 138 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t))); |
151 | } | 139 | } |
152 | 140 | ||
153 | #define XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp,sfep) \ | ||
154 | xfs_dir2_sf_entsize_byentry(sfp,sfep) | ||
155 | static inline int | 141 | static inline int |
156 | xfs_dir2_sf_entsize_byentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep) | 142 | xfs_dir2_sf_entsize_byentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep) |
157 | { | 143 | { |
@@ -160,19 +146,17 @@ xfs_dir2_sf_entsize_byentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep) | |||
160 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t))); | 146 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t))); |
161 | } | 147 | } |
162 | 148 | ||
163 | #define XFS_DIR2_SF_FIRSTENTRY(sfp) xfs_dir2_sf_firstentry(sfp) | ||
164 | static inline xfs_dir2_sf_entry_t *xfs_dir2_sf_firstentry(xfs_dir2_sf_t *sfp) | 149 | static inline xfs_dir2_sf_entry_t *xfs_dir2_sf_firstentry(xfs_dir2_sf_t *sfp) |
165 | { | 150 | { |
166 | return ((xfs_dir2_sf_entry_t *) \ | 151 | return ((xfs_dir2_sf_entry_t *) \ |
167 | ((char *)(sfp) + XFS_DIR2_SF_HDR_SIZE(sfp->hdr.i8count))); | 152 | ((char *)(sfp) + xfs_dir2_sf_hdr_size(sfp->hdr.i8count))); |
168 | } | 153 | } |
169 | 154 | ||
170 | #define XFS_DIR2_SF_NEXTENTRY(sfp,sfep) xfs_dir2_sf_nextentry(sfp,sfep) | ||
171 | static inline xfs_dir2_sf_entry_t * | 155 | static inline xfs_dir2_sf_entry_t * |
172 | xfs_dir2_sf_nextentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep) | 156 | xfs_dir2_sf_nextentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep) |
173 | { | 157 | { |
174 | return ((xfs_dir2_sf_entry_t *) \ | 158 | return ((xfs_dir2_sf_entry_t *) \ |
175 | ((char *)(sfep) + XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp,sfep))); | 159 | ((char *)(sfep) + xfs_dir2_sf_entsize_byentry(sfp,sfep))); |
176 | } | 160 | } |
177 | 161 | ||
178 | /* | 162 | /* |