diff options
author | Bob Peterson <rpeterso@redhat.com> | 2023-05-31 11:41:16 -0500 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2023-09-05 15:58:17 +0200 |
commit | e34c16c9c699461e7d3f9eed28069e3b8466d871 (patch) | |
tree | d401134cecf2af2bcfbae332f7b8d36e25e133f8 /fs/gfs2 | |
parent | f0418e4b568ac4759336e1ff8a53582ec88ea966 (diff) |
gfs2: remove unneeded pg_oflow variable
Function gfs2_write_disk_quota checks if its write overflows onto
another page, and if so, does a second write. Before this patch it kept
two variables for this, but only one is needed. This patch simplifies
it by eliminating pg_oflow.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/quota.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 59c6fa01455d..678b21cad303 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -802,7 +802,7 @@ static int gfs2_write_disk_quota(struct gfs2_sbd *sdp, struct gfs2_quota *qp, { unsigned long pg_beg; unsigned pg_off, nbytes, overflow = 0; - int pg_oflow = 0, error; + int error; void *ptr; nbytes = sizeof(struct gfs2_quota); @@ -811,16 +811,14 @@ static int gfs2_write_disk_quota(struct gfs2_sbd *sdp, struct gfs2_quota *qp, pg_off = offset_in_page(loc); /* If the quota straddles a page boundary, split the write in two */ - if ((pg_off + nbytes) > PAGE_SIZE) { - pg_oflow = 1; + if ((pg_off + nbytes) > PAGE_SIZE) overflow = (pg_off + nbytes) - PAGE_SIZE; - } ptr = qp; error = gfs2_write_buf_to_page(sdp, pg_beg, pg_off, ptr, nbytes - overflow); /* If there's an overflow, write the remaining bytes to the next page */ - if (!error && pg_oflow) + if (!error && overflow) error = gfs2_write_buf_to_page(sdp, pg_beg + 1, 0, ptr + nbytes - overflow, overflow); |