Skip to content

Commit e34c16c

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
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 <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent f0418e4 commit e34c16c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

fs/gfs2/quota.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ static int gfs2_write_disk_quota(struct gfs2_sbd *sdp, struct gfs2_quota *qp,
802802
{
803803
unsigned long pg_beg;
804804
unsigned pg_off, nbytes, overflow = 0;
805-
int pg_oflow = 0, error;
805+
int error;
806806
void *ptr;
807807

808808
nbytes = sizeof(struct gfs2_quota);
@@ -811,16 +811,14 @@ static int gfs2_write_disk_quota(struct gfs2_sbd *sdp, struct gfs2_quota *qp,
811811
pg_off = offset_in_page(loc);
812812

813813
/* If the quota straddles a page boundary, split the write in two */
814-
if ((pg_off + nbytes) > PAGE_SIZE) {
815-
pg_oflow = 1;
814+
if ((pg_off + nbytes) > PAGE_SIZE)
816815
overflow = (pg_off + nbytes) - PAGE_SIZE;
817-
}
818816

819817
ptr = qp;
820818
error = gfs2_write_buf_to_page(sdp, pg_beg, pg_off, ptr,
821819
nbytes - overflow);
822820
/* If there's an overflow, write the remaining bytes to the next page */
823-
if (!error && pg_oflow)
821+
if (!error && overflow)
824822
error = gfs2_write_buf_to_page(sdp, pg_beg + 1, 0,
825823
ptr + nbytes - overflow,
826824
overflow);

0 commit comments

Comments
 (0)