Skip to content

Commit 3abfe6c

Browse files
Christoph HellwigChandan Babu R
authored andcommitted
xfs: remove rt-wrappers from xfs_format.h
xfs_format.h has a bunch odd wrappers for helper functions and mount structure access using RT* prefixes. Replace them with their open coded versions (for those that weren't entirely unused) and remove the wrappers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
1 parent 8ceee72 commit 3abfe6c

File tree

4 files changed

+16
-24
lines changed

4 files changed

+16
-24
lines changed

fs/xfs/libxfs/xfs_format.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,20 +1156,12 @@ static inline bool xfs_dinode_has_large_extent_counts(
11561156
#define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64kB */
11571157
#define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4kB */
11581158

1159-
#define XFS_BLOCKSIZE(mp) ((mp)->m_sb.sb_blocksize)
1160-
#define XFS_BLOCKMASK(mp) ((mp)->m_blockmask)
1161-
11621159
/*
11631160
* RT bit manipulation macros.
11641161
*/
11651162
#define XFS_RTMIN(a,b) ((a) < (b) ? (a) : (b))
11661163
#define XFS_RTMAX(a,b) ((a) > (b) ? (a) : (b))
11671164

1168-
#define XFS_RTLOBIT(w) xfs_lowbit32(w)
1169-
#define XFS_RTHIBIT(w) xfs_highbit32(w)
1170-
1171-
#define XFS_RTBLOCKLOG(b) xfs_highbit64(b)
1172-
11731165
/*
11741166
* Dquot and dquot block format definitions
11751167
*/

fs/xfs/libxfs/xfs_rtbitmap.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ xfs_rtfind_back(
195195
/*
196196
* Different. Mark where we are and return.
197197
*/
198-
i = bit - XFS_RTHIBIT(wdiff);
198+
i = bit - xfs_highbit32(wdiff);
199199
*rtx = start - i + 1;
200200
return 0;
201201
}
@@ -233,7 +233,7 @@ xfs_rtfind_back(
233233
/*
234234
* Different, mark where we are and return.
235235
*/
236-
i += XFS_NBWORD - 1 - XFS_RTHIBIT(wdiff);
236+
i += XFS_NBWORD - 1 - xfs_highbit32(wdiff);
237237
*rtx = start - i + 1;
238238
return 0;
239239
}
@@ -272,7 +272,7 @@ xfs_rtfind_back(
272272
/*
273273
* Different, mark where we are and return.
274274
*/
275-
i += XFS_NBWORD - 1 - XFS_RTHIBIT(wdiff);
275+
i += XFS_NBWORD - 1 - xfs_highbit32(wdiff);
276276
*rtx = start - i + 1;
277277
return 0;
278278
} else
@@ -348,7 +348,7 @@ xfs_rtfind_forw(
348348
/*
349349
* Different. Mark where we are and return.
350350
*/
351-
i = XFS_RTLOBIT(wdiff) - bit;
351+
i = xfs_lowbit32(wdiff) - bit;
352352
*rtx = start + i - 1;
353353
return 0;
354354
}
@@ -386,7 +386,7 @@ xfs_rtfind_forw(
386386
/*
387387
* Different, mark where we are and return.
388388
*/
389-
i += XFS_RTLOBIT(wdiff);
389+
i += xfs_lowbit32(wdiff);
390390
*rtx = start + i - 1;
391391
return 0;
392392
}
@@ -423,7 +423,7 @@ xfs_rtfind_forw(
423423
/*
424424
* Different, mark where we are and return.
425425
*/
426-
i += XFS_RTLOBIT(wdiff);
426+
i += xfs_lowbit32(wdiff);
427427
*rtx = start + i - 1;
428428
return 0;
429429
} else
@@ -708,7 +708,7 @@ xfs_rtfree_range(
708708
*/
709709
if (preblock < start) {
710710
error = xfs_rtmodify_summary(args,
711-
XFS_RTBLOCKLOG(start - preblock),
711+
xfs_highbit64(start - preblock),
712712
xfs_rtx_to_rbmblock(mp, preblock), -1);
713713
if (error) {
714714
return error;
@@ -720,7 +720,7 @@ xfs_rtfree_range(
720720
*/
721721
if (postblock > end) {
722722
error = xfs_rtmodify_summary(args,
723-
XFS_RTBLOCKLOG(postblock - end),
723+
xfs_highbit64(postblock - end),
724724
xfs_rtx_to_rbmblock(mp, end + 1), -1);
725725
if (error) {
726726
return error;
@@ -731,7 +731,7 @@ xfs_rtfree_range(
731731
* (new) free extent.
732732
*/
733733
return xfs_rtmodify_summary(args,
734-
XFS_RTBLOCKLOG(postblock + 1 - preblock),
734+
xfs_highbit64(postblock + 1 - preblock),
735735
xfs_rtx_to_rbmblock(mp, preblock), 1);
736736
}
737737

@@ -800,7 +800,7 @@ xfs_rtcheck_range(
800800
/*
801801
* Different, compute first wrong bit and return.
802802
*/
803-
i = XFS_RTLOBIT(wdiff) - bit;
803+
i = xfs_lowbit32(wdiff) - bit;
804804
*new = start + i;
805805
*stat = 0;
806806
return 0;
@@ -839,7 +839,7 @@ xfs_rtcheck_range(
839839
/*
840840
* Different, compute first wrong bit and return.
841841
*/
842-
i += XFS_RTLOBIT(wdiff);
842+
i += xfs_lowbit32(wdiff);
843843
*new = start + i;
844844
*stat = 0;
845845
return 0;
@@ -877,7 +877,7 @@ xfs_rtcheck_range(
877877
/*
878878
* Different, compute first wrong bit and return.
879879
*/
880-
i += XFS_RTLOBIT(wdiff);
880+
i += xfs_lowbit32(wdiff);
881881
*new = start + i;
882882
*stat = 0;
883883
return 0;

fs/xfs/scrub/rtsummary.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ xchk_rtsum_record_free(
177177

178178
/* Compute the relevant location in the rtsum file. */
179179
rbmoff = xfs_rtx_to_rbmblock(mp, rec->ar_startext);
180-
lenlog = XFS_RTBLOCKLOG(rec->ar_extcount);
180+
lenlog = xfs_highbit64(rec->ar_extcount);
181181
offs = xfs_rtsumoffs(mp, lenlog, rbmoff);
182182

183183
rtbno = xfs_rtx_to_rtb(mp, rec->ar_startext);

fs/xfs/xfs_rtalloc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ xfs_rtallocate_range(
156156
* (old) free extent.
157157
*/
158158
error = xfs_rtmodify_summary(args,
159-
XFS_RTBLOCKLOG(postblock + 1 - preblock),
159+
xfs_highbit64(postblock + 1 - preblock),
160160
xfs_rtx_to_rbmblock(mp, preblock), -1);
161161
if (error)
162162
return error;
@@ -167,7 +167,7 @@ xfs_rtallocate_range(
167167
*/
168168
if (preblock < start) {
169169
error = xfs_rtmodify_summary(args,
170-
XFS_RTBLOCKLOG(start - preblock),
170+
xfs_highbit64(start - preblock),
171171
xfs_rtx_to_rbmblock(mp, preblock), 1);
172172
if (error)
173173
return error;
@@ -179,7 +179,7 @@ xfs_rtallocate_range(
179179
*/
180180
if (postblock > end) {
181181
error = xfs_rtmodify_summary(args,
182-
XFS_RTBLOCKLOG(postblock - end),
182+
xfs_highbit64(postblock - end),
183183
xfs_rtx_to_rbmblock(mp, end + 1), 1);
184184
if (error)
185185
return error;

0 commit comments

Comments
 (0)