From: Steven Whitehouse Date: Thu, 06 Mar 2014 13:58:52 +0000 Subject: [Cluster-devel] GFS2: Clean up journal extent mapping In-Reply-To: <2080409125.10226925.1394113584445.JavaMail.zimbra@redhat.com> References: <1394106908.2729.15.camel@menhir> <2080409125.10226925.1394113584445.JavaMail.zimbra@redhat.com> Message-ID: <1394114332.2729.18.camel@menhir> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On Thu, 2014-03-06 at 08:46 -0500, Bob Peterson wrote: > ----- Original Message ----- > | +int gfs2_map_journal_extents(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd) > | +{ > | + u64 lblock = 0; > | + u64 lblock_stop; > | + struct gfs2_inode *ip = GFS2_I(jd->jd_inode); > | + struct buffer_head bh; > | + unsigned int shift = sdp->sd_sb.sb_bsize_shift; > | + u64 size; > | + int rc; > | + > | + lblock_stop = i_size_read(jd->jd_inode) >> shift; > | + size = (lblock_stop - lblock) << shift; > > Since lblock is 0, this could be simplified to lblock_stop << shift; > unless, of course, there's a piece missing. > Other than that, this looks like a nice cleanup. > > Bob Peterson > Red Hat File Systems Yes, thats true, but I may leave that for a future patch. It matches the code in gfs2_write_alloc_required() which is largely where this was taken from. There are a lot of things we should be able to do in due course as a result of this on the recovery side and I already have some other patches, so I'll try and remember to fix it shortly, Steve.