Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iomap: rename bytes_pending/bytes_accounted to bytes_submitted/bytes_not_submitted

The naming "bytes_pending" and "bytes_accounted" may be confusing and
could be better named. Rename this to "bytes_submitted" and
"bytes_not_submitted" to make it more clear that these are bytes we
passed to the IO helper to read in.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Link: https://patch.msgid.link/20251111193658.3495942-2-joannelkoong@gmail.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Joanne Koong and committed by
Christian Brauner
a0f1cabe ca3557a6

+20 -19
+20 -19
fs/iomap/buffered-io.c
··· 394 394 * Else the IO helper will end the read after all submitted ranges have been 395 395 * read. 396 396 */ 397 - static void iomap_read_end(struct folio *folio, size_t bytes_pending) 397 + static void iomap_read_end(struct folio *folio, size_t bytes_submitted) 398 398 { 399 399 struct iomap_folio_state *ifs; 400 400 401 401 /* 402 - * If there are no bytes pending, this means we are responsible for 402 + * If there are no bytes submitted, this means we are responsible for 403 403 * unlocking the folio here, since no IO helper has taken ownership of 404 404 * it. 405 405 */ 406 - if (!bytes_pending) { 406 + if (!bytes_submitted) { 407 407 folio_unlock(folio); 408 408 return; 409 409 } ··· 416 416 * read_bytes_pending but skipped for IO. 417 417 * The +1 accounts for the bias we added in iomap_read_init(). 418 418 */ 419 - size_t bytes_accounted = folio_size(folio) + 1 - 420 - bytes_pending; 419 + size_t bytes_not_submitted = folio_size(folio) + 1 - 420 + bytes_submitted; 421 421 422 422 spin_lock_irq(&ifs->state_lock); 423 - ifs->read_bytes_pending -= bytes_accounted; 423 + ifs->read_bytes_pending -= bytes_not_submitted; 424 424 /* 425 425 * If !ifs->read_bytes_pending, this means all pending reads 426 426 * by the IO helper have already completed, which means we need ··· 437 437 } 438 438 439 439 static int iomap_read_folio_iter(struct iomap_iter *iter, 440 - struct iomap_read_folio_ctx *ctx, size_t *bytes_pending) 440 + struct iomap_read_folio_ctx *ctx, size_t *bytes_submitted) 441 441 { 442 442 const struct iomap *iomap = &iter->iomap; 443 443 loff_t pos = iter->pos; ··· 478 478 folio_zero_range(folio, poff, plen); 479 479 iomap_set_range_uptodate(folio, poff, plen); 480 480 } else { 481 - if (!*bytes_pending) 481 + if (!*bytes_submitted) 482 482 iomap_read_init(folio); 483 - *bytes_pending += plen; 483 + *bytes_submitted += plen; 484 484 ret = ctx->ops->read_folio_range(iter, ctx, plen); 485 485 if (ret) 486 486 return ret; ··· 504 504 .pos = folio_pos(folio), 505 505 .len = folio_size(folio), 506 506 }; 507 - size_t bytes_pending = 0; 507 + size_t bytes_submitted = 0; 508 508 int ret; 509 509 510 510 trace_iomap_readpage(iter.inode, 1); 511 511 512 512 while ((ret = iomap_iter(&iter, ops)) > 0) 513 - iter.status = iomap_read_folio_iter(&iter, ctx, &bytes_pending); 513 + iter.status = iomap_read_folio_iter(&iter, ctx, 514 + &bytes_submitted); 514 515 515 516 if (ctx->ops->submit_read) 516 517 ctx->ops->submit_read(ctx); 517 518 518 - iomap_read_end(folio, bytes_pending); 519 + iomap_read_end(folio, bytes_submitted); 519 520 } 520 521 EXPORT_SYMBOL_GPL(iomap_read_folio); 521 522 522 523 static int iomap_readahead_iter(struct iomap_iter *iter, 523 - struct iomap_read_folio_ctx *ctx, size_t *cur_bytes_pending) 524 + struct iomap_read_folio_ctx *ctx, size_t *cur_bytes_submitted) 524 525 { 525 526 int ret; 526 527 527 528 while (iomap_length(iter)) { 528 529 if (ctx->cur_folio && 529 530 offset_in_folio(ctx->cur_folio, iter->pos) == 0) { 530 - iomap_read_end(ctx->cur_folio, *cur_bytes_pending); 531 + iomap_read_end(ctx->cur_folio, *cur_bytes_submitted); 531 532 ctx->cur_folio = NULL; 532 533 } 533 534 if (!ctx->cur_folio) { 534 535 ctx->cur_folio = readahead_folio(ctx->rac); 535 536 if (WARN_ON_ONCE(!ctx->cur_folio)) 536 537 return -EINVAL; 537 - *cur_bytes_pending = 0; 538 + *cur_bytes_submitted = 0; 538 539 } 539 - ret = iomap_read_folio_iter(iter, ctx, cur_bytes_pending); 540 + ret = iomap_read_folio_iter(iter, ctx, cur_bytes_submitted); 540 541 if (ret) 541 542 return ret; 542 543 } ··· 569 568 .pos = readahead_pos(rac), 570 569 .len = readahead_length(rac), 571 570 }; 572 - size_t cur_bytes_pending; 571 + size_t cur_bytes_submitted; 573 572 574 573 trace_iomap_readahead(rac->mapping->host, readahead_count(rac)); 575 574 576 575 while (iomap_iter(&iter, ops) > 0) 577 576 iter.status = iomap_readahead_iter(&iter, ctx, 578 - &cur_bytes_pending); 577 + &cur_bytes_submitted); 579 578 580 579 if (ctx->ops->submit_read) 581 580 ctx->ops->submit_read(ctx); 582 581 583 582 if (ctx->cur_folio) 584 - iomap_read_end(ctx->cur_folio, cur_bytes_pending); 583 + iomap_read_end(ctx->cur_folio, cur_bytes_submitted); 585 584 } 586 585 EXPORT_SYMBOL_GPL(iomap_readahead); 587 586