@@ -57,31 +57,6 @@ xfs_buf_log_format_size(
57
57
(blfp -> blf_map_size * sizeof (blfp -> blf_data_map [0 ]));
58
58
}
59
59
60
- /*
61
- * We only have to worry about discontiguous buffer range straddling on unmapped
62
- * buffers. Everything else will have a contiguous data region we can copy from.
63
- */
64
- static inline bool
65
- xfs_buf_item_straddle (
66
- struct xfs_buf * bp ,
67
- uint offset ,
68
- int first_bit ,
69
- int nbits )
70
- {
71
- void * first , * last ;
72
-
73
- if (bp -> b_page_count == 1 )
74
- return false;
75
-
76
- first = xfs_buf_offset (bp , offset + (first_bit << XFS_BLF_SHIFT ));
77
- last = xfs_buf_offset (bp ,
78
- offset + ((first_bit + nbits ) << XFS_BLF_SHIFT ));
79
-
80
- if (last - first != nbits * XFS_BLF_CHUNK )
81
- return true;
82
- return false;
83
- }
84
-
85
60
/*
86
61
* Return the number of log iovecs and space needed to log the given buf log
87
62
* item segment.
@@ -98,11 +73,8 @@ xfs_buf_item_size_segment(
98
73
int * nvecs ,
99
74
int * nbytes )
100
75
{
101
- struct xfs_buf * bp = bip -> bli_buf ;
102
76
int first_bit ;
103
77
int nbits ;
104
- int next_bit ;
105
- int last_bit ;
106
78
107
79
first_bit = xfs_next_bit (blfp -> blf_data_map , blfp -> blf_map_size , 0 );
108
80
if (first_bit == -1 )
@@ -115,15 +87,6 @@ xfs_buf_item_size_segment(
115
87
nbits = xfs_contig_bits (blfp -> blf_data_map ,
116
88
blfp -> blf_map_size , first_bit );
117
89
ASSERT (nbits > 0 );
118
-
119
- /*
120
- * Straddling a page is rare because we don't log contiguous
121
- * chunks of unmapped buffers anywhere.
122
- */
123
- if (nbits > 1 &&
124
- xfs_buf_item_straddle (bp , offset , first_bit , nbits ))
125
- goto slow_scan ;
126
-
127
90
(* nvecs )++ ;
128
91
* nbytes += nbits * XFS_BLF_CHUNK ;
129
92
@@ -138,43 +101,6 @@ xfs_buf_item_size_segment(
138
101
} while (first_bit != -1 );
139
102
140
103
return ;
141
-
142
- slow_scan :
143
- ASSERT (bp -> b_addr == NULL );
144
- last_bit = first_bit ;
145
- nbits = 1 ;
146
- while (last_bit != -1 ) {
147
-
148
- * nbytes += XFS_BLF_CHUNK ;
149
-
150
- /*
151
- * This takes the bit number to start looking from and
152
- * returns the next set bit from there. It returns -1
153
- * if there are no more bits set or the start bit is
154
- * beyond the end of the bitmap.
155
- */
156
- next_bit = xfs_next_bit (blfp -> blf_data_map , blfp -> blf_map_size ,
157
- last_bit + 1 );
158
- /*
159
- * If we run out of bits, leave the loop,
160
- * else if we find a new set of bits bump the number of vecs,
161
- * else keep scanning the current set of bits.
162
- */
163
- if (next_bit == -1 ) {
164
- if (first_bit != last_bit )
165
- (* nvecs )++ ;
166
- break ;
167
- } else if (next_bit != last_bit + 1 ||
168
- xfs_buf_item_straddle (bp , offset , first_bit , nbits )) {
169
- last_bit = next_bit ;
170
- first_bit = next_bit ;
171
- (* nvecs )++ ;
172
- nbits = 1 ;
173
- } else {
174
- last_bit ++ ;
175
- nbits ++ ;
176
- }
177
- }
178
104
}
179
105
180
106
/*
@@ -287,8 +213,6 @@ xfs_buf_item_format_segment(
287
213
struct xfs_buf * bp = bip -> bli_buf ;
288
214
uint base_size ;
289
215
int first_bit ;
290
- int last_bit ;
291
- int next_bit ;
292
216
uint nbits ;
293
217
294
218
/* copy the flags across from the base format item */
@@ -333,15 +257,6 @@ xfs_buf_item_format_segment(
333
257
nbits = xfs_contig_bits (blfp -> blf_data_map ,
334
258
blfp -> blf_map_size , first_bit );
335
259
ASSERT (nbits > 0 );
336
-
337
- /*
338
- * Straddling a page is rare because we don't log contiguous
339
- * chunks of unmapped buffers anywhere.
340
- */
341
- if (nbits > 1 &&
342
- xfs_buf_item_straddle (bp , offset , first_bit , nbits ))
343
- goto slow_scan ;
344
-
345
260
xfs_buf_item_copy_iovec (lv , vecp , bp , offset ,
346
261
first_bit , nbits );
347
262
blfp -> blf_size ++ ;
@@ -357,45 +272,6 @@ xfs_buf_item_format_segment(
357
272
} while (first_bit != -1 );
358
273
359
274
return ;
360
-
361
- slow_scan :
362
- ASSERT (bp -> b_addr == NULL );
363
- last_bit = first_bit ;
364
- nbits = 1 ;
365
- for (;;) {
366
- /*
367
- * This takes the bit number to start looking from and
368
- * returns the next set bit from there. It returns -1
369
- * if there are no more bits set or the start bit is
370
- * beyond the end of the bitmap.
371
- */
372
- next_bit = xfs_next_bit (blfp -> blf_data_map , blfp -> blf_map_size ,
373
- (uint )last_bit + 1 );
374
- /*
375
- * If we run out of bits fill in the last iovec and get out of
376
- * the loop. Else if we start a new set of bits then fill in
377
- * the iovec for the series we were looking at and start
378
- * counting the bits in the new one. Else we're still in the
379
- * same set of bits so just keep counting and scanning.
380
- */
381
- if (next_bit == -1 ) {
382
- xfs_buf_item_copy_iovec (lv , vecp , bp , offset ,
383
- first_bit , nbits );
384
- blfp -> blf_size ++ ;
385
- break ;
386
- } else if (next_bit != last_bit + 1 ||
387
- xfs_buf_item_straddle (bp , offset , first_bit , nbits )) {
388
- xfs_buf_item_copy_iovec (lv , vecp , bp , offset ,
389
- first_bit , nbits );
390
- blfp -> blf_size ++ ;
391
- first_bit = next_bit ;
392
- last_bit = next_bit ;
393
- nbits = 1 ;
394
- } else {
395
- last_bit ++ ;
396
- nbits ++ ;
397
- }
398
- }
399
275
}
400
276
401
277
/*
0 commit comments