diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2018-04-16 09:25:21 -0700 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-04-16 09:25:21 -0700 |
commit | 9a38662ba4e2682f3f3e9f3ce02a243b837aa8c6 (patch) | |
tree | 04e48c2048033df4b4ba399fd922405c9bb1ac6c /fs/gfs2/bmap.c | |
parent | 16e205cf42da1f497b10a4a24f563e6c0d574eec (diff) |
gfs2: Remove sdp->sd_jheightsize
GFS2 keeps two arrarys in the superblock that define the maximum size of
an inode depending on the inode's height: sdp->sd_heightsize defines the
heights in units of sb->s_blocksize; sdp->sd_jheightsize defines them in
units of sb->s_blocksize - sizeof(struct gfs2_meta_header). These
arrays are used to determine when additional layers of indirect blocks
are needed. The second array is used for directories which have an
additional gfs2_meta_header at the beginning of each block.
Distinguishing between these two cases makes no sense: the height
required for representing N blocks will come out the same no matter if
the calculation is done in gross (sb->s_blocksize) or net
(sb->s_blocksize - sizeof(struct gfs2_meta_header)) units.
Stuffed directories don't have an additional gfs2_meta_header, but the
stuffed case is handled separately for both files and directories,
anyway.
Remove the unncessary sdp->sd_jheightsize array.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r-- | fs/gfs2/bmap.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 278ed0869c3c..0590e93494f7 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -700,8 +700,6 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length, struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_sbd *sdp = GFS2_SB(inode); struct metapath mp = { .mp_aheight = 1, }; - unsigned int factor = sdp->sd_sb.sb_bsize; - const u64 *arr = sdp->sd_heightsize; __be64 *ptr; sector_t lblock; sector_t lend; @@ -737,22 +735,12 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length, iomap->flags = IOMAP_F_MERGED; bmap_lock(ip, flags & IOMAP_WRITE); - /* - * Directory data blocks have a struct gfs2_meta_header header, so the - * remaining size is smaller than the filesystem block size. Logical - * block numbers for directories are in units of this remaining size! - */ - if (gfs2_is_dir(ip)) { - factor = sdp->sd_jbsize; - arr = sdp->sd_jheightsize; - } - ret = gfs2_meta_inode_buffer(ip, &mp.mp_bh[0]); if (ret) goto out_release; height = ip->i_height; - while ((lblock + 1) * factor > arr[height]) + while ((lblock + 1) * sdp->sd_sb.sb_bsize > sdp->sd_heightsize[height]) height++; find_metapath(sdp, lblock, &mp, height); if (height > ip->i_height || gfs2_is_stuffed(ip)) |