summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2023-05-31 10:47:17 -0500
committerAndreas Gruenbacher <agruenba@redhat.com>2023-09-05 15:58:17 +0200
commitf0418e4b568ac4759336e1ff8a53582ec88ea966 (patch)
tree8742003bf5be0f4f851dbf8752d896c7152b36b0 /fs
parentd96dad2715672c8b9f16b54216da46514aaeb453 (diff)
gfs2: remove unneeded variable done
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 <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/quota.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 7b79fcc65763..59c6fa01455d 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -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;
@@ -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;
@@ -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) */