From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Tue, 9 Jan 2018 10:45:59 -0500 (EST) Subject: [Cluster-devel] [PATCH 10/12] gfs2: Generalize truncate code In-Reply-To: <20171222143507.26680-11-agruenba@redhat.com> References: <20171222143507.26680-1-agruenba@redhat.com> <20171222143507.26680-11-agruenba@redhat.com> Message-ID: <423563012.4436271.1515512759210.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 Hi, ----- Original Message ----- | Pull the code for computing the range of metapointers to iterate out of | gfs2_metapath_ra (for readahead), sweep_bh_for_rgrps (for deallocating | metapointers within a block), and trunc_dealloc (for walking the | metadata tree). | | In sweep_bh_for_rgrps, move the code for looking up the resource group | descriptor of the current resource group out of the inner loop. The | metatype check moves to trunc_dealloc. | | Signed-off-by: Andreas Gruenbacher | --- (snip) | @@ -1229,7 +1216,11 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, | struct gfs2_holder *rd_gh, | outside the rgrp we just processed, | do it all over again. */ | if (current->journal_info) { | - struct buffer_head *dibh = mp->mp_bh[0]; | + struct buffer_head *dibh; | + | + ret = gfs2_meta_inode_buffer(ip, &dibh); | + if (ret) | + goto out; (snip)... | + brelse(dibh); I don't understand why you prefer to use gfs2_meta_inode_buffer here instead of just using the copy we already have in the metapath. It seems to me this method would be a lot less efficient. Can you explain? Regards, Bob Peterson Red Hat File Systems