Repository navigation
Commit b0bd158
loop: Refactor loop_set_status() size calculation
figure_loop_size() calculates the loop size based on the passed in
parameters, but at the same time it updates the offset and sizelimit
parameters in the loop device configuration. That is a somewhat
unexpected side effect of a function with this name, and it is only only
needed by one of the two callers of this function - loop_set_status().
Move the lo_offset and lo_sizelimit assignment back into loop_set_status(),
and use the newly factored out functions to validate and apply the newly
calculated size. This allows us to get rid of figure_loop_size() in a
follow-up commit.
Signed-off-by: Martijn Coenen <maco@android.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 716ad09 commit b0bd158
1 file changed
Lines changed: 19 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | 253 | | |
259 | 254 | | |
260 | 255 | | |
| |||
1272 | 1267 | | |
1273 | 1268 | | |
1274 | 1269 | | |
| 1270 | + | |
1275 | 1271 | | |
1276 | 1272 | | |
1277 | 1273 | | |
| |||
1293 | 1289 | | |
1294 | 1290 | | |
1295 | 1291 | | |
| 1292 | + | |
1296 | 1293 | | |
1297 | 1294 | | |
1298 | 1295 | | |
1299 | 1296 | | |
1300 | 1297 | | |
1301 | 1298 | | |
1302 | 1299 | | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
1303 | 1309 | | |
1304 | 1310 | | |
1305 | 1311 | | |
| |||
1323 | 1329 | | |
1324 | 1330 | | |
1325 | 1331 | | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
| 1332 | + | |
| 1333 | + | |
1339 | 1334 | | |
1340 | 1335 | | |
1341 | 1336 | | |
| |||
1359 | 1354 | | |
1360 | 1355 | | |
1361 | 1356 | | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
1362 | 1363 | | |
1363 | 1364 | | |
1364 | 1365 | | |
| |||
0 commit comments