Skip to content

Commit

Permalink
btrfs: prepare_pages rename err to ret
Browse files Browse the repository at this point in the history
A simple, trivial rename of err to ret to maintain consistent coding
style and reduce confusion

Signed-off-by: Anand Jain <anand.jain@oracle.com>
  • Loading branch information
asj committed Mar 25, 2024
1 parent 9f1889d commit f09fdb2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ static noinline int prepare_pages(struct inode *inode, struct page **pages,
unsigned long index = pos >> PAGE_SHIFT;
gfp_t mask = get_prepare_gfp_flags(inode, nowait);
fgf_t fgp_flags = get_prepare_fgp_flags(nowait);
int err = 0;
int ret = 0;
int faili;

for (i = 0; i < num_pages; i++) {
Expand All @@ -925,28 +925,28 @@ static noinline int prepare_pages(struct inode *inode, struct page **pages,
if (!pages[i]) {
faili = i - 1;
if (nowait)
err = -EAGAIN;
ret = -EAGAIN;
else
err = -ENOMEM;
ret = -ENOMEM;
goto fail;
}

err = set_page_extent_mapped(pages[i]);
if (err < 0) {
ret = set_page_extent_mapped(pages[i]);
if (ret < 0) {
faili = i;
goto fail;
}

if (i == 0)
err = prepare_uptodate_page(inode, pages[i], pos,
ret = prepare_uptodate_page(inode, pages[i], pos,
force_uptodate);
if (!err && i == num_pages - 1)
err = prepare_uptodate_page(inode, pages[i],
if (!ret && i == num_pages - 1)
ret = prepare_uptodate_page(inode, pages[i],
pos + write_bytes, false);
if (err) {
if (ret) {
put_page(pages[i]);
if (!nowait && err == -EAGAIN) {
err = 0;
if (!nowait && ret == -EAGAIN) {
ret = 0;
goto again;
}
faili = i - 1;
Expand All @@ -962,7 +962,7 @@ static noinline int prepare_pages(struct inode *inode, struct page **pages,
put_page(pages[faili]);
faili--;
}
return err;
return ret;

}

Expand Down

0 comments on commit f09fdb2

Please sign in to comment.