[Cluster-devel] [GFS2 PATCH] GFS2: Eliminate redundant ip->i_rgd in favor of ip->i_res.rs_rgd
Bob Peterson
rpeterso at redhat.com
Thu Jul 5 13:15:39 UTC 2018
----- Original Message -----
> On 30 June 2017 at 18:40, Bob Peterson <rpeterso at redhat.com> wrote:
> > Hi,
> >
> > Before this patch, GFS2 remembered the last rgrp it used by way of
> > a variable i_rgd. However, block allocations are made by way of a
> > reservations structure, ip->i_res, which also has a rgrp pointers.
> > These two values are at best redundant, and at worse, confuse the
> > logic and make GFS2 maintain and use two possibly opposing values.
> > The proper solution is to only use a single value. Since new block
> > allocations should be kept close to the last reservation, it makes
> > sense to only use the value in the reservations structure.
> > Therefore, this patch removes i_rgd.
> >
> > Signed-off-by: Bob Peterson <rpeterso at redhat.com>
(snip)
> > --- a/fs/gfs2/super.c
> > +++ b/fs/gfs2/super.c
> > @@ -1660,7 +1660,6 @@ static struct inode *gfs2_alloc_inode(struct
> > super_block *sb)
> > if (ip) {
> > ip->i_flags = 0;
> > ip->i_gl = NULL;
> > - ip->i_rgd = NULL;
>
> Oops, we want to initialize ip->i_res.rs_rbm.rgd here:
> + ip->i_res.rs_rbm.rgd = NULL;
>
> > memset(&ip->i_res, 0, sizeof(ip->i_res));
It shouldn't be necessary because of the memset below.
Bob Peterson
More information about the Cluster-devel
mailing list