gfs2: Remove misleading comments in gfs2_evict_inode
Andreas Gruenbacher
maintainerPATCH 1/4 gfs2: Remove misleading comments in gfs2_evict_inode
Signed-off-by Andreas Gruenbacher <[email protected]>
--- fs/gfs2/super.c | 5 ----- 1 file changed, 5 deletions(-)
fs/gfs2/super.c +0 -5
@@ -1630,8 +1630,6 @@ static void gfs2_evict_inode(struct inode *inode) goto out_truncate; } -/* Case 1 starts here */ -if (S_ISDIR (inode->i_mode) && (ip->i_diskflags &GFS2_DIF_EXHASH )) { error =gfs2_dir_exhash_dealloc (ip);
@@ -1670,7 +1668,6 @@ static void gfs2_evict_inode(struct inode *inode)write_inode_now (inode,1 );gfs2_ail_flush (ip->i_gl,0 ); -/* Case 2 starts here */ error =gfs2_trans_begin (sdp,0 , sdp->sd_jdesc->jd_blocks);if (error) goto out_unlock;
@@ -1680,7 +1677,6 @@ static void gfs2_evict_inode(struct inode *inode)gfs2_trans_end (sdp); out_unlock: -/* Error path for case 1 */ if (gfs2_rs_active (&ip->i_res))gfs2_rs_deltree (&ip->i_res);
@@ -1699,7 +1695,6 @@ static void gfs2_evict_inode(struct inode *inode)if (error && error !=GLR_TRYFAILED && error != -EROFS )fs_warn (sdp,"gfs2_evict_inode: %d\n" , error); out: -/* Case 3 starts here */ truncate_inode_pages_final (&inode->i_data);gfs2_rsqa_delete (ip,NULL );gfs2_ordered_del_inode (ip);
Signature · 1 line
2.20.1
Andreas Gruenbacher
maintainerPATCH 2/4 gfs2: Remove unnecessary extern declarations
Stop declaring our log operations as extern; they are only used locally.
Signed-off-by Andreas Gruenbacher <[email protected]>
--- fs/gfs2/lops.h | 5 ----- 1 file changed, 5 deletions(-)
fs/gfs2/lops.h +0 -5
@@ -20,11 +20,6 @@ ((sizeof (struct gfs2_log_descriptor ) + (2 *sizeof (__be64) -1 )) & \ ~(2 * sizeof(__be64) - 1)) -extern const struct gfs2_log_operations gfs2_glock_lops; -extern const struct gfs2_log_operations gfs2_buf_lops; -extern const struct gfs2_log_operations gfs2_revoke_lops; -extern const struct gfs2_log_operations gfs2_databuf_lops; -extern const struct gfs2_log_operations *gfs2_log_ops[];extern u64 gfs2_log_bmap (struct gfs2_sbd *sdp); extern void gfs2_log_write(struct gfs2_sbd *sdp, struct page *page,
Signature · 1 line
2.20.1
Andreas Gruenbacher
maintainerPATCH 3/4 gfs2: Rename sd_log_le_{revoke, ordered}
In reply to Andreas GruenbacherRename sd_log_le_revoke to sd_log_revokes and sd_log_le_ordered tosd_log_ordered: not sure what le stands for here, but it doesn't add clarity, and if it stands for list entry, it's actually confusing as those are both list heads but not list entries.
Signed-off-by Andreas Gruenbacher <[email protected]>
--- fs/gfs2/incore.h | 4 ++-- fs/gfs2/log.c | 14 +++++++------- fs/gfs2/log.h | 2 +- fs/gfs2/lops.c | 4 ++-- fs/gfs2/ops_fstype.c | 4 ++-- fs/gfs2/trans.c | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-)
fs/gfs2/incore.h +2 -2
@@ -809,8 +809,8 @@ struct gfs2_sbd {atomic_t sd_log_pinned;unsigned int sd_log_num_revoke; -struct list_head sd_log_le_revoke; -struct list_head sd_log_le_ordered; +struct list_head sd_log_revokes; +struct list_head sd_log_ordered;spinlock_t sd_ordered_lock;atomic_t sd_log_thresh1;
fs/gfs2/log.c +7 -7
@@ -551,9 +551,9 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp)LIST_HEAD (written);spin_lock (&sdp->sd_ordered_lock); -list_sort (NULL , &sdp->sd_log_le_ordered, &ip_cmp); -while (!list_empty (&sdp->sd_log_le_ordered)) { - ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); +list_sort (NULL , &sdp->sd_log_ordered, &ip_cmp); +while (!list_empty (&sdp->sd_log_ordered)) { + ip = list_entry(sdp->sd_log_ordered.next, struct gfs2_inode, i_ordered);if (ip->i_inode.i_mapping->nrpages ==0 ) {test_and_clear_bit (GIF_ORDERED , &ip->i_flags);list_del (&ip->i_ordered);
@@ -564,7 +564,7 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp)filemap_fdatawrite (ip->i_inode.i_mapping);spin_lock (&sdp->sd_ordered_lock); } -list_splice (&written, &sdp->sd_log_le_ordered); +list_splice (&written, &sdp->sd_log_ordered);spin_unlock (&sdp->sd_ordered_lock); }
@@ -573,8 +573,8 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp)struct gfs2_inode *ip;spin_lock (&sdp->sd_ordered_lock); -while (!list_empty (&sdp->sd_log_le_ordered)) { - ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); +while (!list_empty (&sdp->sd_log_ordered)) { + ip = list_entry(sdp->sd_log_ordered.next, struct gfs2_inode, i_ordered);list_del (&ip->i_ordered);WARN_ON (!test_and_clear_bit (GIF_ORDERED , &ip->i_flags));if (ip->i_inode.i_mapping->nrpages ==0 )
@@ -611,7 +611,7 @@ void gfs2_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)gfs2_glock_hold (gl); }set_bit (GLF_LFLUSH , &gl->gl_flags); -list_add (&bd->bd_list, &sdp->sd_log_le_revoke); +list_add (&bd->bd_list, &sdp->sd_log_revokes); }void gfs2_write_revokes (struct gfs2_sbd *sdp)
fs/gfs2/log.h +1 -1
@@ -59,7 +59,7 @@ static inline void gfs2_ordered_add_inode(struct gfs2_inode *ip)if (!test_bit (GIF_ORDERED , &ip->i_flags)) {spin_lock (&sdp->sd_ordered_lock);if (!test_and_set_bit (GIF_ORDERED , &ip->i_flags)) -list_add (&ip->i_ordered, &sdp->sd_log_le_ordered); +list_add (&ip->i_ordered, &sdp->sd_log_ordered);spin_unlock (&sdp->sd_ordered_lock); } }
fs/gfs2/lops.c +2 -2
@@ -623,7 +623,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) {struct gfs2_meta_header *mh;unsigned int offset; -struct list_head *head = &sdp->sd_log_le_revoke; +struct list_head *head = &sdp->sd_log_revokes;struct gfs2_bufdata *bd;struct page *page;unsigned int length;
@@ -661,7 +661,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)static void revoke_lo_after_commit (struct gfs2_sbd *sdp,struct gfs2_trans *tr) { -struct list_head *head = &sdp->sd_log_le_revoke; +struct list_head *head = &sdp->sd_log_revokes;struct gfs2_bufdata *bd, *tmp;/*
fs/gfs2/ops_fstype.c +2 -2
@@ -117,8 +117,8 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)spin_lock_init (&sdp->sd_log_lock);atomic_set (&sdp->sd_log_pinned,0 ); -INIT_LIST_HEAD (&sdp->sd_log_le_revoke); -INIT_LIST_HEAD (&sdp->sd_log_le_ordered); +INIT_LIST_HEAD (&sdp->sd_log_revokes); +INIT_LIST_HEAD (&sdp->sd_log_ordered);spin_lock_init (&sdp->sd_ordered_lock);init_waitqueue_head (&sdp->sd_log_waitq);
fs/gfs2/trans.c +1 -1
@@ -260,7 +260,7 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len)unsigned int n = len;gfs2_log_lock (sdp); -list_for_each_entry_safe (bd, tmp, &sdp->sd_log_le_revoke, bd_list) { +list_for_each_entry_safe (bd, tmp, &sdp->sd_log_revokes, bd_list) {if ((bd->bd_blkno >= blkno) && (bd->bd_blkno < (blkno + len))) {list_del_init (&bd->bd_list);gfs2_assert_withdraw (sdp, sdp->sd_log_num_revoke);
Signature · 1 line
2.20.1
Andreas Gruenbacher
maintainerPATCH 4/4 gf2: Rename gfs2_trans_{add_unrevoke => remove_revoke}
In reply to Andreas GruenbacherRename gfs2_trans_add_unrevoke to gfs2_trans_remove_revoke: there is no such thing as an "unrevoke" object; all this function does is remove existing revoke objects plus some bookkeeping.
Signed-off-by Andreas Gruenbacher <[email protected]>
--- fs/gfs2/bmap.c | 4 ++-- fs/gfs2/dir.c | 2 +- fs/gfs2/rgrp.c | 2 +- fs/gfs2/trans.c | 2 +- fs/gfs2/trans.h | 2 +- fs/gfs2/xattr.c | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-)
fs/gfs2/bmap.c +2 -2
@@ -142,7 +142,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)if (error) goto out_brelse;if (isdir) { -gfs2_trans_add_unrevoke (GFS2_SB (&ip->i_inode), block,1 ); +gfs2_trans_remove_revoke (GFS2_SB (&ip->i_inode), block,1 ); error =gfs2_dir_get_new_buffer (ip, block, &bh);if (error) goto out_brelse;
@@ -676,7 +676,7 @@ static int gfs2_iomap_alloc(struct inode *inode, struct iomap *iomap, goto out; alloced += n;if (state !=ALLOC_DATA ||gfs2_is_jdata (ip)) -gfs2_trans_add_unrevoke (sdp, bn, n); +gfs2_trans_remove_revoke (sdp, bn, n);switch (state) {/* Growing height of tree */ case ALLOC_GROW_HEIGHT :
fs/gfs2/dir.c +1 -1
@@ -883,7 +883,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh,if (!bh)return NULL ; -gfs2_trans_add_unrevoke (GFS2_SB (inode), bn,1 ); +gfs2_trans_remove_revoke (GFS2_SB (inode), bn,1 );gfs2_trans_add_meta (ip->i_gl, bh);gfs2_metatype_set (bh,GFS2_METATYPE_LF ,GFS2_FORMAT_LF ); leaf = (struct gfs2_leaf *)bh->b_data;
fs/gfs2/rgrp.c +1 -1
@@ -2440,7 +2440,7 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks,gfs2_statfs_change (sdp,0 , -(s64)*nblocks, dinode ?1 :0 );if (dinode) -gfs2_trans_add_unrevoke (sdp, block, *nblocks); +gfs2_trans_remove_revoke (sdp, block, *nblocks);gfs2_quota_change (ip, *nblocks, ip->i_inode.i_uid, ip->i_inode.i_gid);
fs/gfs2/trans.c +1 -1
@@ -253,7 +253,7 @@ void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) tr->tr_num_revoke++; } -void gfs2_trans_add_unrevoke (struct gfs2_sbd *sdp,u64 blkno,unsigned int len) +void gfs2_trans_remove_revoke (struct gfs2_sbd *sdp,u64 blkno,unsigned int len) {struct gfs2_bufdata *bd, *tmp;struct gfs2_trans *tr = current->journal_info;
fs/gfs2/trans.h +1 -1
@@ -44,6 +44,6 @@ extern void gfs2_trans_end(struct gfs2_sbd *sdp);extern void gfs2_trans_add_data (struct gfs2_glock *gl,struct buffer_head *bh);extern void gfs2_trans_add_meta (struct gfs2_glock *gl,struct buffer_head *bh);extern void gfs2_trans_add_revoke (struct gfs2_sbd *sdp,struct gfs2_bufdata *bd); -extern void gfs2_trans_add_unrevoke (struct gfs2_sbd *sdp,u64 blkno,unsigned int len); +extern void gfs2_trans_remove_revoke (struct gfs2_sbd *sdp,u64 blkno,unsigned int len);#endif /* __TRANS_DOT_H__ */
fs/gfs2/xattr.c +3 -3
@@ -631,7 +631,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp) error =gfs2_alloc_blocks (ip, &block, &n,0 ,NULL );if (error)return error; -gfs2_trans_add_unrevoke (sdp, block,1 ); +gfs2_trans_remove_revoke (sdp, block,1 ); *bhp =gfs2_meta_new (ip->i_gl, block);gfs2_trans_add_meta (ip->i_gl, *bhp);gfs2_metatype_set (*bhp,GFS2_METATYPE_EA ,GFS2_FORMAT_EA );
@@ -693,7 +693,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, error =gfs2_alloc_blocks (ip, &block, &n,0 ,NULL );if (error)return error; -gfs2_trans_add_unrevoke (sdp, block,1 ); +gfs2_trans_remove_revoke (sdp, block,1 ); bh =gfs2_meta_new (ip->i_gl, block);gfs2_trans_add_meta (ip->i_gl, bh);gfs2_metatype_set (bh,GFS2_METATYPE_ED ,GFS2_FORMAT_ED );
@@ -997,7 +997,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, error =gfs2_alloc_blocks (ip, &blk, &n,0 ,NULL );if (error)return error; -gfs2_trans_add_unrevoke (sdp, blk,1 ); +gfs2_trans_remove_revoke (sdp, blk,1 ); indbh =gfs2_meta_new (ip->i_gl, blk);gfs2_trans_add_meta (ip->i_gl, indbh);gfs2_metatype_set (indbh,GFS2_METATYPE_IN ,GFS2_FORMAT_IN );
Signature · 1 line
2.20.1