On 5 July 2018 at 15:15, Bob Peterson <[email protected]> wrote: > ----- Original Message ----- >> On 30 June 2017 at 18:40, Bob Peterson <[email protected]> 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 <[email protected]> > (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.
Right, sorry for the confusion. Andreas
