[Cluster-devel] [PATCH] gfs2: Minor PAGE_SIZE arithmetic cleanups

Andreas Gruenbacher agruenba at redhat.com
Wed Sep 4 18:25:52 UTC 2019


On Tue, Sep 3, 2019 at 9:49 AM Andreas Gruenbacher <agruenba at redhat.com> wrote:
> diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
> index 69c4b77f127b..f95606f2157a 100644
> --- a/fs/gfs2/quota.c
> +++ b/fs/gfs2/quota.c
> @@ -774,7 +774,7 @@ static int gfs2_write_disk_quota(struct gfs2_inode *ip, struct gfs2_quota *qp,
>         nbytes = sizeof(struct gfs2_quota);
>
>         pg_beg = loc >> PAGE_SHIFT;
> -       pg_off = loc % PAGE_SIZE;
> +       pg_off = loc & (PAGE_SIZE - 1);

Should have used offset_in_page() here. I'm fixing that.

Andreas




More information about the Cluster-devel mailing list