Skip to content

Commit 2b34a9e

Browse files
author
Andreas Gruenbacher
committed
gfs2: minor evict_[un]linked_inode cleanup
Add gl helper variables in evict_unlinked_inode() and evict_linked_inode(). This patch isn't very interesting by itself, but it makes the next patch more readable. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent e2de651 commit 2b34a9e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

fs/gfs2/super.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,7 @@ static enum evict_behavior evict_should_delete(struct inode *inode,
12831283
static int evict_unlinked_inode(struct inode *inode)
12841284
{
12851285
struct gfs2_inode *ip = GFS2_I(inode);
1286+
struct gfs2_glock *gl = ip->i_gl;
12861287
int ret;
12871288

12881289
if (S_ISDIR(inode->i_mode) &&
@@ -1317,8 +1318,8 @@ static int evict_unlinked_inode(struct inode *inode)
13171318
*/
13181319

13191320
ret = gfs2_dinode_dealloc(ip);
1320-
if (!ret && ip->i_gl)
1321-
gfs2_inode_remember_delete(ip->i_gl, ip->i_no_formal_ino);
1321+
if (!ret && gl)
1322+
gfs2_inode_remember_delete(gl, ip->i_no_formal_ino);
13221323

13231324
out:
13241325
return ret;
@@ -1362,18 +1363,19 @@ static int evict_linked_inode(struct inode *inode)
13621363
struct super_block *sb = inode->i_sb;
13631364
struct gfs2_sbd *sdp = sb->s_fs_info;
13641365
struct gfs2_inode *ip = GFS2_I(inode);
1366+
struct gfs2_glock *gl = ip->i_gl;
13651367
struct address_space *metamapping;
13661368
int ret;
13671369

1368-
gfs2_log_flush(sdp, ip->i_gl, GFS2_LOG_HEAD_FLUSH_NORMAL |
1370+
gfs2_log_flush(sdp, gl, GFS2_LOG_HEAD_FLUSH_NORMAL |
13691371
GFS2_LFC_EVICT_INODE);
1370-
metamapping = gfs2_glock2aspace(ip->i_gl);
1371-
if (test_bit(GLF_DIRTY, &ip->i_gl->gl_flags)) {
1372+
metamapping = gfs2_glock2aspace(gl);
1373+
if (test_bit(GLF_DIRTY, &gl->gl_flags)) {
13721374
filemap_fdatawrite(metamapping);
13731375
filemap_fdatawait(metamapping);
13741376
}
13751377
write_inode_now(inode, 1);
1376-
gfs2_ail_flush(ip->i_gl, 0);
1378+
gfs2_ail_flush(gl, 0);
13771379

13781380
ret = gfs2_truncate_inode_pages(inode);
13791381
if (ret)

0 commit comments

Comments
 (0)