int bit; /* bit number in the word */
xfs_fileoff_t block; /* bitmap block number */
struct xfs_buf *bp; /* buf for the block */
- xfs_rtword_t *bufp; /* starting word in buffer */
int error; /* error value */
xfs_rtxnum_t firstbit; /* first useful bit in the word */
xfs_rtxnum_t i; /* current bit number rel. to start */
if (error) {
return error;
}
- bufp = bp->b_addr;
+
/*
* Get the first word's index & point to it.
*/
word = xfs_rtx_to_rbmword(mp, start);
- b = &bufp[word];
+ b = xfs_rbmblock_wordptr(bp, word);
bit = (int)(start & (XFS_NBWORD - 1));
len = start - limit + 1;
/*
if (error) {
return error;
}
- bufp = bp->b_addr;
+
word = mp->m_blockwsize - 1;
- b = &bufp[word];
+ b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the previous word in the buffer.
if (error) {
return error;
}
- bufp = bp->b_addr;
+
word = mp->m_blockwsize - 1;
- b = &bufp[word];
+ b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the previous word in the buffer.
int bit; /* bit number in the word */
xfs_fileoff_t block; /* bitmap block number */
struct xfs_buf *bp; /* buf for the block */
- xfs_rtword_t *bufp; /* starting word in buffer */
int error; /* error value */
xfs_rtxnum_t i; /* current bit number rel. to start */
xfs_rtxnum_t lastbit; /* last useful bit in the word */
if (error) {
return error;
}
- bufp = bp->b_addr;
+
/*
* Get the first word's index & point to it.
*/
word = xfs_rtx_to_rbmword(mp, start);
- b = &bufp[word];
+ b = xfs_rbmblock_wordptr(bp, word);
bit = (int)(start & (XFS_NBWORD - 1));
len = limit - start + 1;
/*
if (error) {
return error;
}
- b = bufp = bp->b_addr;
+
word = 0;
+ b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the previous word in the buffer.
if (error) {
return error;
}
- b = bufp = bp->b_addr;
+
word = 0;
+ b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the next word in the buffer.
int bit; /* bit number in the word */
xfs_fileoff_t block; /* bitmap block number */
struct xfs_buf *bp; /* buf for the block */
- xfs_rtword_t *bufp; /* starting word in buffer */
int error; /* error value */
xfs_rtword_t *first; /* first used word in the buffer */
int i; /* current bit number rel. to start */
if (error) {
return error;
}
- bufp = bp->b_addr;
+
/*
* Compute the starting word's address, and starting bit.
*/
word = xfs_rtx_to_rbmword(mp, start);
- first = b = &bufp[word];
+ first = b = xfs_rbmblock_wordptr(bp, word);
bit = (int)(start & (XFS_NBWORD - 1));
/*
* 0 (allocated) => all zeroes; 1 (free) => all ones.
* Get the next one.
*/
xfs_trans_log_buf(tp, bp,
- (uint)((char *)first - (char *)bufp),
- (uint)((char *)b - (char *)bufp));
+ (uint)((char *)first - (char *)bp->b_addr),
+ (uint)((char *)b - (char *)bp->b_addr));
error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp);
if (error) {
return error;
}
- first = b = bufp = bp->b_addr;
+
word = 0;
+ first = b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the next word in the buffer
* Get the next one.
*/
xfs_trans_log_buf(tp, bp,
- (uint)((char *)first - (char *)bufp),
- (uint)((char *)b - (char *)bufp));
+ (uint)((char *)first - (char *)bp->b_addr),
+ (uint)((char *)b - (char *)bp->b_addr));
error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp);
if (error) {
return error;
}
- first = b = bufp = bp->b_addr;
+
word = 0;
+ first = b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the next word in the buffer
* Log any remaining changed bytes.
*/
if (b > first)
- xfs_trans_log_buf(tp, bp, (uint)((char *)first - (char *)bufp),
- (uint)((char *)b - (char *)bufp - 1));
+ xfs_trans_log_buf(tp, bp,
+ (uint)((char *)first - (char *)bp->b_addr),
+ (uint)((char *)b - (char *)bp->b_addr - 1));
return 0;
}
int bit; /* bit number in the word */
xfs_fileoff_t block; /* bitmap block number */
struct xfs_buf *bp; /* buf for the block */
- xfs_rtword_t *bufp; /* starting word in buffer */
int error; /* error value */
xfs_rtxnum_t i; /* current bit number rel. to start */
xfs_rtxnum_t lastbit; /* last useful bit in word */
if (error) {
return error;
}
- bufp = bp->b_addr;
+
/*
* Compute the starting word's address, and starting bit.
*/
word = xfs_rtx_to_rbmword(mp, start);
- b = &bufp[word];
+ b = xfs_rbmblock_wordptr(bp, word);
bit = (int)(start & (XFS_NBWORD - 1));
/*
* 0 (allocated) => all zero's; 1 (free) => all one's.
if (error) {
return error;
}
- b = bufp = bp->b_addr;
+
word = 0;
+ b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the next word in the buffer.
if (error) {
return error;
}
- b = bufp = bp->b_addr;
+
word = 0;
+ b = xfs_rbmblock_wordptr(bp, word);
} else {
/*
* Go on to the next word in the buffer.