From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Thu, 5 Jul 2018 09:15:39 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Eliminate redundant ip->i_rgd in favor of ip->i_res.rs_rgd In-Reply-To: References: <1648117919.27803518.1498840835498.JavaMail.zimbra@redhat.com> Message-ID: <1909295817.48133777.1530796539062.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- > On 30 June 2017 at 18:40, Bob Peterson 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 (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