Skip to content

Commit

Permalink
gfs2: remove unneeded variable done
Browse files Browse the repository at this point in the history
Function gfs2_write_buf_to_page uses variable done to exit its loop, but
it's unnecessary if we just code an infinite loop and exit when we need.

Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Andreas Gruenbacher <[email protected]>
  • Loading branch information
AstralBob authored and Andreas Gruenbacher committed Sep 5, 2023
1 parent d96dad2 commit f0418e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ static int gfs2_write_buf_to_page(struct gfs2_sbd *sdp, unsigned long index,
u64 blk;
unsigned bsize = sdp->sd_sb.sb_bsize, bnum = 0, boff = 0;
unsigned to_write = bytes, pg_off = off;
int done = 0;

blk = index << (PAGE_SHIFT - sdp->sd_sb.sb_bsize_shift);
boff = off % bsize;
Expand All @@ -752,7 +751,7 @@ static int gfs2_write_buf_to_page(struct gfs2_sbd *sdp, unsigned long index,
create_empty_buffers(page, bsize, 0);

bh = page_buffers(page);
while (!done) {
for(;;) {
/* Find the beginning block within the page */
if (pg_off >= ((bnum * bsize) + bsize)) {
bh = bh->b_this_page;
Expand Down Expand Up @@ -781,7 +780,7 @@ static int gfs2_write_buf_to_page(struct gfs2_sbd *sdp, unsigned long index,
boff = pg_off % bsize;
continue;
}
done = 1;
break;
}

/* Write to the page, now that we have setup the buffer(s) */
Expand Down

0 comments on commit f0418e4

Please sign in to comment.