Revert commit "gfs2: Replace gl_revokes with a GLF flag".
-----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJc+SSIAAoJENW/n+sDE2U6Vx8P/jP9FW/JNMj4JeXVMPvSP4eB raZDEUNksGnWu7/JAjoz5PruPZaeW+CoDq25oiB7MalMopEXZ4RRovhmrrZBXqP3 jI7/4yoHRJf5907ZFfbNHX3vL8up+I3Ej1jf8fsEpbTMlO95n5dtsTJIcuBpRB6L Oq4M7sIrSU8FxRhOt+wBw042R3FWLYkNZ7mYV+VbiC/OXGSnOWj/uhZ04m83B39a B0EylS0RIMVkS187+7gVxn5Rcyg0go+/Hi3pdMwBcWFOsVfAPI4Gr7n4F/CI4he5 lb4B6CMlQR0m1Nsqvvx+s3TUxlnAxuRJ9Kdam2T0emVvNkQTOpBvA6mHsk3WNfrl 6YE06wkpk29tLGD0a1cKwY4tiQrJ7isi2n/9pCw8NsWVJM2vMMILIBjNWFQ6wKOo JnrKe3gjEe/lXN6JuZRZQaP2VkaRO9a86Op7WsPmt5LWAIyRFj0EQMJFay+dhjcl N/MpAXzhuNrHGHpuf0X+9caWhLciAZmd3t/CbEaNCbHMlha7S9iFaIChy899gFob L8ODwrHGozOQXSJzqOxLgGEos7BQLyrxnurBqe1aU3JHmQXLD32xQA69qTphvRf9 wlYSVm4eitg5QgGQPgwMilAb51O+3gQkDuas8uUS9LbRcnauhjNw4zabM4L8tOT2 fW4JhUxxw39fj+/GBtX2 =ilXy -----END PGP SIGNATURE----- Merge tag 'gfs2-v5.2.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fix from Andreas Gruenbacher: "A revert for a patch that turned out to be broken" * tag 'gfs2-v5.2.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: Revert "gfs2: Replace gl_revokes with a GLF flag"
This commit is contained in:
commit
dc8ca9cc6e
|
@ -140,7 +140,7 @@ void gfs2_glock_free(struct gfs2_glock *gl)
|
|||
{
|
||||
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
|
||||
|
||||
BUG_ON(test_bit(GLF_REVOKES, &gl->gl_flags));
|
||||
BUG_ON(atomic_read(&gl->gl_revokes));
|
||||
rhashtable_remove_fast(&gl_hash_table, &gl->gl_node, ht_parms);
|
||||
smp_mb();
|
||||
wake_up_glock(gl);
|
||||
|
@ -1801,7 +1801,7 @@ void gfs2_dump_glock(struct seq_file *seq, struct gfs2_glock *gl)
|
|||
state2str(gl->gl_target),
|
||||
state2str(gl->gl_demote_state), dtime,
|
||||
atomic_read(&gl->gl_ail_count),
|
||||
test_bit(GLF_REVOKES, &gl->gl_flags) ? 1 : 0,
|
||||
atomic_read(&gl->gl_revokes),
|
||||
(int)gl->gl_lockref.count, gl->gl_hold_time);
|
||||
|
||||
list_for_each_entry(gh, &gl->gl_holders, gh_list)
|
||||
|
|
|
@ -345,7 +345,6 @@ enum {
|
|||
GLF_OBJECT = 14, /* Used only for tracing */
|
||||
GLF_BLOCKING = 15,
|
||||
GLF_INODE_CREATING = 16, /* Inode creation occurring */
|
||||
GLF_REVOKES = 17, /* Glock has revokes in queue */
|
||||
};
|
||||
|
||||
struct gfs2_glock {
|
||||
|
@ -375,6 +374,7 @@ struct gfs2_glock {
|
|||
struct list_head gl_lru;
|
||||
struct list_head gl_ail_list;
|
||||
atomic_t gl_ail_count;
|
||||
atomic_t gl_revokes;
|
||||
struct delayed_work gl_work;
|
||||
union {
|
||||
/* For inode and iopen glocks only */
|
||||
|
|
|
@ -606,10 +606,8 @@ void gfs2_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
|
|||
gfs2_remove_from_ail(bd); /* drops ref on bh */
|
||||
bd->bd_bh = NULL;
|
||||
sdp->sd_log_num_revoke++;
|
||||
if (!test_bit(GLF_REVOKES, &gl->gl_flags)) {
|
||||
set_bit(GLF_REVOKES, &gl->gl_flags);
|
||||
if (atomic_inc_return(&gl->gl_revokes) == 1)
|
||||
gfs2_glock_hold(gl);
|
||||
}
|
||||
set_bit(GLF_LFLUSH, &gl->gl_flags);
|
||||
list_add(&bd->bd_list, &sdp->sd_log_revokes);
|
||||
}
|
||||
|
|
|
@ -860,34 +860,19 @@ 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_revokes;
|
||||
struct gfs2_bufdata *bd, *tmp;
|
||||
struct gfs2_bufdata *bd;
|
||||
struct gfs2_glock *gl;
|
||||
|
||||
/*
|
||||
* Glocks can be referenced repeatedly on the revoke list, but the list
|
||||
* only holds one reference. All glocks on the list will have the
|
||||
* GLF_REVOKES flag set initially.
|
||||
*/
|
||||
|
||||
list_for_each_entry_safe(bd, tmp, head, bd_list) {
|
||||
struct gfs2_glock *gl = bd->bd_gl;
|
||||
|
||||
if (test_bit(GLF_REVOKES, &gl->gl_flags)) {
|
||||
/* Keep each glock on the list exactly once. */
|
||||
clear_bit(GLF_REVOKES, &gl->gl_flags);
|
||||
continue;
|
||||
while (!list_empty(head)) {
|
||||
bd = list_entry(head->next, struct gfs2_bufdata, bd_list);
|
||||
list_del_init(&bd->bd_list);
|
||||
gl = bd->bd_gl;
|
||||
if (atomic_dec_return(&gl->gl_revokes) == 0) {
|
||||
clear_bit(GLF_LFLUSH, &gl->gl_flags);
|
||||
gfs2_glock_queue_put(gl);
|
||||
}
|
||||
list_del(&bd->bd_list);
|
||||
kmem_cache_free(gfs2_bufdata_cachep, bd);
|
||||
}
|
||||
list_for_each_entry_safe(bd, tmp, head, bd_list) {
|
||||
struct gfs2_glock *gl = bd->bd_gl;
|
||||
|
||||
list_del(&bd->bd_list);
|
||||
kmem_cache_free(gfs2_bufdata_cachep, bd);
|
||||
clear_bit(GLF_LFLUSH, &gl->gl_flags);
|
||||
gfs2_glock_queue_put(gl);
|
||||
}
|
||||
/* the list is empty now */
|
||||
}
|
||||
|
||||
static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
|
||||
|
|
|
@ -59,6 +59,7 @@ static void gfs2_init_glock_once(void *foo)
|
|||
INIT_LIST_HEAD(&gl->gl_lru);
|
||||
INIT_LIST_HEAD(&gl->gl_ail_list);
|
||||
atomic_set(&gl->gl_ail_count, 0);
|
||||
atomic_set(&gl->gl_revokes, 0);
|
||||
}
|
||||
|
||||
static void gfs2_init_gl_aspace_once(void *foo)
|
||||
|
|
|
@ -1477,7 +1477,7 @@ static void gfs2_final_release_pages(struct gfs2_inode *ip)
|
|||
truncate_inode_pages(gfs2_glock2aspace(ip->i_gl), 0);
|
||||
truncate_inode_pages(&inode->i_data, 0);
|
||||
|
||||
if (!test_bit(GLF_REVOKES, &gl->gl_flags)) {
|
||||
if (atomic_read(&gl->gl_revokes) == 0) {
|
||||
clear_bit(GLF_LFLUSH, &gl->gl_flags);
|
||||
clear_bit(GLF_DIRTY, &gl->gl_flags);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue