[Cluster-devel] GFS2: Clean up journal extent mapping

Steven Whitehouse swhiteho at redhat.com
Thu Mar 6 13:58:52 UTC 2014


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.





More information about the Cluster-devel mailing list